diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-09-24 18:06:15 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-09-24 18:06:15 -0300 |
commit | 82a3304458738b410a5aff8994ce587413aeb464 (patch) | |
tree | b54672bc649a80ebbe1e11b0488c7dfdc6c109e7 /platform/x11 | |
parent | 59e1ad27731e66c58a3d5ee9d783eac74a1d48d9 (diff) |
Added ability to set custom mouse cursors. Not hardware accelerated yet.
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> |