summaryrefslogtreecommitdiffstats
path: root/sway/extensions.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/extensions.c')
-rw-r--r--sway/extensions.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/sway/extensions.c b/sway/extensions.c
index 4611f33e..60cd8d41 100644
--- a/sway/extensions.c
+++ b/sway/extensions.c
@@ -4,11 +4,11 @@
4#include <wlc/wlc-render.h> 4#include <wlc/wlc-render.h>
5#include "wayland-desktop-shell-server-protocol.h" 5#include "wayland-desktop-shell-server-protocol.h"
6#include "wayland-swaylock-server-protocol.h" 6#include "wayland-swaylock-server-protocol.h"
7#include "layout.h" 7#include "sway/layout.h"
8#include "sway/input_state.h"
9#include "sway/extensions.h"
10#include "sway/ipc-server.h"
8#include "log.h" 11#include "log.h"
9#include "input_state.h"
10#include "extensions.h"
11#include "ipc-server.h"
12 12
13struct desktop_shell_state desktop_shell; 13struct desktop_shell_state desktop_shell;
14 14
@@ -119,27 +119,21 @@ static void set_lock_surface(struct wl_client *client, struct wl_resource *resou
119 if (!swayc_is_child_of(view, workspace)) { 119 if (!swayc_is_child_of(view, workspace)) {
120 move_container_to(view, workspace); 120 move_container_to(view, workspace);
121 } 121 }
122 // make the view floating so it doesn't rearrange other 122 // make the view floating so it doesn't rearrange other siblings.
123 // siblings.
124 if (!view->is_floating) { 123 if (!view->is_floating) {
125 // Remove view from its current location
126 destroy_container(remove_child(view)); 124 destroy_container(remove_child(view));
127 // and move it into workspace floating
128 add_floating(workspace, view); 125 add_floating(workspace, view);
129 } 126 }
130 wlc_view_set_state(view->handle, WLC_BIT_FULLSCREEN, true); 127 wlc_view_set_state(view->handle, WLC_BIT_FULLSCREEN, true);
131 workspace->fullscreen = view; 128 wlc_view_bring_to_front(view->handle);
132 ipc_event_window(view, "fullscreen_mode"); 129 wlc_view_focus(view->handle);
133 desktop_shell.is_locked = true; 130 desktop_shell.is_locked = true;
134 // reset input state
135 input_init(); 131 input_init();
136 // set focus if the lockscreen is spawned on the currently 132 arrange_windows(workspace, -1, -1);
137 // active output
138 swayc_t *focus_output = swayc_active_output(); 133 swayc_t *focus_output = swayc_active_output();
139 if (focus_output == output) { 134 if (focus_output == output) {
140 set_focused_container(view); 135 set_focused_container(view);
141 } 136 }
142 arrange_windows(workspace, -1, -1);
143 list_add(desktop_shell.lock_surfaces, surface); 137 list_add(desktop_shell.lock_surfaces, surface);
144 wl_resource_set_destructor(surface, lock_surface_destructor); 138 wl_resource_set_destructor(surface, lock_surface_destructor);
145 } else { 139 } else {