diff options
Diffstat (limited to 'platform/x11')
-rw-r--r-- | platform/x11/os_x11.cpp | 16 | ||||
-rw-r--r-- | platform/x11/os_x11.h | 1 |
2 files changed, 16 insertions, 1 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 51f4392eb4..482e4d7159 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1181,8 +1181,22 @@ void OS_X11::process_xevents() { XVisibilityEvent * visibility = (XVisibilityEvent *)&event; minimized = (visibility->state == VisibilityFullyObscured); } break; + case LeaveNotify: { - case FocusIn: + if (main_loop && mouse_mode!=MOUSE_MODE_CAPTURED) + main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_EXIT); + if (input) + input->set_mouse_in_window(false); + + } break; + case EnterNotify: { + + if (main_loop && mouse_mode!=MOUSE_MODE_CAPTURED) + main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER); + if (input) + input->set_mouse_in_window(true); + } break; + case FocusIn: minimized = false; #ifdef NEW_WM_API if(current_videomode.fullscreen) { diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 12f0aec611..95857c0344 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -46,6 +46,7 @@ #include "drivers/pulseaudio/audio_driver_pulseaudio.h" #include "servers/physics_2d/physics_2d_server_sw.h" #include "servers/physics_2d/physics_2d_server_wrap_mt.h" +#include "main/input_default.h" #include <X11/keysym.h> #include <X11/Xlib.h> |