past commti did not compile, mb
This commit is contained in:
41
src/main.cpp
41
src/main.cpp
@@ -168,6 +168,47 @@ int main (int argc, char *argv[]) {
|
|||||||
|
|
||||||
spdlog::info("Found {} output(s)", application_state->outputs.size());
|
spdlog::info("Found {} output(s)", application_state->outputs.size());
|
||||||
|
|
||||||
|
spdlog::info("Found {} output(s)", application_state->outputs.size());
|
||||||
|
|
||||||
|
// Request lock session
|
||||||
|
spdlog::info("Requesting session lock...");
|
||||||
|
application_state->session_lock = ext_session_lock_manager_v1_lock(application_state->lock_manager);
|
||||||
|
ext_session_lock_v1_add_listener(application_state->session_lock, &lock_listener, application_state.get());
|
||||||
|
|
||||||
|
// Create lock surface for each output
|
||||||
|
for (auto& output : application_state->outputs) {
|
||||||
|
// Create Wayland surface
|
||||||
|
output->wl_out_surface= wl_compositor_create_surface(application_state->compostier);
|
||||||
|
|
||||||
|
// Get lock surface for this output
|
||||||
|
output->lock_surface = ext_session_lock_v1_get_lock_surface(
|
||||||
|
application_state->session_lock,
|
||||||
|
output->wl_out_surface,
|
||||||
|
output->output
|
||||||
|
);
|
||||||
|
|
||||||
|
// Add listener for configure events
|
||||||
|
ext_session_lock_surface_v1_add_listener(
|
||||||
|
output->lock_surface,
|
||||||
|
&lock_surface_listener,
|
||||||
|
output.get()
|
||||||
|
);
|
||||||
|
|
||||||
|
// Commit to trigger configure
|
||||||
|
wl_surface_commit(output->wl_out_surface);
|
||||||
|
|
||||||
|
spdlog::debug("Created lock surface for output {}", output->registry_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Flush and wait for configure/locked events
|
||||||
|
wl_display_flush(application_state->display);
|
||||||
|
wl_display_roundtrip(application_state->display);
|
||||||
|
|
||||||
|
if (!application_state->locked) {
|
||||||
|
throw std::runtime_error("Failed to acquire lock");
|
||||||
|
}
|
||||||
|
|
||||||
|
spdlog::info("✅ Lock acquired successfully!");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user