diff --git a/client.cpp b/client.cpp index 6ba04d006a..fa16234def 100644 --- a/client.cpp +++ b/client.cpp @@ -357,7 +357,7 @@ void Client::updateInputWindow() { QRegion region; - if (!noBorder() && dynamic_cast(decoration)) { + if (!noBorder()) { // This function is implemented as a slot to avoid breaking binary // compatibility QMetaObject::invokeMethod(decoration, "region", Qt::DirectConnection, @@ -391,6 +391,8 @@ void Client::updateInputWindow() input_window = XCreateWindow(display(), rootWindow(), bounds.x(), bounds.y(), bounds.width(), bounds.height(), 0, 0, InputOnly, 0, CWEventMask | CWOverrideRedirect, &attr); + if (mapping_state == Mapped) + XMapWindow(display(), inputId()); } else { XMoveResizeWindow(display(), input_window, bounds.x(), bounds.y(), bounds.width(), bounds.height()); diff --git a/events.cpp b/events.cpp index bd9ea47b16..281f9e708d 100644 --- a/events.cpp +++ b/events.cpp @@ -1180,16 +1180,17 @@ bool Client::buttonPressEvent(Window w, int button, int state, int x, int y, int XAllowEvents(display(), ReplayPointer, CurrentTime); //xTime()); return true; } - if (w == decorationId() || w == inputId()) { - if (w == inputId()) { - x = x_root - geometry().x() + padding_left; - y = y_root - geometry().y() + padding_top; - } + if (w == inputId()) { + x = x_root - geometry().x() + padding_left; + y = y_root - geometry().y() + padding_top; + // New API processes core events FIRST and only passes unused ones to the decoration + return processDecorationButtonPress(button, state, x, y, x_root, y_root, true); + } + if (w == decorationId()) { if (dynamic_cast(decoration)) // New API processes core events FIRST and only passes unused ones to the decoration return processDecorationButtonPress(button, state, x, y, x_root, y_root, true); - else - return false; // Don't eat old API decoration events + return false; } if (w == frameId()) processDecorationButtonPress(button, state, x, y, x_root, y_root); diff --git a/libkdecorations/kdecoration.cpp b/libkdecorations/kdecoration.cpp index 505824f5a9..0cdabe61c0 100644 --- a/libkdecorations/kdecoration.cpp +++ b/libkdecorations/kdecoration.cpp @@ -516,7 +516,7 @@ KDecoration::WindowOperation KDecorationUnstable::buttonToWindowOperation(Qt::Mo return static_cast< KDecorationBridgeUnstable* >(bridge_)->buttonToWindowOperation(button); } -QRegion KDecorationUnstable::region(KDecorationDefines::Region) +QRegion KDecoration::region(KDecorationDefines::Region) { return QRegion(); } diff --git a/libkdecorations/kdecoration.h b/libkdecorations/kdecoration.h index 2e156744fd..e37fd6275b 100644 --- a/libkdecorations/kdecoration.h +++ b/libkdecorations/kdecoration.h @@ -1011,6 +1011,15 @@ protected Q_SLOTS: * @since 4.10 **/ void setAlphaEnabled(bool enabled); + /** + * This slot can be reimplemented to return the regions defined + * by KDecorationDefines::Region. + * + * The default implementation always returns an empty region. + * + * @since 4.8 + */ + QRegion region(KDecorationDefines::Region r); private: KDecorationBridge* bridge_; @@ -1121,17 +1130,6 @@ public: * a button press was for window tab dragging or for displaying the client menu. */ WindowOperation buttonToWindowOperation(Qt::MouseButtons button); - -public Q_SLOTS: - /** - * This slot can be reimplemented to return the regions defined - * by KDecorationDefines::Region. - * - * The default implementation always returns an empty region. - * - * @since 4.8 - */ - QRegion region(KDecorationDefines::Region r); }; inline