diff --git a/events.cpp b/events.cpp index ac7a15d0f1..1d64b49a16 100644 --- a/events.cpp +++ b/events.cpp @@ -1014,6 +1014,14 @@ bool Client::eventFilter(QObject* o, QEvent* e) decoration->widget()->update(); return false; } + if (e->type() == QEvent::ZOrderChange) { + // when the user actions menu is closed by clicking on the window decoration (which is not unlikely) + // Qt will raise the decoration window and thus the decoration window is above the actual Client + // see QWidgetWindow::handleMouseEvent (qtbase/src/widgets/kernel/qwidgetwindow.cpp) + // when this happens also a ZOrderChange event is sent, we intercept all of them and make sure that + // the window is lowest in stack again. + Xcb::lowerWindow(decorationId()); + } return false; } diff --git a/xcbutils.h b/xcbutils.h index 88a5156d54..6c44920be0 100644 --- a/xcbutils.h +++ b/xcbutils.h @@ -42,6 +42,7 @@ static void defineCursor(xcb_window_t window, xcb_cursor_t cursor); static void setInputFocus(xcb_window_t window, uint8_t revertTo = XCB_INPUT_FOCUS_POINTER_ROOT, xcb_timestamp_t time = xTime()); static void moveWindow(xcb_window_t window, const QPoint &pos); static void moveWindow(xcb_window_t window, uint32_t x, uint32_t y); +static void lowerWindow(xcb_window_t window); static void selectInput(xcb_window_t window, uint32_t events); template