From b00a145fa35024b2112b22777075f6ab41cf6f1f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 22 Jul 2019 16:48:22 +0200 Subject: X11: Factor out window event mask --- pugl/pugl_x11.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'pugl') diff --git a/pugl/pugl_x11.c b/pugl/pugl_x11.c index 398ae05..e0adc31 100644 --- a/pugl/pugl_x11.c +++ b/pugl/pugl_x11.c @@ -56,6 +56,11 @@ enum WmClientStateMessageAction { WM_STATE_TOGGLE }; +static const long eventMask = + (ExposureMask | StructureNotifyMask | FocusChangeMask | + EnterWindowMask | LeaveWindowMask | PointerMotionMask | + ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask); + PuglInternals* puglInitInternals(void) { @@ -116,11 +121,7 @@ puglCreateWindow(PuglView* view, const char* title) XSetWindowAttributes attr = {0}; attr.colormap = cmap; - attr.event_mask = (ExposureMask | StructureNotifyMask | - EnterWindowMask | LeaveWindowMask | - KeyPressMask | KeyReleaseMask | - ButtonPressMask | ButtonReleaseMask | - PointerMotionMask | FocusChangeMask); + attr.event_mask = eventMask; const Window win = impl->win = XCreateWindow( display, xParent, -- cgit v1.2.1