mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Wayland: Ensure pointed window's existence in mouse_get_position
Should fix a crash with certain compositors.
This commit is contained in:
parent
1cf573f44d
commit
d4dabd15aa
1 changed files with 1 additions and 3 deletions
|
@ -453,15 +453,13 @@ Point2i DisplayServerWayland::mouse_get_position() const {
|
||||||
|
|
||||||
WindowID pointed_id = wayland_thread.pointer_get_pointed_window_id();
|
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;
|
return Input::get_singleton()->get_mouse_position() + windows[pointed_id].rect.position;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We can't properly implement this method by design.
|
// We can't properly implement this method by design.
|
||||||
// This is the best we can do unfortunately.
|
// This is the best we can do unfortunately.
|
||||||
return Input::get_singleton()->get_mouse_position();
|
return Input::get_singleton()->get_mouse_position();
|
||||||
|
|
||||||
return Point2i();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BitField<MouseButtonMask> DisplayServerWayland::mouse_get_button_state() const {
|
BitField<MouseButtonMask> DisplayServerWayland::mouse_get_button_state() const {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue