summaryrefslogtreecommitdiff
path: root/extra/kdebase-workspace/fix-freeze.patch
blob: 1926baebc462966412305ede0843114dbfe055ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
diff --git a/kwin/tabbox/clientmodel.cpp b/kwin/tabbox/clientmodel.cpp
index 9591bab..a67d979 100644
--- a/kwin/tabbox/clientmodel.cpp
+++ b/kwin/tabbox/clientmodel.cpp
@@ -188,7 +188,7 @@ void ClientModel::createClientList(int desktop, bool partialReset)
     switch(tabBox->config().clientSwitchingMode()) {
     case TabBoxConfig::FocusChainSwitching: {
         TabBoxClient* c = start;
-        if (!c) {
+        if (!tabBox->isInFocusChain(c)) {
             QSharedPointer<TabBoxClient> firstClient = tabBox->firstClientFocusChain().toStrongRef();
             if (firstClient) {
                 c = firstClient.data();
diff --git a/kwin/tabbox/tabbox.cpp b/kwin/tabbox/tabbox.cpp
index d96d0bd..7a08d37 100644
--- a/kwin/tabbox/tabbox.cpp
+++ b/kwin/tabbox/tabbox.cpp
@@ -112,6 +112,14 @@ QWeakPointer< TabBoxClient > TabBoxHandlerImpl::firstClientFocusChain() const
     }
 }
 
+bool TabBoxHandlerImpl::isInFocusChain(TabBoxClient *client) const
+{
+    if (TabBoxClientImpl *c = static_cast<TabBoxClientImpl*>(client)) {
+        return Workspace::self()->globalFocusChain().contains(c->client());
+    }
+    return false;
+}
+
 int TabBoxHandlerImpl::nextDesktopFocusChain(int desktop) const
 {
     return m_tabBox->nextDesktopFocusChain(desktop);
diff --git a/kwin/tabbox/tabbox.h b/kwin/tabbox/tabbox.h
index 6652f93..bba0b39 100644
--- a/kwin/tabbox/tabbox.h
+++ b/kwin/tabbox/tabbox.h
@@ -52,6 +52,7 @@ public:
     virtual QString desktopName(int desktop) const;
     virtual QWeakPointer< TabBoxClient > nextClientFocusChain(TabBoxClient* client) const;
     virtual QWeakPointer< TabBoxClient > firstClientFocusChain() const;
+    virtual bool isInFocusChain (TabBoxClient* client) const;
     virtual int nextDesktopFocusChain(int desktop) const;
     virtual int numberOfDesktops() const;
     virtual TabBoxClientList stackingOrder() const;
diff --git a/kwin/tabbox/tabboxhandler.h b/kwin/tabbox/tabboxhandler.h
index 7abddfc..d9a6122 100644
--- a/kwin/tabbox/tabboxhandler.h
+++ b/kwin/tabbox/tabboxhandler.h
@@ -119,6 +119,7 @@ public:
      * @since 4.9.1
      **/
     virtual QWeakPointer<TabBoxClient> firstClientFocusChain() const = 0;
+    virtual bool isInFocusChain(TabBoxClient* client) const = 0;
     /**
     * @param client The client whose desktop name should be retrieved
     * @return The desktop name of the given TabBoxClient. If the client is