From 7bdf96c2f3159ba14c2bc405da55bcfd4adad488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Mon, 16 Apr 2012 18:16:38 +0200 Subject: [PATCH] export clientpopup mapping state and use it to skip mouse driven focus changes BUG: 81743 FIXED-IN: 4.9 REVIEW: 104620 --- events.cpp | 2 +- workspace.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/events.cpp b/events.cpp index 45d58ef06f..7f26705540 100644 --- a/events.cpp +++ b/events.cpp @@ -879,7 +879,7 @@ void Client::enterNotifyEvent(XCrossingEvent* e) } #undef MOUSE_DRIVEN_FOCUS - if (options->focusPolicy() == Options::ClickToFocus) + if (options->focusPolicy() == Options::ClickToFocus || workspace()->windowMenuShown()) return; if (options->isAutoRaise() && !isDesktop() && diff --git a/workspace.h b/workspace.h index 9df435cebb..e271f8fafa 100644 --- a/workspace.h +++ b/workspace.h @@ -415,6 +415,7 @@ public: */ void showWindowMenu(int x, int y, Client* cl); void showWindowMenu(QPoint pos, Client* cl); + bool windowMenuShown(); void updateMinimizedOfTransients(Client*); void updateOnAllDesktopsOfTransients(Client*); @@ -1039,6 +1040,11 @@ inline void Workspace::showWindowMenu(int x, int y, Client* cl) showWindowMenu(QRect(QPoint(x, y), QPoint(x, y)), cl); } +inline bool Workspace::windowMenuShown() +{ + return popup && ((QWidget*)popup)->isVisible(); +} + inline void Workspace::setWasUserInteraction() { was_user_interaction = true;