From 1b01f1b3009474cc41d5c58318c1f3791fcff0fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Wed, 4 Oct 2017 21:02:16 +0200 Subject: [PATCH] Update pointer position whenever a window gets (un)minimized Summary: This fixes the following problem: 1. Have two windows maximized 2. Click minimize button on first window 3. Click minimize button on second window What happened: Second click was ignored as the pointer was not updated. BUG: 378704 FIXED-IN: 5.11 Test Plan: Nested KWin/Wayland, added two maximized windows, minimized both without moving the mouse Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D8145 --- pointer_input.cpp | 1 + workspace.cpp | 1 + workspace.h | 1 + 3 files changed, 3 insertions(+) diff --git a/pointer_input.cpp b/pointer_input.cpp index 70cef8f522..0d2dfea0bf 100644 --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -130,6 +130,7 @@ void PointerInputRedirection::init() connect(m_cursor, &CursorImage::changed, kwinApp()->platform(), &Platform::cursorChanged); emit m_cursor->changed(); connect(workspace(), &Workspace::stackingOrderChanged, this, &PointerInputRedirection::update); + connect(workspace(), &Workspace::clientMinimizedChanged, this, &PointerInputRedirection::update); connect(screens(), &Screens::changed, this, &PointerInputRedirection::updateAfterScreenChange); if (waylandServer()->hasScreenLockerIntegration()) { connect(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::lockStateChanged, this, diff --git a/workspace.cpp b/workspace.cpp index bac6e30acd..acdd391467 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -525,6 +525,7 @@ void Workspace::setupClientConnections(AbstractClient *c) { connect(c, &Toplevel::needsRepaint, m_compositor, &Compositor::scheduleRepaint); connect(c, &AbstractClient::desktopPresenceChanged, this, &Workspace::desktopPresenceChanged); + connect(c, &AbstractClient::minimizedChanged, this, std::bind(&Workspace::clientMinimizedChanged, this, c)); } Client* Workspace::createClient(xcb_window_t w, bool is_mapped) diff --git a/workspace.h b/workspace.h index 9b60724b28..60935c6672 100644 --- a/workspace.h +++ b/workspace.h @@ -482,6 +482,7 @@ Q_SIGNALS: void clientRemoved(KWin::AbstractClient*); void clientActivated(KWin::AbstractClient*); void clientDemandsAttentionChanged(KWin::AbstractClient*, bool); + void clientMinimizedChanged(KWin::AbstractClient*); void groupAdded(KWin::Group*); void unmanagedAdded(KWin::Unmanaged*); void unmanagedRemoved(KWin::Unmanaged*);