Skip to content

Commit

Permalink
WM fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgrammerIn-wonderland committed Nov 14, 2024
1 parent 81c8d67 commit 11ad960
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/AliceWM.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,8 @@ class WMWindow extends EventTarget implements Process {
);

if (!thisSnappedWindow) {
this.snapped = false;
this.unminimize();
return;
}

Expand Down Expand Up @@ -873,7 +875,8 @@ class WMWindow extends EventTarget implements Process {
}

if (
snappedWindows.length === 2 &&
snappedWindows.find((x) => x.direction === "left") &&
snappedWindows.find((x) => x.direction === "right") &&
!splitBar &&
snapDirection !== "top" &&
snappedWindows[0]?.direction !== snappedWindows[1]?.direction
Expand Down Expand Up @@ -914,28 +917,28 @@ class WMWindow extends EventTarget implements Process {
return;
case "ne":
this.element.style.width = width / 2 + "px";
this.element.style.height = height / 2 - 4 + "px";
this.element.style.height = (height - 49) / 2 + "px";
this.element.style.top = "0px";
this.element.style.left =
width - this.element.clientWidth + "px";
break;
case "nw":
this.element.style.width = width / 2 + "px";
this.element.style.height = height / 2 - 49 + "px";
this.element.style.height = (height - 49) / 2 + "px";
this.element.style.top = "0px";
this.element.style.left = "0px";
break;
case "se":
this.element.style.width = width / 2 + "px";
this.element.style.height = height / 2 - 49 + "px";
this.element.style.height = (height - 49) / 2 + "px";
this.element.style.top =
height - 49 - this.element.clientHeight + "px";
this.element.style.left =
width - this.element.clientWidth + "px";
break;
case "sw":
this.element.style.width = width / 2 + "px";
this.element.style.height = height / 2 - 49 + "px";
this.element.style.height = (height - 49) / 2 + "px";
this.element.style.top =
height - 49 - this.element.clientHeight + "px";
this.element.style.left = "0px";
Expand Down Expand Up @@ -1037,11 +1040,9 @@ class WMWindow extends EventTarget implements Process {

if (["ne", "nw", "se", "sw"].includes(side)) {
scaledWidth = width / 2;
scaledHeight = height / 2;
scaledHeight = (height - 49) / 2;
}

scaledHeight -= 49;

let previewSide = side;

if (["ne", "se"].includes(side)) {
Expand Down

0 comments on commit 11ad960

Please sign in to comment.