aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-07-22 14:53:37 +0200
committerDavid Robillard <d@drobilla.net>2019-07-23 20:28:56 +0200
commit1fef5e07611cc0a3bfeeec528a6b018b9e9805b9 (patch)
treeabb0c03314cb503813c6ba6eb082bfcfdccb8dc2
parent8d8e662f135b01fd7ed67a8f3074f7958dfb28f0 (diff)
downloadpugl-1fef5e07611cc0a3bfeeec528a6b018b9e9805b9.tar.gz
pugl-1fef5e07611cc0a3bfeeec528a6b018b9e9805b9.tar.bz2
pugl-1fef5e07611cc0a3bfeeec528a6b018b9e9805b9.zip
X11: Factor out impl variable for brevity
-rw-r--r--pugl/pugl_x11.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/pugl/pugl_x11.c b/pugl/pugl_x11.c
index 512a383..97c3351 100644
--- a/pugl/pugl_x11.c
+++ b/pugl/pugl_x11.c
@@ -488,28 +488,29 @@ puglProcessEvents(PuglView* view)
/* Maintain a single expose/configure event to execute after all pending
events. This avoids redundant drawing/configuration which prevents a
series of window resizes in the same loop from being laggy. */
- PuglEvent expose_event = { 0 };
- PuglEvent config_event = { 0 };
- XEvent xevent;
- while (XPending(view->impl->display) > 0) {
- XNextEvent(view->impl->display, &xevent);
+ PuglInternals* const impl = view->impl;
+ PuglEvent expose_event = { 0 };
+ PuglEvent config_event = { 0 };
+ XEvent xevent;
+ while (XPending(impl->display) > 0) {
+ XNextEvent(impl->display, &xevent);
if (xevent.type == KeyRelease) {
// Ignore key repeat if necessary
if (view->ignoreKeyRepeat &&
- XEventsQueued(view->impl->display, QueuedAfterReading)) {
+ XEventsQueued(impl->display, QueuedAfterReading)) {
XEvent next;
- XPeekEvent(view->impl->display, &next);
+ XPeekEvent(impl->display, &next);
if (next.type == KeyPress &&
next.xkey.time == xevent.xkey.time &&
next.xkey.keycode == xevent.xkey.keycode) {
- XNextEvent(view->impl->display, &xevent);
+ XNextEvent(impl->display, &xevent);
continue;
}
}
} else if (xevent.type == FocusIn) {
- XSetICFocus(view->impl->xic);
+ XSetICFocus(impl->xic);
} else if (xevent.type == FocusOut) {
- XUnsetICFocus(view->impl->xic);
+ XUnsetICFocus(impl->xic);
}
// Translate X11 event to Pugl event
@@ -533,7 +534,7 @@ puglProcessEvents(PuglView* view)
if (config_event.type) {
view->width = (int)config_event.configure.width;
view->height = (int)config_event.configure.height;
- view->impl->ctx.resize(view, view->width, view->height);
+ impl->ctx.resize(view, view->width, view->height);
view->eventFunc(view, (const PuglEvent*)&config_event);
}