aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seatop_default.c
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2023-02-01 20:24:40 +0100
committerLibravatar Kirill Primak <vyivel@eclair.cafe>2023-02-02 14:53:15 +0300
commit9959e6b8dc9b7fbfcccd516e38bc50681f38e275 (patch)
tree8a59226530bc87f2299ee9934f99618ab089af81 /sway/input/seatop_default.c
parentroot: free non_desktop_outputs list on root_destroy (diff)
downloadsway-9959e6b8dc9b7fbfcccd516e38bc50681f38e275.tar.gz
sway-9959e6b8dc9b7fbfcccd516e38bc50681f38e275.tar.zst
sway-9959e6b8dc9b7fbfcccd516e38bc50681f38e275.zip
Convert to *_try_from_wlr_surface()
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3991
Diffstat (limited to 'sway/input/seatop_default.c')
-rw-r--r--sway/input/seatop_default.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c
index a1c1d319..0dcb87ab 100644
--- a/sway/input/seatop_default.c
+++ b/sway/input/seatop_default.c
@@ -228,17 +228,15 @@ static void handle_tablet_tool_tip(struct sway_seat *seat,
228 struct sway_container *cont = node && node->type == N_CONTAINER ? 228 struct sway_container *cont = node && node->type == N_CONTAINER ?
229 node->sway_container : NULL; 229 node->sway_container : NULL;
230 230
231 struct wlr_layer_surface_v1 *layer;
231#if HAVE_XWAYLAND 232#if HAVE_XWAYLAND
232 struct wlr_xwayland_surface *xsurface; 233 struct wlr_xwayland_surface *xsurface;
233#endif 234#endif
234 if (wlr_surface_is_layer_surface(surface)) { 235 if ((layer = wlr_layer_surface_v1_try_from_wlr_surface(surface)) &&
236 layer->current.keyboard_interactive) {
235 // Handle tapping a layer surface 237 // Handle tapping a layer surface
236 struct wlr_layer_surface_v1 *layer = 238 seat_set_focus_layer(seat, layer);
237 wlr_layer_surface_v1_from_wlr_surface(surface); 239 transaction_commit_dirty();
238 if (layer->current.keyboard_interactive) {
239 seat_set_focus_layer(seat, layer);
240 transaction_commit_dirty();
241 }
242 } else if (cont) { 240 } else if (cont) {
243 bool is_floating_or_child = container_is_floating_or_child(cont); 241 bool is_floating_or_child = container_is_floating_or_child(cont);
244 bool is_fullscreen_or_child = container_is_fullscreen_or_child(cont); 242 bool is_fullscreen_or_child = container_is_fullscreen_or_child(cont);
@@ -368,9 +366,9 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
368 } 366 }
369 367
370 // Handle clicking a layer surface 368 // Handle clicking a layer surface
371 if (surface && wlr_surface_is_layer_surface(surface)) { 369 struct wlr_layer_surface_v1 *layer;
372 struct wlr_layer_surface_v1 *layer = 370 if (surface &&
373 wlr_layer_surface_v1_from_wlr_surface(surface); 371 (layer = wlr_layer_surface_v1_try_from_wlr_surface(surface))) {
374 if (layer->current.keyboard_interactive) { 372 if (layer->current.keyboard_interactive) {
375 seat_set_focus_layer(seat, layer); 373 seat_set_focus_layer(seat, layer);
376 transaction_commit_dirty(); 374 transaction_commit_dirty();