mirror of
https://github.com/FranP-code/wintile.git
synced 2025-10-13 00:33:46 +00:00
Added back in default rectangle
This commit is contained in:
14
extension.js
14
extension.js
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user