diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-02-11 08:23:23 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-02-11 08:23:23 +0100 |
| commit | 63b0bcf5994e456381ac171a99dd39f297578d5b (patch) | |
| tree | 01e606cd1111f09685eddef661324f2bd36f4ef3 /src/drivers | |
| parent | 179c5d3521cd7a5cbc3dc73b1fc0ce27e90b533e (diff) | |
KDE+X11 keyboard stops working after menu display (#904)
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/X11/Fl_X11_Screen_Driver.cxx | 17 |
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! |
