Skip to content

Commit 3dc64af

Browse files
authored
1.5, merge from dev
Merge pull request #31 from emvaized/dev
2 parents 369b479 + c946113 commit 3dc64af

File tree

7 files changed

+673
-507
lines changed

7 files changed

+673
-507
lines changed

CHANGELOG

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
1.5
2+
- Fixed unwanted assist show on Wayland
3+
- Windows now will get unshaded after selecting from assist
4+
- Assit will now try to filter out windows from other activities
5+
- Increased default opacity for assist background
6+
- Updated configs page design and layout
7+
- Remove window from snap group when move it to another desktop
8+
19
1.4
210
New options:
311
- Raise snapped windows together

assets/logo.png

-215 Bytes
Loading

contents/ui/code/assist.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ function checkToShowNextQuaterAssist(lastSelectedClient){
8888
} else {
8989
/// no other quaters to show assist — we can reset the variables
9090
finishSnap(true);
91+
preventAssistFromShowing();
9192
return false;
9293
}
9394
}

contents/ui/code/windows.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
function selectClient(client){
22
client.setMaximize(false, false);
3+
client.shade = false;
34
client.frameGeometry = Qt.rect(
45
mainWindow.x - (assistPadding / 2),
56
mainWindow.y - (assistPadding / 2),
@@ -38,10 +39,14 @@ function addListenersToClient(client) {
3839
client.windowClosed.connect(function(window){
3940
handleWindowClose(client);
4041
});
42+
43+
client.desktopChanged.connect(function(){
44+
if (trackSnappedWindows && !client.resize) removeWindowFromTrack(client.windowId);
45+
});
4146
}
4247

4348
function onWindowResize(window) {
44-
if (activated) AssistManager.hideAssist();
49+
if (activated) return;
4550
AssistManager.finishSnap(false); /// make sure we cleared all variables
4651

4752
const maxArea = workspace.clientArea(KWin.MaximizeArea, window);
@@ -159,7 +164,7 @@ function handleWindowFocus(window) {
159164

160165
for(let i = 0, l = windows.length; i < l; i++) {
161166
if (windows[i] !== window.windowId) {
162-
const w = workspace.getClient(windows[i]);
167+
const w = getClientFromId(windows[i]);
163168
if (w && !w.minimized) workspace.activeClient = w;
164169
}
165170
}
@@ -192,7 +197,7 @@ function applyActionToAssosiatedSnapGroup(client, callback){
192197
const i = snappedWindowGroups.findIndex((group) => group.windows.includes(client.windowId));
193198
if (i > -1) {
194199
const windows = snappedWindowGroups[i].windows;
195-
windows.forEach(windowId => callback(workspace.getClient(windowId)));
200+
windows.forEach(windowId => callback(getClientFromId(windowId)));
196201
}
197202
}
198203

@@ -218,7 +223,7 @@ function fillClosedWindow(closedWindow, group){
218223
const closedWindowGeom = closedWindow.frameGeometry;
219224
const remainingWindows = group.windows;
220225
for(let i = 0, l = remainingWindows.length; i < l; i++){
221-
const window = workspace.getClient(remainingWindows[i]);
226+
const window = getClientFromId(remainingWindows[i]);
222227
if (!window) continue;
223228
if (window.windowId == closedWindow.windowId) continue;
224229
const windowGeom = window.frameGeometry;
@@ -244,13 +249,21 @@ function isEqual(a, b) {
244249
return a - b <= snapDetectPrecision && a - b >= -snapDetectPrecision;
245250
}
246251

252+
function getClientFromId(windowId){
253+
return workspace.getClient(windowId);
254+
255+
/// Need to figure out reliable way for Wayland
256+
/// return Object.values(workspace.clients).find((el, index, arr) => el.windowId == windowId);
257+
}
258+
247259
function shouldShowWindow(client) {
248260
if (filteredClients.includes(client)) return false;
249261
if (client.active || client.specialWindow) return false;
250262
if (!showMinimizedWindows && client.minimized) return false;
251263
if (!showOtherScreensWindows && client.screen !== workspace.activeScreen) return false;
252264
if (!showOtherDesktopsWindows && client.desktop !== workspace.currentDesktop) return false;
253265
if (!showSnappedWindows && snappedWindowGroups.findIndex(group => group.windows.includes(client.windowId)) > -1) return false;
266+
if (client.activities.length > 0 && !client.activities.includes(workspace.currentActivity)) return false;
254267
return true;
255268
}
256269

0 commit comments

Comments
 (0)