You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Wayland: Ensure pointed window's existence in mouse_get_position
Should fix a crash with certain compositors.
This commit is contained in:
@@ -453,15 +453,13 @@ Point2i DisplayServerWayland::mouse_get_position() const {
|
||||
|
||||
WindowID pointed_id = wayland_thread.pointer_get_pointed_window_id();
|
||||
|
||||
if (pointed_id != INVALID_WINDOW_ID) {
|
||||
if (pointed_id != INVALID_WINDOW_ID && windows.has(pointed_id)) {
|
||||
return Input::get_singleton()->get_mouse_position() + windows[pointed_id].rect.position;
|
||||
}
|
||||
|
||||
// We can't properly implement this method by design.
|
||||
// This is the best we can do unfortunately.
|
||||
return Input::get_singleton()->get_mouse_position();
|
||||
|
||||
return Point2i();
|
||||
}
|
||||
|
||||
BitField<MouseButtonMask> DisplayServerWayland::mouse_get_button_state() const {
|
||||
|
||||
Reference in New Issue
Block a user