mirror of
https://github.com/swaywm/sway.git
synced 2025-10-31 22:25:26 -04:00
Implement compositor support for swaylock
This makes swaylock more or less work.
This commit is contained in:
parent
eefc93db43
commit
3282163f64
3 changed files with 36 additions and 4 deletions
|
|
@ -108,7 +108,6 @@ int main(int argc, char **argv) {
|
|||
if (!window) {
|
||||
sway_abort("Failed to create surfaces.");
|
||||
}
|
||||
lock_set_lock_surface(registry->swaylock, output->output, window->surface);
|
||||
list_add(surfaces, window);
|
||||
}
|
||||
|
||||
|
|
@ -217,7 +216,17 @@ int main(int argc, char **argv) {
|
|||
|
||||
cairo_surface_destroy(image);
|
||||
|
||||
while (wl_display_dispatch(registry->display) != -1);
|
||||
bool locked = false;
|
||||
while (wl_display_dispatch(registry->display) != -1) {
|
||||
if (!locked) {
|
||||
for (i = 0; i < registry->outputs->length; ++i) {
|
||||
struct output_state *output = registry->outputs->items[i];
|
||||
struct window *window = surfaces->items[i];
|
||||
lock_set_lock_surface(registry->swaylock, output->output, window->surface);
|
||||
}
|
||||
locked = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < surfaces->length; ++i) {
|
||||
struct window *window = surfaces->items[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue