1 |
commit: 05d8b1ff72e2697b27b3cb2284d0e722202a6bf6 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 22 16:14:44 2021 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 23 14:59:13 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05d8b1ff |
7 |
|
8 |
kde-plasma/kwin: Fix wrong window size in some cases |
9 |
|
10 |
Upstream commits: |
11 |
325208347c40d7311aea83572b5150ba3750cba9 |
12 |
1ba7b5ec63b61fa00b7eac59a1beca12323fefb3 |
13 |
|
14 |
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=445444 |
15 |
Package-Manager: Portage-3.0.28, Repoman-3.0.3 |
16 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
17 |
|
18 |
...-enable-window-rules-for-all-xdg-toplevel.patch | 132 +++++++++++++++++++++ |
19 |
.../kwin/files/kwin-5.23.3-revert-2560288e.patch | 35 ++++++ |
20 |
kde-plasma/kwin/kwin-5.23.3-r1.ebuild | 2 + |
21 |
3 files changed, 169 insertions(+) |
22 |
|
23 |
diff --git a/kde-plasma/kwin/files/kwin-5.23.3-enable-window-rules-for-all-xdg-toplevel.patch b/kde-plasma/kwin/files/kwin-5.23.3-enable-window-rules-for-all-xdg-toplevel.patch |
24 |
new file mode 100644 |
25 |
index 000000000000..fa52bd7a3481 |
26 |
--- /dev/null |
27 |
+++ b/kde-plasma/kwin/files/kwin-5.23.3-enable-window-rules-for-all-xdg-toplevel.patch |
28 |
@@ -0,0 +1,132 @@ |
29 |
+From 1ba7b5ec63b61fa00b7eac59a1beca12323fefb3 Mon Sep 17 00:00:00 2001 |
30 |
+From: Vlad Zahorodnii <vlad.zahorodnii@×××.org> |
31 |
+Date: Wed, 17 Nov 2021 18:36:00 +0200 |
32 |
+Subject: [PATCH] wayland: Enable window rules for all xdg-toplevel |
33 |
+ |
34 |
+If a window wants to be initially shown in fullscreen mode, it will |
35 |
+issue an xdg_toplevel.set_fullscreen request before the first surface |
36 |
+commit. |
37 |
+ |
38 |
+If a window wants to be shown in fullscreen mode and there hasn't been |
39 |
+any first surface commit, kwin will cache the request and apply |
40 |
+fullscreen mode when checking window rules in the initialize() function. |
41 |
+ |
42 |
+On the other hand, window rules are disabled for plasma surfaces. The |
43 |
+motivation behind that was to forbid user from messing with plasma's |
44 |
+surfaces (this change was suggested during redesign of xdg-shell |
45 |
+implementation). |
46 |
+ |
47 |
+As it turns out, there are cases where plasma may ask to show a window |
48 |
+in fullscreen mode, which also has a plasma surface installed, e.g. |
49 |
+fullscreen application dashboard. |
50 |
+ |
51 |
+In order to fix the dashboard, this change allows window rules to be |
52 |
+applied to xdg-toplevel windows that also have plasma surfaces installed. |
53 |
+ |
54 |
+As is, xdg-toplevel surfaces and plasma surfaces are very different in |
55 |
+nature. Adding more quirks to handle plasma surfaces in |
56 |
+XdgToplevelClient is not worth the effort and there are better |
57 |
+alternatives, e.g. layer-shell. |
58 |
+ |
59 |
+ |
60 |
+(cherry picked from commit 039b1d031e3e30c238c8d67ade376c6d52297d81) |
61 |
+--- |
62 |
+ src/xdgshellclient.cpp | 65 +++++++++++++++++++++--------------------- |
63 |
+ 1 file changed, 32 insertions(+), 33 deletions(-) |
64 |
+ |
65 |
+diff --git a/src/xdgshellclient.cpp b/src/xdgshellclient.cpp |
66 |
+index 9e8216a3a0..b4427b8cf7 100644 |
67 |
+--- a/src/xdgshellclient.cpp |
68 |
++++ b/src/xdgshellclient.cpp |
69 |
+@@ -647,7 +647,7 @@ void XdgToplevelClient::updateDecoration(bool check_workspace_pos, bool force) |
70 |
+ |
71 |
+ bool XdgToplevelClient::supportsWindowRules() const |
72 |
+ { |
73 |
+- return !m_plasmaShellSurface; |
74 |
++ return true; |
75 |
+ } |
76 |
+ |
77 |
+ StrutRect XdgToplevelClient::strutRect(StrutArea area) const |
78 |
+@@ -946,7 +946,7 @@ void XdgToplevelClient::handleWindowClassChanged() |
79 |
+ { |
80 |
+ const QByteArray applicationId = m_shellSurface->windowClass().toUtf8(); |
81 |
+ setResourceClass(resourceName(), applicationId); |
82 |
+- if (shellSurface()->isConfigured() && supportsWindowRules()) { |
83 |
++ if (shellSurface()->isConfigured()) { |
84 |
+ evaluateWindowRules(); |
85 |
+ } |
86 |
+ setDesktopFileName(applicationId); |
87 |
+@@ -1196,40 +1196,39 @@ void XdgToplevelClient::initialize() |
88 |
+ // is sent if the client has called the set_mode() request with csd mode. |
89 |
+ updateDecoration(false, true); |
90 |
+ |
91 |
+- if (supportsWindowRules()) { |
92 |
+- setupWindowRules(false); |
93 |
+- |
94 |
+- moveResize(rules()->checkGeometry(frameGeometry(), true)); |
95 |
+- maximize(rules()->checkMaximize(initialMaximizeMode(), true)); |
96 |
+- setFullScreen(rules()->checkFullScreen(initialFullScreenMode(), true), false); |
97 |
+- setOnActivities(rules()->checkActivity(activities(), true)); |
98 |
+- setDesktops(rules()->checkDesktops(desktops(), true)); |
99 |
+- setDesktopFileName(rules()->checkDesktopFile(desktopFileName(), true).toUtf8()); |
100 |
+- if (rules()->checkMinimize(isMinimized(), true)) { |
101 |
+- minimize(true); // No animation. |
102 |
+- } |
103 |
+- setSkipTaskbar(rules()->checkSkipTaskbar(skipTaskbar(), true)); |
104 |
+- setSkipPager(rules()->checkSkipPager(skipPager(), true)); |
105 |
+- setSkipSwitcher(rules()->checkSkipSwitcher(skipSwitcher(), true)); |
106 |
+- setKeepAbove(rules()->checkKeepAbove(keepAbove(), true)); |
107 |
+- setKeepBelow(rules()->checkKeepBelow(keepBelow(), true)); |
108 |
+- setShortcut(rules()->checkShortcut(shortcut().toString(), true)); |
109 |
+- setNoBorder(rules()->checkNoBorder(noBorder(), true)); |
110 |
++ setupWindowRules(false); |
111 |
++ |
112 |
++ moveResize(rules()->checkGeometry(frameGeometry(), true)); |
113 |
++ maximize(rules()->checkMaximize(initialMaximizeMode(), true)); |
114 |
++ setFullScreen(rules()->checkFullScreen(initialFullScreenMode(), true), false); |
115 |
++ setOnActivities(rules()->checkActivity(activities(), true)); |
116 |
++ setDesktops(rules()->checkDesktops(desktops(), true)); |
117 |
++ setDesktopFileName(rules()->checkDesktopFile(desktopFileName(), true).toUtf8()); |
118 |
++ if (rules()->checkMinimize(isMinimized(), true)) { |
119 |
++ minimize(true); // No animation. |
120 |
++ } |
121 |
++ setSkipTaskbar(rules()->checkSkipTaskbar(skipTaskbar(), true)); |
122 |
++ setSkipPager(rules()->checkSkipPager(skipPager(), true)); |
123 |
++ setSkipSwitcher(rules()->checkSkipSwitcher(skipSwitcher(), true)); |
124 |
++ setKeepAbove(rules()->checkKeepAbove(keepAbove(), true)); |
125 |
++ setKeepBelow(rules()->checkKeepBelow(keepBelow(), true)); |
126 |
++ setShortcut(rules()->checkShortcut(shortcut().toString(), true)); |
127 |
++ setNoBorder(rules()->checkNoBorder(noBorder(), true)); |
128 |
++ |
129 |
++ // Don't place the client if its position is set by a rule. |
130 |
++ if (rules()->checkPosition(invalidPoint, true) != invalidPoint) { |
131 |
++ needsPlacement = false; |
132 |
++ } |
133 |
+ |
134 |
+- // Don't place the client if its position is set by a rule. |
135 |
+- if (rules()->checkPosition(invalidPoint, true) != invalidPoint) { |
136 |
+- needsPlacement = false; |
137 |
+- } |
138 |
++ // Don't place the client if the maximize state is set by a rule. |
139 |
++ if (requestedMaximizeMode() != MaximizeRestore) { |
140 |
++ needsPlacement = false; |
141 |
++ } |
142 |
+ |
143 |
+- // Don't place the client if the maximize state is set by a rule. |
144 |
+- if (requestedMaximizeMode() != MaximizeRestore) { |
145 |
+- needsPlacement = false; |
146 |
+- } |
147 |
++ discardTemporaryRules(); |
148 |
++ RuleBook::self()->discardUsed(this, false); // Remove Apply Now rules. |
149 |
++ updateWindowRules(Rules::All); |
150 |
+ |
151 |
+- discardTemporaryRules(); |
152 |
+- RuleBook::self()->discardUsed(this, false); // Remove Apply Now rules. |
153 |
+- updateWindowRules(Rules::All); |
154 |
+- } |
155 |
+ if (isRequestedFullScreen()) { |
156 |
+ needsPlacement = false; |
157 |
+ } |
158 |
+-- |
159 |
+GitLab |
160 |
+ |
161 |
|
162 |
diff --git a/kde-plasma/kwin/files/kwin-5.23.3-revert-2560288e.patch b/kde-plasma/kwin/files/kwin-5.23.3-revert-2560288e.patch |
163 |
new file mode 100644 |
164 |
index 000000000000..db91c918ec3d |
165 |
--- /dev/null |
166 |
+++ b/kde-plasma/kwin/files/kwin-5.23.3-revert-2560288e.patch |
167 |
@@ -0,0 +1,35 @@ |
168 |
+From 325208347c40d7311aea83572b5150ba3750cba9 Mon Sep 17 00:00:00 2001 |
169 |
+From: Vlad Zahorodnii <vlad.zahorodnii@×××.org> |
170 |
+Date: Tue, 16 Nov 2021 22:37:26 +0200 |
171 |
+Subject: [PATCH] Revert "wayland: Check workspace position when preferred deco |
172 |
+ mode changes" |
173 |
+ |
174 |
+This reverts commit 2560288e4b66acfdbb8a8f4daafd2d600aeb525a. |
175 |
+ |
176 |
+It broke alacricitty. The fix is not obvious, so revert the commit for |
177 |
+the time being. |
178 |
+ |
179 |
+BUG: 445444 |
180 |
+ |
181 |
+ |
182 |
+(cherry picked from commit 068d60e36a112c6b901010331ef3a995019c97cb) |
183 |
+--- |
184 |
+ src/xdgshellclient.cpp | 2 +- |
185 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
186 |
+ |
187 |
+diff --git a/src/xdgshellclient.cpp b/src/xdgshellclient.cpp |
188 |
+index af1bd57ac7..9e8216a3a0 100644 |
189 |
+--- a/src/xdgshellclient.cpp |
190 |
++++ b/src/xdgshellclient.cpp |
191 |
+@@ -1317,7 +1317,7 @@ void XdgToplevelClient::installXdgDecoration(XdgToplevelDecorationV1Interface *d |
192 |
+ connect(m_xdgDecoration, &XdgToplevelDecorationV1Interface::preferredModeChanged, this, [this] { |
193 |
+ if (m_isInitialized) { |
194 |
+ // force is true as we must send a new configure response. |
195 |
+- updateDecoration(/* check_workspace_pos */ true, /* force */ true); |
196 |
++ updateDecoration(/* check_workspace_pos */ false, /* force */ true); |
197 |
+ } |
198 |
+ }); |
199 |
+ } |
200 |
+-- |
201 |
+GitLab |
202 |
+ |
203 |
|
204 |
diff --git a/kde-plasma/kwin/kwin-5.23.3-r1.ebuild b/kde-plasma/kwin/kwin-5.23.3-r1.ebuild |
205 |
index cf0d965820df..24a401f083d2 100644 |
206 |
--- a/kde-plasma/kwin/kwin-5.23.3-r1.ebuild |
207 |
+++ b/kde-plasma/kwin/kwin-5.23.3-r1.ebuild |
208 |
@@ -102,6 +102,8 @@ PDEPEND=">=kde-plasma/kde-cli-tools-${PVCUT}:5" |
209 |
|
210 |
PATCHES=( |
211 |
"${FILESDIR}/${P}-fix-xwayland-abstract-socket-addr.patch" # KDE-bug 442362, bug 813888 |
212 |
+ "${FILESDIR}/${P}-revert-2560288e.patch" # KDE-bug 445444 |
213 |
+ "${FILESDIR}/${P}-enable-window-rules-for-all-xdg-toplevel.patch" |
214 |
) |
215 |
|
216 |
src_prepare() { |