From 90abfef17294c1b382f43007d984b93c200efa9d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 5 Jul 2020 15:01:13 +0200 Subject: Replace isHint bool with a flag I don't have any particular future use case in mind, but I think the concept makes sense for general events and it seems it could be useful for things like gestures as well. Also fixes another padding warning in the API. --- pugl/detail/mac.m | 1 - pugl/detail/win.c | 1 - pugl/detail/x11.c | 4 +++- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'pugl/detail') diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m index 50c52c5..23671ae 100644 --- a/pugl/detail/mac.m +++ b/pugl/detail/mac.m @@ -379,7 +379,6 @@ handleCrossing(PuglWrapperView* view, NSEvent* event, const PuglEventType type) rloc.x, [[NSScreen mainScreen] frame].size.height - rloc.y, getModifiers(event), - 0, }; puglDispatchEvent(puglview, (const PuglEvent*)&ev); diff --git a/pugl/detail/win.c b/pugl/detail/win.c index ee690c4..7ec02ab 100644 --- a/pugl/detail/win.c +++ b/pugl/detail/win.c @@ -639,7 +639,6 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam) event.motion.xRoot = pt.x; event.motion.yRoot = pt.y; event.motion.state = getModifiers(); - event.motion.isHint = false; break; case WM_MOUSELEAVE: GetCursorPos(&pt); diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c index b06f940..c2e7f6a 100644 --- a/pugl/detail/x11.c +++ b/pugl/detail/x11.c @@ -573,7 +573,9 @@ translateEvent(PuglView* view, XEvent xevent) event.motion.xRoot = xevent.xmotion.x_root; event.motion.yRoot = xevent.xmotion.y_root; event.motion.state = translateModifiers(xevent.xmotion.state); - event.motion.isHint = (xevent.xmotion.is_hint == NotifyHint); + if (xevent.xmotion.is_hint == NotifyHint) { + event.motion.flags |= PUGL_IS_HINT; + } break; case ButtonPress: if (xevent.xbutton.button >= 4 && xevent.xbutton.button <= 7) { -- cgit v1.2.1