|
@@ -670,7 +670,8 @@ static void pointer_dispatch_absolute_motion(SDL_WaylandSeat *seat, bool warp)
|
|
|
Wayland_SeatUpdatePointerGrab(seat);
|
|
Wayland_SeatUpdatePointerGrab(seat);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (window->hit_test) {
|
|
|
|
|
|
|
+ // Don't perform hit testing if an implicit grab is active.
|
|
|
|
|
+ if (!(window->flags & SDL_WINDOW_MOUSE_CAPTURE) && window->hit_test) {
|
|
|
SDL_HitTestResult rc = window->hit_test(window, &seat->pointer.last_motion, window->hit_test_data);
|
|
SDL_HitTestResult rc = window->hit_test(window, &seat->pointer.last_motion, window->hit_test_data);
|
|
|
|
|
|
|
|
// Apply the toplevel constraints if the window isn't resizable from those directions.
|
|
// Apply the toplevel constraints if the window isn't resizable from those directions.
|
|
@@ -984,14 +985,14 @@ static void pointer_dispatch_button(SDL_WaylandSeat *seat, Uint8 sdl_button, boo
|
|
|
|
|
|
|
|
if (down) {
|
|
if (down) {
|
|
|
seat->pointer.buttons_pressed |= SDL_BUTTON_MASK(sdl_button);
|
|
seat->pointer.buttons_pressed |= SDL_BUTTON_MASK(sdl_button);
|
|
|
|
|
+
|
|
|
|
|
+ if (sdl_button == SDL_BUTTON_LEFT && Wayland_ProcessHitTest(seat, seat->last_implicit_grab_serial)) {
|
|
|
|
|
+ return; // don't pass this event on to app.
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
seat->pointer.buttons_pressed &= ~SDL_BUTTON_MASK(sdl_button);
|
|
seat->pointer.buttons_pressed &= ~SDL_BUTTON_MASK(sdl_button);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (sdl_button == SDL_BUTTON_LEFT && Wayland_ProcessHitTest(seat, seat->last_implicit_grab_serial)) {
|
|
|
|
|
- return; // don't pass this event on to app.
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// Possibly ignore this click if it was to gain focus.
|
|
// Possibly ignore this click if it was to gain focus.
|
|
|
if (window->last_focus_event_time_ns) {
|
|
if (window->last_focus_event_time_ns) {
|
|
|
if (down && (SDL_GetTicksNS() - window->last_focus_event_time_ns) < WAYLAND_FOCUS_CLICK_TIMEOUT_NS) {
|
|
if (down && (SDL_GetTicksNS() - window->last_focus_event_time_ns) < WAYLAND_FOCUS_CLICK_TIMEOUT_NS) {
|