diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-12-18 19:29:44 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-12-18 19:30:19 -0500 |
commit | 3282163f64291cfd63611110ab63e37051e80501 (patch) | |
tree | 7e89557c10e4bcc8415e482ad37106cc2e334236 /sway/extensions.c | |
parent | Fix lock extension setup in compositor (diff) | |
download | sway-3282163f64291cfd63611110ab63e37051e80501.tar.gz sway-3282163f64291cfd63611110ab63e37051e80501.tar.zst sway-3282163f64291cfd63611110ab63e37051e80501.zip |
Implement compositor support for swaylock
This makes swaylock more or less work.
Diffstat (limited to 'sway/extensions.c')
-rw-r--r-- | sway/extensions.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sway/extensions.c b/sway/extensions.c index 1ca66468..5e09bdbb 100644 --- a/sway/extensions.c +++ b/sway/extensions.c | |||
@@ -89,12 +89,27 @@ static void desktop_unlock(struct wl_client *client, struct wl_resource *resourc | |||
89 | } | 89 | } |
90 | 90 | ||
91 | static void set_lock_surface(struct wl_client *client, struct wl_resource *resource, | 91 | static void set_lock_surface(struct wl_client *client, struct wl_resource *resource, |
92 | struct wl_resource *output, struct wl_resource *surface) { | 92 | struct wl_resource *_output, struct wl_resource *surface) { |
93 | sway_log(L_ERROR, "set_lock_surface is not currently supported"); | 93 | swayc_t *output = swayc_by_handle(wlc_handle_from_wl_output_resource(_output)); |
94 | swayc_t *view = swayc_by_handle(wlc_handle_from_wl_surface_resource(surface)); | ||
95 | if (view && output) { | ||
96 | swayc_t *workspace = output->focused; | ||
97 | if (!swayc_is_child_of(view, workspace)) { | ||
98 | move_container_to(view, workspace); | ||
99 | } | ||
100 | wlc_view_set_state(view->handle, WLC_BIT_FULLSCREEN, true); | ||
101 | workspace->fullscreen = view; | ||
102 | desktop_shell.is_locked = true; | ||
103 | set_focused_container(view); | ||
104 | arrange_windows(view, -1, -1); | ||
105 | } else { | ||
106 | sway_log(L_ERROR, "Attempted to set lock surface to non-view"); | ||
107 | } | ||
94 | } | 108 | } |
95 | 109 | ||
96 | static void unlock(struct wl_client *client, struct wl_resource *resource) { | 110 | static void unlock(struct wl_client *client, struct wl_resource *resource) { |
97 | sway_log(L_ERROR, "unlock is not currently supported"); | 111 | sway_log(L_ERROR, "unlock is not currently supported"); |
112 | // This isn't really necessary, we just unlock when the client exits. | ||
98 | } | 113 | } |
99 | 114 | ||
100 | static void set_grab_surface(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface) { | 115 | static void set_grab_surface(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface) { |