From d971cd6cb2640ac5d810a9037b5562d4c32e803e Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 20 Dec 2020 13:55:56 +0100 Subject: [PATCH] Platform/Unix/X11Display.cpp: Capture input focus events (just log for now). --- source/Platform/Unix/X11Display.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/Platform/Unix/X11Display.cpp b/source/Platform/Unix/X11Display.cpp index 2cbb3d0..435ab82 100644 --- a/source/Platform/Unix/X11Display.cpp +++ b/source/Platform/Unix/X11Display.cpp @@ -46,8 +46,9 @@ bool X11Display::create(DisplayDescription description) attr.background_pixel = WhitePixel(m_disp, m_screen); //attr.override_redirect = True; attr.colormap = ::XCreateColormap(m_disp, root_win, visual, AllocNone); - // We want Keyboard,Mouse,Resize,Exposure (repaint) events. - attr.event_mask = KeyPressMask | KeyReleaseMask + // We want InputFocus,Keyboard,Mouse,Resize,Exposure (repaint) events. + attr.event_mask = FocusChangeMask + | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask | ExposureMask; @@ -258,6 +259,15 @@ void X11Display::processEvent(const ::XEvent& event) onReshape(size.x, size.y); } break; + case MotionNotify : + // Generates to much events to log :) + break; + case FocusIn: + Log::debug("X11: FocusIn"); + break; + case FocusOut: + Log::debug("X11: FocusOut"); + break; } }