diff options
Diffstat (limited to 'sway/extensions.c')
-rw-r--r-- | sway/extensions.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sway/extensions.c b/sway/extensions.c index bd279276..c646ac91 100644 --- a/sway/extensions.c +++ b/sway/extensions.c | |||
@@ -1,10 +1,12 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <wlc/wlc.h> | 2 | #include <wlc/wlc.h> |
3 | #include <wlc/wlc-wayland.h> | 3 | #include <wlc/wlc-wayland.h> |
4 | #include <wlc/wlc-render.h> | ||
4 | #include "wayland-desktop-shell-server-protocol.h" | 5 | #include "wayland-desktop-shell-server-protocol.h" |
5 | #include "wayland-swaylock-server-protocol.h" | 6 | #include "wayland-swaylock-server-protocol.h" |
6 | #include "layout.h" | 7 | #include "layout.h" |
7 | #include "log.h" | 8 | #include "log.h" |
9 | #include "input_state.h" | ||
8 | #include "extensions.h" | 10 | #include "extensions.h" |
9 | 11 | ||
10 | struct desktop_shell_state desktop_shell; | 12 | struct desktop_shell_state desktop_shell; |
@@ -76,6 +78,7 @@ static void set_background(struct wl_client *client, struct wl_resource *resourc | |||
76 | config->wl_surface_res = surface; | 78 | config->wl_surface_res = surface; |
77 | list_add(desktop_shell.backgrounds, config); | 79 | list_add(desktop_shell.backgrounds, config); |
78 | wl_resource_set_destructor(surface, background_surface_destructor); | 80 | wl_resource_set_destructor(surface, background_surface_destructor); |
81 | wlc_output_schedule_render(config->output); | ||
79 | } | 82 | } |
80 | 83 | ||
81 | static void set_panel(struct wl_client *client, struct wl_resource *resource, | 84 | static void set_panel(struct wl_client *client, struct wl_resource *resource, |
@@ -90,8 +93,8 @@ static void set_panel(struct wl_client *client, struct wl_resource *resource, | |||
90 | config->surface = wlc_resource_from_wl_surface_resource(surface); | 93 | config->surface = wlc_resource_from_wl_surface_resource(surface); |
91 | config->wl_surface_res = surface; | 94 | config->wl_surface_res = surface; |
92 | wl_resource_set_destructor(surface, panel_surface_destructor); | 95 | wl_resource_set_destructor(surface, panel_surface_destructor); |
93 | desktop_shell.panel_size = *wlc_surface_get_size(config->surface); | ||
94 | arrange_windows(&root_container, -1, -1); | 96 | arrange_windows(&root_container, -1, -1); |
97 | wlc_output_schedule_render(config->output); | ||
95 | } | 98 | } |
96 | 99 | ||
97 | static void desktop_set_lock_surface(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface) { | 100 | static void desktop_set_lock_surface(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface) { |
@@ -123,7 +126,14 @@ static void set_lock_surface(struct wl_client *client, struct wl_resource *resou | |||
123 | wlc_view_set_state(view->handle, WLC_BIT_FULLSCREEN, true); | 126 | wlc_view_set_state(view->handle, WLC_BIT_FULLSCREEN, true); |
124 | workspace->fullscreen = view; | 127 | workspace->fullscreen = view; |
125 | desktop_shell.is_locked = true; | 128 | desktop_shell.is_locked = true; |
126 | set_focused_container(view); | 129 | // reset input state |
130 | input_init(); | ||
131 | // set focus if the lockscreen is spawned on the currently | ||
132 | // active output | ||
133 | swayc_t *focus_output = swayc_active_output(); | ||
134 | if (focus_output == output) { | ||
135 | set_focused_container(view); | ||
136 | } | ||
127 | arrange_windows(workspace, -1, -1); | 137 | arrange_windows(workspace, -1, -1); |
128 | list_add(desktop_shell.lock_surfaces, surface); | 138 | list_add(desktop_shell.lock_surfaces, surface); |
129 | wl_resource_set_destructor(surface, lock_surface_destructor); | 139 | wl_resource_set_destructor(surface, lock_surface_destructor); |