diff options
author | emersion <contact@emersion.fr> | 2019-02-12 22:55:23 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-02-18 15:11:48 -0500 |
commit | 06e03ed8784fe2048e48909af47c80a55d201a81 (patch) | |
tree | f6e1e3686921968161fdd5091667b2794f6ca184 /sway/desktop/layer_shell.c | |
parent | workspace_get_initial_output: handle focused layer (diff) | |
download | sway-06e03ed8784fe2048e48909af47c80a55d201a81.tar.gz sway-06e03ed8784fe2048e48909af47c80a55d201a81.tar.zst sway-06e03ed8784fe2048e48909af47c80a55d201a81.zip |
Rebase cursor when a layer surface maps
Also removes an extraneous arrange_outputs call, it's already called if
necessary in arrange_layers.
Updates https://github.com/swaywm/sway/issues/3080
Diffstat (limited to 'sway/desktop/layer_shell.c')
-rw-r--r-- | sway/desktop/layer_shell.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index de8db75d..0767247c 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c | |||
@@ -6,7 +6,9 @@ | |||
6 | #include <wlr/types/wlr_layer_shell_v1.h> | 6 | #include <wlr/types/wlr_layer_shell_v1.h> |
7 | #include <wlr/types/wlr_output_damage.h> | 7 | #include <wlr/types/wlr_output_damage.h> |
8 | #include <wlr/types/wlr_output.h> | 8 | #include <wlr/types/wlr_output.h> |
9 | #include "log.h" | ||
9 | #include "sway/desktop/transaction.h" | 10 | #include "sway/desktop/transaction.h" |
11 | #include "sway/input/cursor.h" | ||
10 | #include "sway/input/input-manager.h" | 12 | #include "sway/input/input-manager.h" |
11 | #include "sway/input/seat.h" | 13 | #include "sway/input/seat.h" |
12 | #include "sway/layers.h" | 14 | #include "sway/layers.h" |
@@ -14,7 +16,6 @@ | |||
14 | #include "sway/server.h" | 16 | #include "sway/server.h" |
15 | #include "sway/tree/arrange.h" | 17 | #include "sway/tree/arrange.h" |
16 | #include "sway/tree/workspace.h" | 18 | #include "sway/tree/workspace.h" |
17 | #include "log.h" | ||
18 | 19 | ||
19 | static void apply_exclusive(struct wlr_box *usable_area, | 20 | static void apply_exclusive(struct wlr_box *usable_area, |
20 | uint32_t anchor, int32_t exclusive, | 21 | uint32_t anchor, int32_t exclusive, |
@@ -302,6 +303,8 @@ static void unmap(struct sway_layer_surface *sway_layer) { | |||
302 | if (seat->focused_layer == sway_layer->layer_surface) { | 303 | if (seat->focused_layer == sway_layer->layer_surface) { |
303 | seat_set_focus_layer(seat, NULL); | 304 | seat_set_focus_layer(seat, NULL); |
304 | } | 305 | } |
306 | |||
307 | cursor_rebase_all(); | ||
305 | } | 308 | } |
306 | 309 | ||
307 | static void handle_destroy(struct wl_listener *listener, void *data) { | 310 | static void handle_destroy(struct wl_listener *listener, void *data) { |
@@ -321,7 +324,6 @@ static void handle_destroy(struct wl_listener *listener, void *data) { | |||
321 | struct sway_output *output = sway_layer->layer_surface->output->data; | 324 | struct sway_output *output = sway_layer->layer_surface->output->data; |
322 | if (output != NULL) { | 325 | if (output != NULL) { |
323 | arrange_layers(output); | 326 | arrange_layers(output); |
324 | arrange_output(output); | ||
325 | transaction_commit_dirty(); | 327 | transaction_commit_dirty(); |
326 | } | 328 | } |
327 | wl_list_remove(&sway_layer->output_destroy.link); | 329 | wl_list_remove(&sway_layer->output_destroy.link); |
@@ -339,6 +341,7 @@ static void handle_map(struct wl_listener *listener, void *data) { | |||
339 | // TODO: send enter to subsurfaces and popups | 341 | // TODO: send enter to subsurfaces and popups |
340 | wlr_surface_send_enter(sway_layer->layer_surface->surface, | 342 | wlr_surface_send_enter(sway_layer->layer_surface->surface, |
341 | sway_layer->layer_surface->output); | 343 | sway_layer->layer_surface->output); |
344 | cursor_rebase_all(); | ||
342 | } | 345 | } |
343 | 346 | ||
344 | static void handle_unmap(struct wl_listener *listener, void *data) { | 347 | static void handle_unmap(struct wl_listener *listener, void *data) { |