// Some systems require a grab after the window size has been changed.
// Otherwise they might hold on to displays, resulting in them being unusable.
- if (fullscreen_active() && fullscreenSystemKeys)
- grabKeyboard();
+ maybeGrabKeyboard();
}
// Update scroll bars
repositionWidgets();
- if (!fullscreenSystemKeys)
- break;
-
if (fullscreen_active())
- grabKeyboard();
+ maybeGrabKeyboard();
else
ungrabKeyboard();
// all monitors and the user clicked on another application.
// Make sure we update our grabs with the focus changes.
case FL_FOCUS:
- if (fullscreenSystemKeys) {
- if (dw->fullscreen_active())
- dw->grabKeyboard();
- }
+ dw->maybeGrabKeyboard();
break;
case FL_UNFOCUS:
if (fullscreenSystemKeys) {
}
#endif
+void DesktopWindow::maybeGrabKeyboard()
+{
+ if (fullscreenSystemKeys && fullscreen_active())
+ grabKeyboard();
+}
+
void DesktopWindow::grabKeyboard()
{
// Grabbing the keyboard is fairly safe as FLTK reroutes events to the
assert(self);
- if (!fullscreenSystemKeys)
- return;
- if (!self->fullscreen_active())
- return;
-
- self->grabKeyboard();
+ self->maybeGrabKeyboard();
}
{
DesktopWindow *self = (DesktopWindow*)data;
- if (self->fullscreen_active() && fullscreenSystemKeys)
- self->grabKeyboard();
+ if (fullscreenSystemKeys)
+ self->maybeGrabKeyboard();
else
self->ungrabKeyboard();