Skip to content

Commit

Permalink
prevent double trigger of screen edge listener
Browse files Browse the repository at this point in the history
  • Loading branch information
fin444 committed Dec 21, 2024
1 parent c766151 commit 61958b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contents/code/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,17 @@ workspace.windowRemoved.connect((window) => {
}
});

var lastScreenEdge = 0;
function screenEdgeActivated() {
if (Date.now() - lastScreenEdge < 200) {
// a bug in kwin sometimes causes a double trigger, so we enforce a 200ms cooldown
return;
}
for (window of workspace.windowList()) {
if (window.active) {
if (isManaged(window) && shouldHideTitle(window)) {
window.noBorder = !window.noBorder;
lastScreenEdge = Date.now();
}
return;
}
Expand Down

0 comments on commit 61958b9

Please sign in to comment.