summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-02-11 08:23:23 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-02-11 08:23:23 +0100
commit63b0bcf5994e456381ac171a99dd39f297578d5b (patch)
tree01e606cd1111f09685eddef661324f2bd36f4ef3
parent179c5d3521cd7a5cbc3dc73b1fc0ce27e90b533e (diff)
KDE+X11 keyboard stops working after menu display (#904)
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
index 7fc7e2b01..76d7801b0 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
@@ -428,6 +428,9 @@ extern void fl_fix_focus(); // in Fl.cxx
void Fl_X11_Screen_Driver::grab(Fl_Window* win)
{
+ const char *p;
+ static bool using_kde =
+ ( p = getenv("XDG_CURRENT_DESKTOP") , (p && (strcmp(p, "KDE") == 0)) );
Fl_Window *fullscreen_win = NULL;
for (Fl_Window *W = Fl::first_window(); W; W = Fl::next_window(W)) {
if (W->fullscreen_active()) {
@@ -448,12 +451,14 @@ void Fl_X11_Screen_Driver::grab(Fl_Window* win)
None,
0,
fl_event_time);
- XGrabKeyboard(fl_display,
- xid,
- 1,
- GrabModeAsync,
- GrabModeAsync,
- fl_event_time);
+ if (!using_kde) { // grabbing tends to stick with KDE (#904)
+ XGrabKeyboard(fl_display,
+ xid,
+ 1,
+ GrabModeAsync,
+ GrabModeAsync,
+ fl_event_time);
+ }
}
Fl::grab_ = win; // FIXME: Fl::grab_ "should be private", but we need
// a way to *set* the variable from the driver!