Chase wlroots!2434

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/2434
This commit is contained in:
Bill Li 2024-07-14 16:24:14 +08:00 committed by Simon Ser
parent 274a5fcb73
commit fc2796aee8
5 changed files with 10 additions and 10 deletions

View file

@ -71,7 +71,7 @@ static void unmanaged_handle_map(struct wl_listener *listener, void *data) {
surface->set_geometry.notify = unmanaged_handle_set_geometry; surface->set_geometry.notify = unmanaged_handle_set_geometry;
} }
if (wlr_xwayland_or_surface_wants_focus(xsurface)) { if (wlr_xwayland_surface_override_redirect_wants_focus(xsurface)) {
struct sway_seat *seat = input_manager_current_seat(); struct sway_seat *seat = input_manager_current_seat();
struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland; struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland;
wlr_xwayland_set_seat(xwayland, seat->wlr_seat); wlr_xwayland_set_seat(xwayland, seat->wlr_seat);
@ -96,7 +96,7 @@ static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) {
// This simply returns focus to the parent surface if there's one available. // This simply returns focus to the parent surface if there's one available.
// This seems to handle JetBrains issues. // This seems to handle JetBrains issues.
if (xsurface->parent && xsurface->parent->surface if (xsurface->parent && xsurface->parent->surface
&& wlr_xwayland_or_surface_wants_focus(xsurface->parent)) { && wlr_xwayland_surface_override_redirect_wants_focus(xsurface->parent)) {
seat_set_focus_surface(seat, xsurface->parent->surface, false); seat_set_focus_surface(seat, xsurface->parent->surface, false);
return; return;
} }

View file

@ -578,7 +578,7 @@ static void handle_tablet_tool_position(struct sway_cursor *cursor,
// tablet events until the drag is released, even if we are now over a // tablet events until the drag is released, even if we are now over a
// non-tablet surface. // non-tablet surface.
if (!cursor->simulating_pointer_from_tool_tip && if (!cursor->simulating_pointer_from_tool_tip &&
((surface && wlr_surface_accepts_tablet_v2(tablet->tablet_v2, surface)) || ((surface && wlr_surface_accepts_tablet_v2(surface, tablet->tablet_v2)) ||
wlr_tablet_tool_v2_has_implicit_grab(tool->tablet_v2_tool))) { wlr_tablet_tool_v2_has_implicit_grab(tool->tablet_v2_tool))) {
seatop_tablet_tool_motion(seat, tool, time_msec); seatop_tablet_tool_motion(seat, tool, time_msec);
} else { } else {
@ -664,7 +664,7 @@ static void handle_tool_tip(struct wl_listener *listener, void *data) {
dispatch_cursor_button(cursor, &event->tablet->base, event->time_msec, dispatch_cursor_button(cursor, &event->tablet->base, event->time_msec,
BTN_LEFT, WL_POINTER_BUTTON_STATE_RELEASED); BTN_LEFT, WL_POINTER_BUTTON_STATE_RELEASED);
wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat); wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat);
} else if (!surface || !wlr_surface_accepts_tablet_v2(tablet_v2, surface)) { } else if (!surface || !wlr_surface_accepts_tablet_v2(surface, tablet_v2)) {
// If we started holding the tool tip down on a surface that accepts // If we started holding the tool tip down on a surface that accepts
// tablet v2, we should notify that surface if it gets released over a // tablet v2, we should notify that surface if it gets released over a
// surface that doesn't support v2. // surface that doesn't support v2.
@ -749,7 +749,7 @@ static void handle_tool_button(struct wl_listener *listener, void *data) {
bool mod_pressed = modifiers & config->floating_mod; bool mod_pressed = modifiers & config->floating_mod;
bool surface_supports_tablet_events = bool surface_supports_tablet_events =
surface && wlr_surface_accepts_tablet_v2(tablet_v2, surface); surface && wlr_surface_accepts_tablet_v2(surface, tablet_v2);
// Simulate pointer when: // Simulate pointer when:
// 1. The modifier key is pressed, OR // 1. The modifier key is pressed, OR

View file

@ -273,7 +273,7 @@ static void handle_tablet_tool_tip(struct sway_seat *seat,
// Handle tapping on an xwayland unmanaged view // Handle tapping on an xwayland unmanaged view
else if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(surface)) && else if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(surface)) &&
xsurface->override_redirect && xsurface->override_redirect &&
wlr_xwayland_or_surface_wants_focus(xsurface)) { wlr_xwayland_surface_override_redirect_wants_focus(xsurface)) {
struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland; struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland;
wlr_xwayland_set_seat(xwayland, seat->wlr_seat); wlr_xwayland_set_seat(xwayland, seat->wlr_seat);
seat_set_focus_surface(seat, xsurface->surface, false); seat_set_focus_surface(seat, xsurface->surface, false);
@ -521,7 +521,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
if (surface && if (surface &&
(xsurface = wlr_xwayland_surface_try_from_wlr_surface(surface)) && (xsurface = wlr_xwayland_surface_try_from_wlr_surface(surface)) &&
xsurface->override_redirect && xsurface->override_redirect &&
wlr_xwayland_or_surface_wants_focus(xsurface)) { wlr_xwayland_surface_override_redirect_wants_focus(xsurface)) {
struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland; struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland;
wlr_xwayland_set_seat(xwayland, seat->wlr_seat); wlr_xwayland_set_seat(xwayland, seat->wlr_seat);
seat_set_focus_surface(seat, xsurface->surface, false); seat_set_focus_surface(seat, xsurface->surface, false);
@ -667,7 +667,7 @@ static void handle_touch_down(struct sway_seat *seat,
double sx, sy; double sx, sy;
node_at_coords(seat, seat->touch_x, seat->touch_y, &surface, &sx, &sy); node_at_coords(seat, seat->touch_x, seat->touch_y, &surface, &sx, &sy);
if (surface && wlr_surface_accepts_touch(wlr_seat, surface)) { if (surface && wlr_surface_accepts_touch(surface, wlr_seat)) {
if (seat_is_input_allowed(seat, surface)) { if (seat_is_input_allowed(seat, surface)) {
cursor->simulating_pointer_from_touch = false; cursor->simulating_pointer_from_touch = false;
seatop_begin_touch_down(seat, surface, event, sx, sy, lx, ly); seatop_begin_touch_down(seat, surface, event, sx, sy, lx, ly);

View file

@ -363,7 +363,7 @@ void sway_tablet_pad_set_focus(struct sway_tablet_pad *tablet_pad,
} }
if (surface == NULL || if (surface == NULL ||
!wlr_surface_accepts_tablet_v2(tablet_pad->tablet->tablet_v2, surface)) { !wlr_surface_accepts_tablet_v2(surface, tablet_pad->tablet->tablet_v2)) {
return; return;
} }

View file

@ -850,7 +850,7 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface,
#if WLR_HAS_XWAYLAND #if WLR_HAS_XWAYLAND
struct wlr_xwayland_surface *xsurface; struct wlr_xwayland_surface *xsurface;
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(wlr_surface))) { if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(wlr_surface))) {
set_focus &= wlr_xwayland_icccm_input_model(xsurface) != set_focus &= wlr_xwayland_surface_icccm_input_model(xsurface) !=
WLR_ICCCM_INPUT_MODEL_NONE; WLR_ICCCM_INPUT_MODEL_NONE;
} }
#endif #endif