Skip to content

Commit

Permalink
fix tile height across windows
Browse files Browse the repository at this point in the history
Tiles that are full height on one monitor will now be full height as they
move to other monitors.
  • Loading branch information
GrylledCheez committed Sep 12, 2023
1 parent b43a5b6 commit 695be9a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,10 @@ function sendMove(direction, ctrlPressed = false) {
_log('sendMove) left - yes monitor');
let newMonitor = getMonitorInfo(monitorToLeft);
app.move_to_monitor(monitorToLeft);
moveApp(app, {'row': app.wintile.row, 'col': newMonitor.colCount - 1, 'height': app.wintile.height, 'width': 1});
if (app.wintile.height === rowCount)
moveApp(app, {'row': app.wintile.row, 'col': newMonitor.colCount - 1, 'height': newMonitor.rowCount, 'width': 1});
else
moveApp(app, {'row': app.wintile.row, 'col': newMonitor.colCount - 1, 'height': app.wintile.height, 'width': 1});
} else {
// We are already on the left, and there is no other monitor to the left
// Move to the left most column at full height
Expand All @@ -486,8 +489,12 @@ function sendMove(direction, ctrlPressed = false) {
} else if (monitorToRight !== -1) {
// There is a monitor to the right, so let's go there
_log('sendMove) right - yes monitor');
let newMonitor = getMonitorInfo(monitorToRight);
app.move_to_monitor(monitorToRight);
moveApp(app, {'row': app.wintile.row, 'col': 0, 'height': app.wintile.height, 'width': 1});
if (app.wintile.height === rowCount)
moveApp(app, {'row': app.wintile.row, 'col': 0, 'height': newMonitor.rowCount, 'width': 1});
else
moveApp(app, {'row': app.wintile.row, 'col': 0, 'height': app.wintile.height, 'width': 1});
} else {
// We are already on the right, and there is no other monitor to the right
// Move to the right most column at full height
Expand Down

0 comments on commit 695be9a

Please sign in to comment.