diff options
author | Simon Ser <contact@emersion.fr> | 2023-02-01 19:45:21 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-02-01 23:38:12 +0100 |
commit | ae2d14ceeb60daf558c879658af596e1e5970ded (patch) | |
tree | d87652ae74dc92d79882f4e28156b3aa51bb66bc /sway/input/seatop_default.c | |
parent | ipc: add support for output event (diff) | |
download | sway-ae2d14ceeb60daf558c879658af596e1e5970ded.tar.gz sway-ae2d14ceeb60daf558c879658af596e1e5970ded.tar.zst sway-ae2d14ceeb60daf558c879658af596e1e5970ded.zip |
Convert to wlr_xwayland_surface_try_from_wlr_surface()
Accomodate for the breaking changes in [1].
[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/fbf5982e3838ee28b5345e98832f6956c402b225
Diffstat (limited to 'sway/input/seatop_default.c')
-rw-r--r-- | sway/input/seatop_default.c | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c index 6c69a0ea..a1c1d319 100644 --- a/sway/input/seatop_default.c +++ b/sway/input/seatop_default.c | |||
@@ -228,6 +228,9 @@ 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 | #if HAVE_XWAYLAND | ||
232 | struct wlr_xwayland_surface *xsurface; | ||
233 | #endif | ||
231 | if (wlr_surface_is_layer_surface(surface)) { | 234 | if (wlr_surface_is_layer_surface(surface)) { |
232 | // Handle tapping a layer surface | 235 | // Handle tapping a layer surface |
233 | struct wlr_layer_surface_v1 *layer = | 236 | struct wlr_layer_surface_v1 *layer = |
@@ -264,16 +267,13 @@ static void handle_tablet_tool_tip(struct sway_seat *seat, | |||
264 | } | 267 | } |
265 | #if HAVE_XWAYLAND | 268 | #if HAVE_XWAYLAND |
266 | // Handle tapping on an xwayland unmanaged view | 269 | // Handle tapping on an xwayland unmanaged view |
267 | else if (wlr_surface_is_xwayland_surface(surface)) { | 270 | else if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(surface)) && |
268 | struct wlr_xwayland_surface *xsurface = | 271 | xsurface->override_redirect && |
269 | wlr_xwayland_surface_from_wlr_surface(surface); | 272 | wlr_xwayland_or_surface_wants_focus(xsurface)) { |
270 | if (xsurface->override_redirect && | 273 | struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland; |
271 | wlr_xwayland_or_surface_wants_focus(xsurface)) { | 274 | wlr_xwayland_set_seat(xwayland, seat->wlr_seat); |
272 | struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland; | 275 | seat_set_focus_surface(seat, xsurface->surface, false); |
273 | wlr_xwayland_set_seat(xwayland, seat->wlr_seat); | 276 | transaction_commit_dirty(); |
274 | seat_set_focus_surface(seat, xsurface->surface, false); | ||
275 | transaction_commit_dirty(); | ||
276 | } | ||
277 | } | 277 | } |
278 | #endif | 278 | #endif |
279 | 279 | ||
@@ -514,18 +514,16 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec, | |||
514 | 514 | ||
515 | #if HAVE_XWAYLAND | 515 | #if HAVE_XWAYLAND |
516 | // Handle clicking on xwayland unmanaged view | 516 | // Handle clicking on xwayland unmanaged view |
517 | if (surface && wlr_surface_is_xwayland_surface(surface)) { | 517 | struct wlr_xwayland_surface *xsurface; |
518 | struct wlr_xwayland_surface *xsurface = | 518 | if (surface && |
519 | wlr_xwayland_surface_from_wlr_surface(surface); | 519 | (xsurface = wlr_xwayland_surface_try_from_wlr_surface(surface)) && |
520 | if (xsurface->override_redirect && | 520 | xsurface->override_redirect && |
521 | wlr_xwayland_or_surface_wants_focus(xsurface)) { | 521 | wlr_xwayland_or_surface_wants_focus(xsurface)) { |
522 | struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland; | 522 | struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland; |
523 | wlr_xwayland_set_seat(xwayland, seat->wlr_seat); | 523 | wlr_xwayland_set_seat(xwayland, seat->wlr_seat); |
524 | seat_set_focus_surface(seat, xsurface->surface, false); | 524 | seat_set_focus_surface(seat, xsurface->surface, false); |
525 | transaction_commit_dirty(); | 525 | transaction_commit_dirty(); |
526 | seat_pointer_notify_button(seat, time_msec, button, state); | 526 | seat_pointer_notify_button(seat, time_msec, button, state); |
527 | return; | ||
528 | } | ||
529 | } | 527 | } |
530 | #endif | 528 | #endif |
531 | 529 | ||