Added back in default rectangle

This commit is contained in:
Fmstrat
2019-12-31 12:14:48 -05:00
parent 0620b88217
commit 2519bf8ed6

View File

@@ -64,7 +64,7 @@ function unMaximizeIfMaximized(app) {
function initApp(app) {
app.wintile = {
origFrame: app.get_frame_rect(),
origFrame: app.get_frame_rect() || getDefaultFloatingRectangle(),
row: -1,
col: -1,
height: -1,
@@ -72,6 +72,18 @@ function initApp(app) {
};
}
function getDefaultFloatingRectangle() {
_log('Getting default rectangle.')
let padding = 100;
let workspace = app.get_work_area_current_monitor();
return {
x: workspace.x + padding,
y: workspace.y + padding,
width: workspace.width - padding * 2,
height: workspace.height - padding * 2
};
}
function restoreApp(app) {
app.move_resize_frame(true, app.wintile.origFrame.x, app.wintile.origFrame.y, app.wintile.origFrame.width, app.wintile.origFrame.height);
app.wintile = null;