aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/detail')
-rw-r--r--pugl/detail/mac.m4
-rw-r--r--pugl/detail/x11.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m
index 1139bc8..3e5a018 100644
--- a/pugl/detail/mac.m
+++ b/pugl/detail/mac.m
@@ -778,7 +778,7 @@ handleCrossing(PuglWrapperView* view, NSEvent* event, const PuglEventType type)
(void)notification;
PuglEvent ev = {{PUGL_FOCUS_IN, 0}};
- ev.focus.grab = false;
+ ev.focus.mode = PUGL_CROSSING_NORMAL;
puglDispatchEvent(window->puglview, &ev);
}
@@ -787,7 +787,7 @@ handleCrossing(PuglWrapperView* view, NSEvent* event, const PuglEventType type)
(void)notification;
PuglEvent ev = {{PUGL_FOCUS_OUT, 0}};
- ev.focus.grab = false;
+ ev.focus.mode = PUGL_CROSSING_NORMAL;
puglDispatchEvent(window->puglview, &ev);
}
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c
index 12efc43..1cd76f7 100644
--- a/pugl/detail/x11.c
+++ b/pugl/detail/x11.c
@@ -644,7 +644,12 @@ translateEvent(PuglView* view, XEvent xevent)
case FocusIn:
case FocusOut:
event.type = (xevent.type == FocusIn) ? PUGL_FOCUS_IN : PUGL_FOCUS_OUT;
- event.focus.grab = (xevent.xfocus.mode != NotifyNormal);
+ event.focus.mode = PUGL_CROSSING_NORMAL;
+ if (xevent.xfocus.mode == NotifyGrab) {
+ event.focus.mode = PUGL_CROSSING_GRAB;
+ } else if (xevent.xfocus.mode == NotifyUngrab) {
+ event.focus.mode = PUGL_CROSSING_UNGRAB;
+ }
break;
default: