mirror of
https://github.com/swaywm/sway.git
synced 2026-04-22 06:46:27 -04:00
Convert to wlr_xwayland_surface_try_from_wlr_surface()
Accomodate for the breaking changes in [1].
[1]: fbf5982e38
This commit is contained in:
parent
40eb29e7c5
commit
ae2d14ceeb
2 changed files with 25 additions and 32 deletions
|
|
@ -228,6 +228,9 @@ static void handle_tablet_tool_tip(struct sway_seat *seat,
|
|||
struct sway_container *cont = node && node->type == N_CONTAINER ?
|
||||
node->sway_container : NULL;
|
||||
|
||||
#if HAVE_XWAYLAND
|
||||
struct wlr_xwayland_surface *xsurface;
|
||||
#endif
|
||||
if (wlr_surface_is_layer_surface(surface)) {
|
||||
// Handle tapping a layer surface
|
||||
struct wlr_layer_surface_v1 *layer =
|
||||
|
|
@ -264,16 +267,13 @@ static void handle_tablet_tool_tip(struct sway_seat *seat,
|
|||
}
|
||||
#if HAVE_XWAYLAND
|
||||
// Handle tapping on an xwayland unmanaged view
|
||||
else if (wlr_surface_is_xwayland_surface(surface)) {
|
||||
struct wlr_xwayland_surface *xsurface =
|
||||
wlr_xwayland_surface_from_wlr_surface(surface);
|
||||
if (xsurface->override_redirect &&
|
||||
wlr_xwayland_or_surface_wants_focus(xsurface)) {
|
||||
struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland;
|
||||
wlr_xwayland_set_seat(xwayland, seat->wlr_seat);
|
||||
seat_set_focus_surface(seat, xsurface->surface, false);
|
||||
transaction_commit_dirty();
|
||||
}
|
||||
else if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(surface)) &&
|
||||
xsurface->override_redirect &&
|
||||
wlr_xwayland_or_surface_wants_focus(xsurface)) {
|
||||
struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland;
|
||||
wlr_xwayland_set_seat(xwayland, seat->wlr_seat);
|
||||
seat_set_focus_surface(seat, xsurface->surface, false);
|
||||
transaction_commit_dirty();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -514,18 +514,16 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
|
|||
|
||||
#if HAVE_XWAYLAND
|
||||
// Handle clicking on xwayland unmanaged view
|
||||
if (surface && wlr_surface_is_xwayland_surface(surface)) {
|
||||
struct wlr_xwayland_surface *xsurface =
|
||||
wlr_xwayland_surface_from_wlr_surface(surface);
|
||||
if (xsurface->override_redirect &&
|
||||
wlr_xwayland_or_surface_wants_focus(xsurface)) {
|
||||
struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland;
|
||||
wlr_xwayland_set_seat(xwayland, seat->wlr_seat);
|
||||
seat_set_focus_surface(seat, xsurface->surface, false);
|
||||
transaction_commit_dirty();
|
||||
seat_pointer_notify_button(seat, time_msec, button, state);
|
||||
return;
|
||||
}
|
||||
struct wlr_xwayland_surface *xsurface;
|
||||
if (surface &&
|
||||
(xsurface = wlr_xwayland_surface_try_from_wlr_surface(surface)) &&
|
||||
xsurface->override_redirect &&
|
||||
wlr_xwayland_or_surface_wants_focus(xsurface)) {
|
||||
struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland;
|
||||
wlr_xwayland_set_seat(xwayland, seat->wlr_seat);
|
||||
seat_set_focus_surface(seat, xsurface->surface, false);
|
||||
transaction_commit_dirty();
|
||||
seat_pointer_notify_button(seat, time_msec, button, state);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue