1
0
Fork 0

Platform/Unix/X11Display.cpp: Capture input focus events (just log for now).

This commit is contained in:
Henrik Hautakoski 2020-12-20 13:55:56 +01:00
parent 56c24f7118
commit d971cd6cb2

View file

@ -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;
}
}