Skip to content

Commit 8ab7324

Browse files
committed
Merge pull request #106083 from Riteo/pointing-somewhere
Wayland: Ensure pointed window's existence in `mouse_get_position`
2 parents 97e5ddd + d4dabd1 commit 8ab7324

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

platform/linuxbsd/wayland/display_server_wayland.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,15 +453,13 @@ Point2i DisplayServerWayland::mouse_get_position() const {
453453

454454
WindowID pointed_id = wayland_thread.pointer_get_pointed_window_id();
455455

456-
if (pointed_id != INVALID_WINDOW_ID) {
456+
if (pointed_id != INVALID_WINDOW_ID && windows.has(pointed_id)) {
457457
return Input::get_singleton()->get_mouse_position() + windows[pointed_id].rect.position;
458458
}
459459

460460
// We can't properly implement this method by design.
461461
// This is the best we can do unfortunately.
462462
return Input::get_singleton()->get_mouse_position();
463-
464-
return Point2i();
465463
}
466464

467465
BitField<MouseButtonMask> DisplayServerWayland::mouse_get_button_state() const {

0 commit comments

Comments
 (0)