[gnome] Update extensions
This commit is contained in:
@ -19,11 +19,23 @@
|
||||
{ "wmClass": "zoom", "mode": "float" },
|
||||
{ "wmClass": "firefox", "wmTitle": "About Mozilla Firefox", "mode": "float" },
|
||||
{ "wmClass": "firefox", "wmTitle": "!Mozilla Firefox", "mode": "float" },
|
||||
{ "wmClass": "org.mozilla.firefox.desktop", "wmTitle": "About Mozilla Firefox", "mode": "float" },
|
||||
{
|
||||
"wmClass": "org.mozilla.firefox.desktop",
|
||||
"wmTitle": "About Mozilla Firefox",
|
||||
"mode": "float"
|
||||
},
|
||||
{ "wmClass": "org.mozilla.firefox.desktop", "wmTitle": "!Mozilla Firefox", "mode": "float" },
|
||||
{ "wmClass": "thunderbird", "wmTitle": "About Mozilla Thunderbird", "mode": "float" },
|
||||
{ "wmClass": "thunderbird", "wmTitle": "!Mozilla Thunderbird", "mode": "float" },
|
||||
{ "wmClass": "org.mozilla.Thunderbird.desktop", "wmTitle": "About Mozilla Thunderbird", "mode": "float" },
|
||||
{ "wmClass": "org.mozilla.Thunderbird.desktop", "wmTitle": "!Mozilla Thunderbird", "mode": "float" }
|
||||
{
|
||||
"wmClass": "org.mozilla.Thunderbird.desktop",
|
||||
"wmTitle": "About Mozilla Thunderbird",
|
||||
"mode": "float"
|
||||
},
|
||||
{
|
||||
"wmClass": "org.mozilla.Thunderbird.desktop",
|
||||
"wmTitle": "!Mozilla Thunderbird",
|
||||
"mode": "float"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
// Gnome imports
|
||||
import Clutter from "gi://Clutter";
|
||||
import GObject from "gi://GObject";
|
||||
import Meta from "gi://Meta";
|
||||
import Shell from "gi://Shell";
|
||||
@ -490,11 +491,22 @@ export class Node extends GObject.Object {
|
||||
metaWin.activate(global.display.get_current_time());
|
||||
};
|
||||
|
||||
iconBin.connect("clicked", clickFn);
|
||||
titleButton.connect("clicked", clickFn);
|
||||
closeButton.connect("clicked", () => {
|
||||
let closeFn = () => {
|
||||
metaWin.delete(global.get_current_time());
|
||||
});
|
||||
};
|
||||
|
||||
let middleClickCloseFn = (_, event) => {
|
||||
if (event.get_button() === Clutter.BUTTON_MIDDLE) {
|
||||
metaWin.delete(global.get_current_time());
|
||||
}
|
||||
};
|
||||
|
||||
iconBin.connect("clicked", clickFn);
|
||||
iconBin.connect("button-release-event", middleClickCloseFn);
|
||||
titleButton.connect("clicked", clickFn);
|
||||
titleButton.connect("button-release-event", middleClickCloseFn);
|
||||
closeButton.connect("clicked", closeFn);
|
||||
closeButton.connect("button-release-event", middleClickCloseFn);
|
||||
|
||||
if (metaWin === global.display.get_focus_window()) {
|
||||
tabContents.add_style_class_name("window-tabbed-tab-active");
|
||||
@ -1215,6 +1227,18 @@ export class Tree extends Node {
|
||||
if (!this.extWm.floatingWindow(node)) cleanUpParent(existParent);
|
||||
}
|
||||
|
||||
// If only a single tab remains, exit tabbed layout
|
||||
if (
|
||||
this.settings.get_boolean("auto-exit-tabbed") &&
|
||||
parentNode.nodeType === NODE_TYPES.CON &&
|
||||
parentNode.layout === LAYOUT_TYPES.TABBED &&
|
||||
parentNode.childNodes.length === 1
|
||||
) {
|
||||
parentNode.layout = this.extWm.determineSplitLayout();
|
||||
this.resetSiblingPercent(parentNode);
|
||||
parentNode.lastTabFocus = null;
|
||||
}
|
||||
|
||||
if (node === this.attachNode) {
|
||||
this.attachNode = null;
|
||||
} else {
|
||||
@ -1511,7 +1535,6 @@ export class Tree extends Node {
|
||||
|
||||
if (gap === 0) {
|
||||
adjustY = renderRect.y;
|
||||
nodeY = renderRect.y + params.stackedHeight + adjust / 4;
|
||||
}
|
||||
|
||||
let decoration = node.decoration;
|
||||
|
||||
@ -261,11 +261,16 @@ export function positionFromGrabOp(grabOp) {
|
||||
}
|
||||
|
||||
export function allowResizeGrabOp(grabOp) {
|
||||
grabOp &= ~1024; // ignore META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED
|
||||
return (
|
||||
grabOp === Meta.GrabOp.RESIZING_N ||
|
||||
grabOp === Meta.GrabOp.RESIZING_E ||
|
||||
grabOp === Meta.GrabOp.RESIZING_W ||
|
||||
grabOp === Meta.GrabOp.RESIZING_S ||
|
||||
grabOp === Meta.GrabOp.RESIZING_NE ||
|
||||
grabOp === Meta.GrabOp.RESIZING_NW ||
|
||||
grabOp === Meta.GrabOp.RESIZING_SE ||
|
||||
grabOp === Meta.GrabOp.RESIZING_SW ||
|
||||
grabOp === Meta.GrabOp.KEYBOARD_RESIZING_N ||
|
||||
grabOp === Meta.GrabOp.KEYBOARD_RESIZING_E ||
|
||||
grabOp === Meta.GrabOp.KEYBOARD_RESIZING_W ||
|
||||
@ -275,11 +280,16 @@ export function allowResizeGrabOp(grabOp) {
|
||||
}
|
||||
|
||||
export function grabMode(grabOp) {
|
||||
grabOp &= ~1024; // ignore META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED
|
||||
if (
|
||||
grabOp === Meta.GrabOp.RESIZING_N ||
|
||||
grabOp === Meta.GrabOp.RESIZING_E ||
|
||||
grabOp === Meta.GrabOp.RESIZING_W ||
|
||||
grabOp === Meta.GrabOp.RESIZING_S ||
|
||||
grabOp === Meta.GrabOp.RESIZING_NE ||
|
||||
grabOp === Meta.GrabOp.RESIZING_NW ||
|
||||
grabOp === Meta.GrabOp.RESIZING_SE ||
|
||||
grabOp === Meta.GrabOp.RESIZING_SW ||
|
||||
grabOp === Meta.GrabOp.KEYBOARD_RESIZING_N ||
|
||||
grabOp === Meta.GrabOp.KEYBOARD_RESIZING_E ||
|
||||
grabOp === Meta.GrabOp.KEYBOARD_RESIZING_W ||
|
||||
@ -297,6 +307,22 @@ export function grabMode(grabOp) {
|
||||
return GRAB_TYPES.UNKNOWN;
|
||||
}
|
||||
|
||||
export function decomposeGrabOp(grabOp) {
|
||||
grabOp &= ~1024; // ignore META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED
|
||||
switch (grabOp) {
|
||||
case Meta.GrabOp.RESIZING_NE:
|
||||
return [Meta.GrabOp.RESIZING_N, Meta.GrabOp.RESIZING_E];
|
||||
case Meta.GrabOp.RESIZING_NW:
|
||||
return [Meta.GrabOp.RESIZING_N, Meta.GrabOp.RESIZING_W];
|
||||
case Meta.GrabOp.RESIZING_SE:
|
||||
return [Meta.GrabOp.RESIZING_S, Meta.GrabOp.RESIZING_E];
|
||||
case Meta.GrabOp.RESIZING_SW:
|
||||
return [Meta.GrabOp.RESIZING_S, Meta.GrabOp.RESIZING_W];
|
||||
default:
|
||||
return [grabOp];
|
||||
}
|
||||
}
|
||||
|
||||
export function directionFromGrab(grabOp) {
|
||||
if (grabOp === Meta.GrabOp.RESIZING_E || grabOp === Meta.GrabOp.KEYBOARD_RESIZING_E) {
|
||||
return Meta.MotionDirection.RIGHT;
|
||||
|
||||
@ -2348,143 +2348,145 @@ export class WindowManager extends GObject.Object {
|
||||
|
||||
_handleResizing(focusNodeWindow) {
|
||||
if (!focusNodeWindow || focusNodeWindow.isFloat()) return;
|
||||
let grabOp = this.grabOp;
|
||||
let initGrabOp = focusNodeWindow.initGrabOp;
|
||||
let direction = Utils.directionFromGrab(grabOp);
|
||||
let orientation = Utils.orientationFromGrab(grabOp);
|
||||
let parentNodeForFocus = focusNodeWindow.parentNode;
|
||||
let position = Utils.positionFromGrabOp(grabOp);
|
||||
// normalize the rect without gaps
|
||||
let frameRect = this.focusMetaWindow.get_frame_rect();
|
||||
let gaps = this.calculateGaps(focusNodeWindow);
|
||||
let currentRect = Utils.removeGapOnRect(frameRect, gaps);
|
||||
let firstRect;
|
||||
let secondRect;
|
||||
let parentRect;
|
||||
let resizePairForWindow;
|
||||
let grabOps = Utils.decomposeGrabOp(this.grabOp);
|
||||
for (let grabOp of grabOps) {
|
||||
let initGrabOp = focusNodeWindow.initGrabOp;
|
||||
let direction = Utils.directionFromGrab(grabOp);
|
||||
let orientation = Utils.orientationFromGrab(grabOp);
|
||||
let parentNodeForFocus = focusNodeWindow.parentNode;
|
||||
let position = Utils.positionFromGrabOp(grabOp);
|
||||
// normalize the rect without gaps
|
||||
let frameRect = this.focusMetaWindow.get_frame_rect();
|
||||
let gaps = this.calculateGaps(focusNodeWindow);
|
||||
let currentRect = Utils.removeGapOnRect(frameRect, gaps);
|
||||
let firstRect;
|
||||
let secondRect;
|
||||
let parentRect;
|
||||
let resizePairForWindow;
|
||||
|
||||
if (initGrabOp === Meta.GrabOp.RESIZING_UNKNOWN) {
|
||||
// the direction is null so do not process yet below.
|
||||
return;
|
||||
} else {
|
||||
resizePairForWindow = this.tree.nextVisible(focusNodeWindow, direction);
|
||||
}
|
||||
|
||||
let sameParent = resizePairForWindow
|
||||
? resizePairForWindow.parentNode === focusNodeWindow.parentNode
|
||||
: false;
|
||||
|
||||
if (orientation === ORIENTATION_TYPES.HORIZONTAL) {
|
||||
if (sameParent) {
|
||||
// use the window or con pairs
|
||||
if (this.tree.getTiledChildren(parentNodeForFocus.childNodes).length <= 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
firstRect = focusNodeWindow.initRect;
|
||||
if (resizePairForWindow) {
|
||||
if (
|
||||
!this.floatingWindow(resizePairForWindow) &&
|
||||
!this.minimizedWindow(resizePairForWindow)
|
||||
) {
|
||||
secondRect = resizePairForWindow.rect;
|
||||
} else {
|
||||
// TODO try to get the next resize pair?
|
||||
}
|
||||
}
|
||||
|
||||
if (!firstRect || !secondRect) {
|
||||
return;
|
||||
}
|
||||
|
||||
parentRect = parentNodeForFocus.rect;
|
||||
let changePx = currentRect.width - firstRect.width;
|
||||
let firstPercent = (firstRect.width + changePx) / parentRect.width;
|
||||
let secondPercent = (secondRect.width - changePx) / parentRect.width;
|
||||
focusNodeWindow.percent = firstPercent;
|
||||
resizePairForWindow.percent = secondPercent;
|
||||
if (initGrabOp === Meta.GrabOp.RESIZING_UNKNOWN) {
|
||||
// the direction is null so do not process yet below.
|
||||
return;
|
||||
} else {
|
||||
// use the parent pairs (con to another con or window)
|
||||
if (resizePairForWindow && resizePairForWindow.parentNode) {
|
||||
if (this.tree.getTiledChildren(resizePairForWindow.parentNode.childNodes).length <= 1) {
|
||||
resizePairForWindow = this.tree.nextVisible(focusNodeWindow, direction);
|
||||
}
|
||||
|
||||
let sameParent = resizePairForWindow
|
||||
? resizePairForWindow.parentNode === focusNodeWindow.parentNode
|
||||
: false;
|
||||
|
||||
if (orientation === ORIENTATION_TYPES.HORIZONTAL) {
|
||||
if (sameParent) {
|
||||
// use the window or con pairs
|
||||
if (this.tree.getTiledChildren(parentNodeForFocus.childNodes).length <= 1) {
|
||||
return;
|
||||
}
|
||||
let firstWindowRect = focusNodeWindow.initRect;
|
||||
let index = resizePairForWindow.index;
|
||||
if (position === POSITION.BEFORE) {
|
||||
// Find the opposite node
|
||||
index = index + 1;
|
||||
} else {
|
||||
index = index - 1;
|
||||
|
||||
firstRect = focusNodeWindow.initRect;
|
||||
if (resizePairForWindow) {
|
||||
if (
|
||||
!this.floatingWindow(resizePairForWindow) &&
|
||||
!this.minimizedWindow(resizePairForWindow)
|
||||
) {
|
||||
secondRect = resizePairForWindow.rect;
|
||||
} else {
|
||||
// TODO try to get the next resize pair?
|
||||
}
|
||||
}
|
||||
parentNodeForFocus = resizePairForWindow.parentNode.childNodes[index];
|
||||
firstRect = parentNodeForFocus.rect;
|
||||
secondRect = resizePairForWindow.rect;
|
||||
|
||||
if (!firstRect || !secondRect) {
|
||||
return;
|
||||
}
|
||||
|
||||
parentRect = parentNodeForFocus.parentNode.rect;
|
||||
let changePx = currentRect.width - firstWindowRect.width;
|
||||
parentRect = parentNodeForFocus.rect;
|
||||
let changePx = currentRect.width - firstRect.width;
|
||||
let firstPercent = (firstRect.width + changePx) / parentRect.width;
|
||||
let secondPercent = (secondRect.width - changePx) / parentRect.width;
|
||||
parentNodeForFocus.percent = firstPercent;
|
||||
focusNodeWindow.percent = firstPercent;
|
||||
resizePairForWindow.percent = secondPercent;
|
||||
}
|
||||
}
|
||||
} else if (orientation === ORIENTATION_TYPES.VERTICAL) {
|
||||
if (sameParent) {
|
||||
// use the window or con pairs
|
||||
if (this.tree.getTiledChildren(parentNodeForFocus.childNodes).length <= 1) {
|
||||
return;
|
||||
}
|
||||
firstRect = focusNodeWindow.initRect;
|
||||
if (resizePairForWindow) {
|
||||
if (
|
||||
!this.floatingWindow(resizePairForWindow) &&
|
||||
!this.minimizedWindow(resizePairForWindow)
|
||||
) {
|
||||
} else {
|
||||
// use the parent pairs (con to another con or window)
|
||||
if (resizePairForWindow && resizePairForWindow.parentNode) {
|
||||
if (this.tree.getTiledChildren(resizePairForWindow.parentNode.childNodes).length <= 1) {
|
||||
return;
|
||||
}
|
||||
let firstWindowRect = focusNodeWindow.initRect;
|
||||
let index = resizePairForWindow.index;
|
||||
if (position === POSITION.BEFORE) {
|
||||
// Find the opposite node
|
||||
index = index + 1;
|
||||
} else {
|
||||
index = index - 1;
|
||||
}
|
||||
parentNodeForFocus = resizePairForWindow.parentNode.childNodes[index];
|
||||
firstRect = parentNodeForFocus.rect;
|
||||
secondRect = resizePairForWindow.rect;
|
||||
} else {
|
||||
// TODO try to get the next resize pair?
|
||||
if (!firstRect || !secondRect) {
|
||||
return;
|
||||
}
|
||||
|
||||
parentRect = parentNodeForFocus.parentNode.rect;
|
||||
let changePx = currentRect.width - firstWindowRect.width;
|
||||
let firstPercent = (firstRect.width + changePx) / parentRect.width;
|
||||
let secondPercent = (secondRect.width - changePx) / parentRect.width;
|
||||
parentNodeForFocus.percent = firstPercent;
|
||||
resizePairForWindow.percent = secondPercent;
|
||||
}
|
||||
}
|
||||
if (!firstRect || !secondRect) {
|
||||
return;
|
||||
}
|
||||
parentRect = parentNodeForFocus.rect;
|
||||
let changePx = currentRect.height - firstRect.height;
|
||||
let firstPercent = (firstRect.height + changePx) / parentRect.height;
|
||||
let secondPercent = (secondRect.height - changePx) / parentRect.height;
|
||||
focusNodeWindow.percent = firstPercent;
|
||||
resizePairForWindow.percent = secondPercent;
|
||||
} else {
|
||||
// use the parent pairs (con to another con or window)
|
||||
if (resizePairForWindow && resizePairForWindow.parentNode) {
|
||||
if (this.tree.getTiledChildren(resizePairForWindow.parentNode.childNodes).length <= 1) {
|
||||
} else if (orientation === ORIENTATION_TYPES.VERTICAL) {
|
||||
if (sameParent) {
|
||||
// use the window or con pairs
|
||||
if (this.tree.getTiledChildren(parentNodeForFocus.childNodes).length <= 1) {
|
||||
return;
|
||||
}
|
||||
let firstWindowRect = focusNodeWindow.initRect;
|
||||
let index = resizePairForWindow.index;
|
||||
if (position === POSITION.BEFORE) {
|
||||
// Find the opposite node
|
||||
index = index + 1;
|
||||
} else {
|
||||
index = index - 1;
|
||||
firstRect = focusNodeWindow.initRect;
|
||||
if (resizePairForWindow) {
|
||||
if (
|
||||
!this.floatingWindow(resizePairForWindow) &&
|
||||
!this.minimizedWindow(resizePairForWindow)
|
||||
) {
|
||||
secondRect = resizePairForWindow.rect;
|
||||
} else {
|
||||
// TODO try to get the next resize pair?
|
||||
}
|
||||
}
|
||||
parentNodeForFocus = resizePairForWindow.parentNode.childNodes[index];
|
||||
firstRect = parentNodeForFocus.rect;
|
||||
secondRect = resizePairForWindow.rect;
|
||||
if (!firstRect || !secondRect) {
|
||||
return;
|
||||
}
|
||||
|
||||
parentRect = parentNodeForFocus.parentNode.rect;
|
||||
let changePx = currentRect.height - firstWindowRect.height;
|
||||
parentRect = parentNodeForFocus.rect;
|
||||
let changePx = currentRect.height - firstRect.height;
|
||||
let firstPercent = (firstRect.height + changePx) / parentRect.height;
|
||||
let secondPercent = (secondRect.height - changePx) / parentRect.height;
|
||||
parentNodeForFocus.percent = firstPercent;
|
||||
focusNodeWindow.percent = firstPercent;
|
||||
resizePairForWindow.percent = secondPercent;
|
||||
} else {
|
||||
// use the parent pairs (con to another con or window)
|
||||
if (resizePairForWindow && resizePairForWindow.parentNode) {
|
||||
if (this.tree.getTiledChildren(resizePairForWindow.parentNode.childNodes).length <= 1) {
|
||||
return;
|
||||
}
|
||||
let firstWindowRect = focusNodeWindow.initRect;
|
||||
let index = resizePairForWindow.index;
|
||||
if (position === POSITION.BEFORE) {
|
||||
// Find the opposite node
|
||||
index = index + 1;
|
||||
} else {
|
||||
index = index - 1;
|
||||
}
|
||||
parentNodeForFocus = resizePairForWindow.parentNode.childNodes[index];
|
||||
firstRect = parentNodeForFocus.rect;
|
||||
secondRect = resizePairForWindow.rect;
|
||||
if (!firstRect || !secondRect) {
|
||||
return;
|
||||
}
|
||||
|
||||
parentRect = parentNodeForFocus.parentNode.rect;
|
||||
let changePx = currentRect.height - firstWindowRect.height;
|
||||
let firstPercent = (firstRect.height + changePx) / parentRect.height;
|
||||
let secondPercent = (secondRect.height - changePx) / parentRect.height;
|
||||
parentNodeForFocus.percent = firstPercent;
|
||||
resizePairForWindow.percent = secondPercent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,6 +74,19 @@ export class SettingsPage extends PreferencesPage {
|
||||
],
|
||||
});
|
||||
|
||||
this.add_group({
|
||||
title: _("Behavior"),
|
||||
children: [
|
||||
new SwitchRow({
|
||||
title: _("Move Pointer with the Focus"),
|
||||
subtitle: _("Move the pointer when focusing or swapping via keyboard"),
|
||||
experimental: true,
|
||||
settings,
|
||||
bind: "move-pointer-focus-enabled",
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
this.add_group({
|
||||
title: _("Tiling"),
|
||||
children: [
|
||||
@ -106,6 +119,12 @@ export class SettingsPage extends PreferencesPage {
|
||||
{ id: "stacked", name: _("Stacked") },
|
||||
],
|
||||
}),
|
||||
new SwitchRow({
|
||||
title: _("Auto Exit Tabbed Tiling Mode"),
|
||||
subtitle: _("Exit tabbed tiling mode when only a single tab remains"),
|
||||
settings,
|
||||
bind: "auto-exit-tabbed",
|
||||
}),
|
||||
new SwitchRow({
|
||||
title: _("Auto Split"),
|
||||
subtitle: _("Quarter Tiling"),
|
||||
@ -130,19 +149,6 @@ export class SettingsPage extends PreferencesPage {
|
||||
],
|
||||
});
|
||||
|
||||
this.add_group({
|
||||
title: _("Behavior"),
|
||||
children: [
|
||||
new SwitchRow({
|
||||
title: _("Move Pointer with the Focus"),
|
||||
subtitle: _("Move the pointer when focusing or swapping via keyboard"),
|
||||
experimental: true,
|
||||
settings,
|
||||
bind: "move-pointer-focus-enabled",
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
if (!production) {
|
||||
this.add_group({
|
||||
title: _("Logger"),
|
||||
|
||||
Binary file not shown.
@ -10,9 +10,10 @@
|
||||
"settings-schema": "org.gnome.shell.extensions.forge",
|
||||
"shell-version": [
|
||||
"45",
|
||||
"46"
|
||||
"46",
|
||||
"47"
|
||||
],
|
||||
"url": "https://github.com/forge-ext/forge",
|
||||
"uuid": "forge@jmmaranan.com",
|
||||
"version": 78
|
||||
"version": 84
|
||||
}
|
||||
Binary file not shown.
@ -120,13 +120,17 @@
|
||||
</summary>
|
||||
</key>
|
||||
<key type="b" name="move-pointer-focus-enabled">
|
||||
<default>true</default>
|
||||
<default>false</default>
|
||||
<summary>Move the pointer when focusing or swapping via kbd</summary>
|
||||
</key>
|
||||
<key type="b" name="float-always-on-top-enabled">
|
||||
<default>true</default>
|
||||
<summary>Floating windows toggle always-on-top</summary>
|
||||
</key>
|
||||
<key type="b" name="auto-exit-tabbed">
|
||||
<default>true</default>
|
||||
<summary>Exit tabbed tiling mode when only a single tab remains</summary>
|
||||
</key>
|
||||
<key type="b" name="auto-split-enabled">
|
||||
<default>true</default>
|
||||
<summary>Enable auto split or quarter-tiling based based on smaller side</summary>
|
||||
|
||||
Reference in New Issue
Block a user