Skip to content

Commit 9cf0bad

Browse files
committed
fix ignoring desktop shell windows not working correctly
1 parent 11babbf commit 9cf0bad

File tree

5 files changed

+31
-18
lines changed

5 files changed

+31
-18
lines changed

CHANGELOG.bbcode

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[h2]v6.1[/h2]
2+
[list]\n[*] fix ignoring desktop shell windows not working correctly
3+
[/list]
4+
15
[h1]v6.0[/h1]
26
[list]\n[*] add option to automatically reactivate most recently active window
37
[*] fix disabling auto-restoration not working

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v6.1
2+
- fix ignoring desktop shell windows not working correctly
3+
14
# v6.0
25

36
- add option to automatically reactivate most recently active window

contents/code/main.js

+23-17
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ var removed = false;
114114

115115
// trigger minimize and restore
116116
// when client is initially present, added or activated
117-
workspace.clientList().forEach(client => onActivated(client));
117+
workspace.clientList().forEach(onActivated);
118118
workspace.clientAdded.connect(onActivated);
119119
workspace.clientActivated.connect(onActivated);
120120
function onActivated(client) {
@@ -130,7 +130,7 @@ function onActivated(client) {
130130

131131
// add to watchlist on added and trigger minimize and restore
132132
// when client is moved or resized or screen geometry changes
133-
workspace.clientList().forEach(client => onAdded(client));
133+
workspace.clientList().forEach(onAdded);
134134
workspace.clientAdded.connect(onAdded);
135135
function onAdded(client) {
136136
debug("====================")
@@ -145,13 +145,20 @@ var block = false;
145145
function onAddedOnRegeometrized(client) {
146146
[client.clientGeometryChanged,
147147
client.frameGeometryChanged,
148-
client.moveResizedChanged,
148+
client.moveResizedChanged,
149149
client.fullScreenChanged,
150150
client.clientMaximizedStateChanged,
151151
client.screenChanged,
152152
client.desktopChanged,
153153
client.activitiesChanged].
154154
forEach(signal => signal.connect(onRegeometrized));
155+
client.clientStartUserMovedResized.connect(client => {
156+
// block = true;
157+
});
158+
client.clientFinishUserMovedResized.connect(client => {
159+
block = false;
160+
onRegeometrized(client);
161+
});
155162
}
156163
function onRegeometrized(client) {
157164
if (!client) return;
@@ -218,6 +225,7 @@ function onRemoved(client) {
218225
// minimize all windows overlapped by active window
219226
function minimizeOverlapping(active) {
220227
if (!active) active = workspace.activeClient;
228+
debug(active.caption, active.resourceName, active.resourceName == "krunner", ["plasmashell", "krunner"].includes(String(active.resourceName)), config.ignoreShell && ["plasmashell", "krunner"].includes(String(active.resourceName)));
221229
if (!active || ignoreClient(active) || ignoreFront(active)) return;
222230
debug("- apply minimize for", caption(active));
223231
fulldebug(properties(active));
@@ -354,33 +362,31 @@ function overlapVertical(win1, win2) {
354362
///////////////////////
355363

356364
function ignoreClient(win) {
357-
return !(win.desktop == workspace.currentDesktop // different desktop
358-
|| win.onAllDesktops)
359-
|| (config.ignoreNonnormal // non-normal window
360-
&& !win.normalWindow)
365+
return !(win.desktop == workspace.currentDesktop || win.onAllDesktops)
366+
// different desktop
367+
|| (config.ignoreNonnormal && !win.normalWindow) // non-normal window
361368
|| (config.ignoreShell // desktop shell window
362-
&& ["plasmashell", "krunner"].includes(win.resourceName))
369+
&& ["plasmashell", "krunner"].includes(String(win.resourceName)))
363370
|| win.desktopWindow || win.dock // special window
364371
|| win.dnd || win.tooltip || win.onScreenDisplay
365372
|| win.notification || win.criticalNotification
366-
// || win.move || win.resize // still undergoing geometry change
367373
}
368374

369375
function ignoreFront(front) {
370-
return (config.excludeMode // application excluded
371-
&& config.excludedAppsForeground.includes(front.resourceClass))
372-
|| (config.includeMode // application not included
373-
&& !config.includedAppsForeground.includes(front.resourceClass))
376+
return (config.excludeMode && config.excludedAppsForeground
377+
.includes(String(front.resourceClass))) // application excluded
378+
|| (config.includeMode && !config.includedAppsForeground
379+
.includes(String(front.resourceClass))) // application not included
374380
|| [workspace.clientArea(KWin.FullScreenArea, front),
375381
workspace.clientArea(KWin.ScreenArea, front)]
376382
.includes(front.geometry) // fullscreen
377383
}
378384

379385
function ignoreBack(back) {
380-
return (config.excludeMode // application excluded
381-
&& config.excludedAppsBackground.includes(back.resourceClass))
382-
|| (config.includeMode // application not included
383-
&& !config.includedAppsBackground.includes(back.resourceClass))
386+
return (config.excludeMode && config.excludedAppsBackground
387+
.includes(String(back.resourceClass))) // application excluded
388+
|| (config.includeMode && !config.includedAppsBackground
389+
.includes(String(back.resourceClass))) // application not included
384390
|| !back.minimizable // not minimizable
385391
}
386392

Binary file not shown.

metadata.desktop

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Comment[nl]=Voorkomt vensteroverlapping door ze te minimaliseren en herstellen o
1212
Icon=preferences-system-windows
1313

1414
X-KDE-PluginInfo-Name=floatingtiles
15-
X-KDE-PluginInfo-Version=6.0
15+
X-KDE-PluginInfo-Version=6.1
1616
X-KDE-PluginInfo-Author=Natalie Clarius
1717
X-KDE-PluginInfo-Email[email protected]
1818
X-KDE-PluginInfo-License=GPLv3.0

0 commit comments

Comments
 (0)