12 Commits

Author SHA1 Message Date
Dome 95eb37ddd0 Add files via upload 2025-07-25 14:58:40 +00:00
Dome fe3b242476 Update org.gnome.shell.extensions.simple-tiling.domoel.gschema.xml 2025-07-25 16:58:14 +02:00
Dome 5614e5fff2 Update extension.js 2025-07-25 16:57:56 +02:00
Dome 4de841d8b0 Update metadata.json 2025-07-25 16:57:38 +02:00
Dome b0586e9c36 Update prefs.js 2025-07-25 16:57:22 +02:00
Dome c39a6799e2 Update README.md 2025-07-25 09:37:11 +02:00
Dome c495c85e95 Update README.md 2025-07-25 09:35:41 +02:00
Dome ca9ea8fcff Update org.gnome.shell.extensions.simple-tiling.domoel.gschema.xml 2025-07-25 00:57:33 +02:00
Dome 0a122565b8 Update org.gnome.shell.extensions.simple-tiling.domoel.gschema.xml 2025-07-25 00:48:37 +02:00
Dome 524098ce68 Update prefs.js 2025-07-25 00:48:18 +02:00
Dome c5e692bb45 Update README.md 2025-07-25 00:27:51 +02:00
Dome 421fb8796f Update README.md 2025-07-25 00:27:17 +02:00
6 changed files with 55 additions and 60 deletions
+3 -3
View File
@@ -28,8 +28,8 @@ This extension was built from the ground up to be stable and performant on **GNO
* **Interactive Window Swapping:** * **Interactive Window Swapping:**
* **Drag & Drop:** Swap any two windows by simply dragging one and dropping it over the other. * **Drag & Drop:** Swap any two windows by simply dragging one and dropping it over the other.
* **Keyboard Shortcuts:** A full set of keyboard shortcuts allows you to swap the focused window with the master or with its nearest neighbor in any direction (left, right, up, down). * **Keyboard Shortcuts:** A full set of keyboard shortcuts allows you to swap the focused window with the master or with its nearest neighbor in any direction (left, right, up, down).
* **Interactive Window Focus Switcher:** Change the current window focus with a set of customizable keyboard shortcuts in every direction. * **Interactive Window Focus Switcher:** Change the current window focus with a set of customizable keyboard shortcuts in every direction (left, right, up, down).
* **Simple Settings Panel:** A simple settings panel within the gnome extension manager menu to adjust key bindings and window gaps / margins. * **Simple Settings Panel:** A simple settings panel within the gnome extension manager menu to adjust key bindings, window gaps / margins and window behavior.
* **External Exception List:** Use a simple `exceptions.txt` file to list applications (by their `WM_CLASS`) that should be ignored by the tiling manager. * **External Exception List:** Use a simple `exceptions.txt` file to list applications (by their `WM_CLASS`) that should be ignored by the tiling manager.
* **Smart Pop-up Handling:** Windows on the exception list, as well as dialogs and other pop-ups, are automatically centered and kept "always on top" for a smooth workflow. * **Smart Pop-up Handling:** Windows on the exception list, as well as dialogs and other pop-ups, are automatically centered and kept "always on top" for a smooth workflow.
* **Configurable Tiling Window Delays:** Easily configure the tiling window delays if you have race condition issues by editing variables directly in the `extension.js`. * **Configurable Tiling Window Delays:** Easily configure the tiling window delays if you have race condition issues by editing variables directly in the `extension.js`.
@@ -66,7 +66,7 @@ Use the [GNOME Shell Extensions website](https://extensions.gnome.org/extension/
#### Keyboard Shortcuts #### Keyboard Shortcuts
All keyboard shortcuts can be configured through the Settings panel of Simple Tiling (which can be found in the Gnome Extesion Application): All keyboard shortcuts can be configured through the Settings panel of Simple Tiling (which can be found in the Gnome Extension Application):
1. Open **Settings**. 1. Open **Settings**.
2. Navigate to **Keyboard** -> **View and Customize Shortcuts**. 2. Navigate to **Keyboard** -> **View and Customize Shortcuts**.
3. Scroll down to the **Custom Shortcuts** section at the bottom. 3. Scroll down to the **Custom Shortcuts** section at the bottom.
+25 -6
View File
@@ -1,5 +1,5 @@
// ---------------------------------------------------- // // ---------------------------------------------------- //
// Simple-Tiling GNOME Shell 3.38 (X11) - Version 4 // // Simple-Tiling GNOME Shell 3.38 (X11) - Version 5 //
// © 2025 domoel MIT // // © 2025 domoel MIT //
// ---------------------------------------------------- // // ---------------------------------------------------- //
@@ -9,7 +9,6 @@
const Main = imports.ui.main; const Main = imports.ui.main;
const Meta = imports.gi.Meta; const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell; const Shell = imports.gi.Shell;
const Mainloop = imports.mainloop;
const Gio = imports.gi.Gio; const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib; const GLib = imports.gi.GLib;
const ExtensionUtils = imports.misc.extensionUtils; const ExtensionUtils = imports.misc.extensionUtils;
@@ -88,6 +87,7 @@ class InteractionHandler {
this._settingsChangedId = null; this._settingsChangedId = null;
} }
this._grabOpIds.forEach((id) => global.display.disconnect(id)); this._grabOpIds.forEach((id) => global.display.disconnect(id));
this._grabOpIds = [];
} }
_bind(key, callback) { _bind(key, callback) {
@@ -325,6 +325,9 @@ class Tiler {
this._exceptions = []; this._exceptions = [];
this._interactionHandler = new InteractionHandler(this); this._interactionHandler = new InteractionHandler(this);
this._tileTimeoutId = null;
this._centerTimeoutIds = [];
this._onWindowAdded = this._onWindowAdded.bind(this); this._onWindowAdded = this._onWindowAdded.bind(this);
this._onWindowRemoved = this._onWindowRemoved.bind(this); this._onWindowRemoved = this._onWindowRemoved.bind(this);
this._onActiveWorkspaceChanged = this._onActiveWorkspaceChanged.bind( this._onActiveWorkspaceChanged = this._onActiveWorkspaceChanged.bind(
@@ -355,6 +358,13 @@ class Tiler {
} }
disable() { disable() {
if (this._tileTimeoutId) {
GLib.source_remove(this._tileTimeoutId);
this._tileTimeoutId = null;
}
this._centerTimeoutIds.forEach(id => GLib.source_remove(id));
this._centerTimeoutIds = [];
this._interactionHandler.disable(); this._interactionHandler.disable();
this._disconnectFromWorkspace(); this._disconnectFromWorkspace();
for (const [, signal] of this._signalIds) { for (const [, signal] of this._signalIds) {
@@ -408,7 +418,12 @@ class Tiler {
} }
_centerWindow(win) { _centerWindow(win) {
Mainloop.timeout_add(this._centeringDelay, () => { const timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, this._centeringDelay, () => {
const index = this._centerTimeoutIds.indexOf(timeoutId);
if (index > -1) {
this._centerTimeoutIds.splice(index, 1);
}
if (!win || !win.get_display()) return GLib.SOURCE_REMOVE; if (!win || !win.get_display()) return GLib.SOURCE_REMOVE;
if (win.get_maximized()) { if (win.get_maximized()) {
win.unmaximize(Meta.MaximizeFlags.BOTH); win.unmaximize(Meta.MaximizeFlags.BOTH);
@@ -423,7 +438,7 @@ class Tiler {
workArea.x + Math.floor((workArea.width - frame.width) / 2), workArea.x + Math.floor((workArea.width - frame.width) / 2),
workArea.y + Math.floor((workArea.height - frame.height) / 2) workArea.y + Math.floor((workArea.height - frame.height) / 2)
); );
Mainloop.idle_add(() => { GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
if (win.get_display()) { if (win.get_display()) {
if (typeof win.set_keep_above === "function") if (typeof win.set_keep_above === "function")
win.set_keep_above(true); win.set_keep_above(true);
@@ -434,6 +449,8 @@ class Tiler {
}); });
return GLib.SOURCE_REMOVE; return GLib.SOURCE_REMOVE;
}); });
this._centerTimeoutIds.push(timeoutId);
} }
_onWindowMinimizedStateChanged() { _onWindowMinimizedStateChanged() {
@@ -535,11 +552,13 @@ class Tiler {
} }
queueTile() { queueTile() {
if (this._tileInProgress) return; if (this._tileInProgress || this._tileTimeoutId) return;
this._tileInProgress = true; this._tileInProgress = true;
Mainloop.timeout_add(this._tilingDelay, () => {
this._tileTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, this._tilingDelay, () => {
this._tileWindows(); this._tileWindows();
this._tileInProgress = false; this._tileInProgress = false;
this._tileTimeoutId = null;
return GLib.SOURCE_REMOVE; return GLib.SOURCE_REMOVE;
}); });
} }
+1 -1
View File
@@ -2,7 +2,7 @@
"uuid": "simple-tiling@domoel", "uuid": "simple-tiling@domoel",
"name": "Simple Tiling", "name": "Simple Tiling",
"description": "A Simple Tiling Extension for Gnome Shell 3.38.", "description": "A Simple Tiling Extension for Gnome Shell 3.38.",
"version": 4, "version": 5,
"shell-version": [ "3.38" ], "shell-version": [ "3.38" ],
"settings-schema": "org.gnome.shell.extensions.simple-tiling.domoel", "settings-schema": "org.gnome.shell.extensions.simple-tiling.domoel",
"preferences_ui": "prefs.js", "preferences_ui": "prefs.js",
+9 -33
View File
@@ -1,5 +1,5 @@
// ------------------------------------------------------ // // ------------------------------------------------------ //
// Extension Settings Menu for Simple Tiling - Version 4 // // Extension Settings Menu for Simple Tiling - Version 5 //
// © 2025 domoel MIT // // © 2025 domoel MIT //
// ------------------------------------------------------ // // ------------------------------------------------------ //
@@ -66,41 +66,17 @@ function buildPrefsWidget() {
GObject.TYPE_INT, GObject.TYPE_INT,
]); ]);
addKeybinding( addKeybinding(store, settings, "swap-master-window", "Master-Fenster tauschen");
store,
settings, addKeybinding(store, settings, "swap-up-window", "Fenster nach oben tauschen");
"swap-master-window", addKeybinding(store, settings, "swap-down-window", "Fenster nach unten tauschen");
"Master-Fenster tauschen" addKeybinding(store, settings, "swap-left-window", "Fenster nach links tauschen");
); addKeybinding(store, settings, "swap-right-window", "Fenster nach rechts tauschen");
addKeybinding(
store,
settings,
"swap-left-window",
"Fenster nach links tauschen"
);
addKeybinding(
store,
settings,
"swap-right-window",
"Fenster nach rechts tauschen"
);
addKeybinding(
store,
settings,
"swap-up-window",
"Fenster nach oben tauschen"
);
addKeybinding(
store,
settings,
"swap-down-window",
"Fenster nach unten tauschen"
);
addKeybinding(store, settings, "focus-left", "Fokus nach links wechseln");
addKeybinding(store, settings, "focus-right", "Fokus nach rechts wechseln");
addKeybinding(store, settings, "focus-up", "Fokus nach oben wechseln"); addKeybinding(store, settings, "focus-up", "Fokus nach oben wechseln");
addKeybinding(store, settings, "focus-down", "Fokus nach unten wechseln"); addKeybinding(store, settings, "focus-down", "Fokus nach unten wechseln");
addKeybinding(store, settings, "focus-left", "Fokus nach links wechseln");
addKeybinding(store, settings, "focus-right", "Fokus nach rechts wechseln");
let treeView = new Gtk.TreeView({ let treeView = new Gtk.TreeView({
model: store, model: store,
Binary file not shown.
@@ -1,19 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<schemalist> <schemalist>
<schema id="org.gnome.shell.extensions.simple-tiling.domoel" path="/org/gnome/shell/extensions/simple-tiling-domoel/"> <schema id="org.gnome.shell.extensions.simple-tiling.domoel" path="/org/gnome/shell/extensions/simple-tiling/domoel/">
<key name="swap-master-window" type="as"> <key name="swap-master-window" type="as">
<default><![CDATA[['<Super>Return']]]></default> <default><![CDATA[['<Super>Return']]]></default>
<summary>Tauscht das fokussierte Fenster mit dem Master.</summary> <summary>Tauscht das fokussierte Fenster mit dem Master.</summary>
</key> </key>
<key name="swap-left-window" type="as">
<default><![CDATA[['<Super>Left']]]></default>
<summary>Tauscht das Fenster mit dem linken Nachbarn.</summary>
</key>
<key name="swap-right-window" type="as">
<default><![CDATA[['<Super>Right']]]></default>
<summary>Tauscht das Fenster mit dem rechten Nachbarn.</summary>
</key>
<key name="swap-up-window" type="as"> <key name="swap-up-window" type="as">
<default><![CDATA[['<Super>Up']]]></default> <default><![CDATA[['<Super>Up']]]></default>
<summary>Tauscht das Fenster mit dem oberen Nachbarn.</summary> <summary>Tauscht das Fenster mit dem oberen Nachbarn.</summary>
@@ -22,21 +14,29 @@
<default><![CDATA[['<Super>Down']]]></default> <default><![CDATA[['<Super>Down']]]></default>
<summary>Tauscht das Fenster mit dem unteren Nachbarn.</summary> <summary>Tauscht das Fenster mit dem unteren Nachbarn.</summary>
</key> </key>
<key name="swap-left-window" type="as">
<default><![CDATA[['<Super>Left']]]></default>
<summary>Tauscht das Fenster mit dem linken Nachbarn.</summary>
</key>
<key name="swap-right-window" type="as">
<default><![CDATA[['<Super>Right']]]></default>
<summary>Tauscht das Fenster mit dem rechten Nachbarn.</summary>
</key>
<key name="focus-up" type="as"> <key name="focus-up" type="as">
<default><![CDATA[['<Alt>k']]]></default> <default><![CDATA[['<Alt>Up']]]></default>
<summary>Fokus zum oberen Fenster wechseln.</summary> <summary>Fokus zum oberen Fenster wechseln.</summary>
</key> </key>
<key name="focus-down" type="as"> <key name="focus-down" type="as">
<default><![CDATA[['<Alt>j']]]></default> <default><![CDATA[['<Alt>Down']]]></default>
<summary>Fokus zum unteren Fenster wechseln.</summary> <summary>Fokus zum unteren Fenster wechseln.</summary>
</key> </key>
<key name="focus-left" type="as"> <key name="focus-left" type="as">
<default><![CDATA[['<Alt>h']]]></default> <default><![CDATA[['<Alt>Left']]]></default>
<summary>Fokus zum linken Fenster wechseln.</summary> <summary>Fokus zum linken Fenster wechseln.</summary>
</key> </key>
<key name="focus-right" type="as"> <key name="focus-right" type="as">
<default><![CDATA[['<Alt>l']]]></default> <default><![CDATA[['<Alt>Right']]]></default>
<summary>Fokus zum rechten Fenster wechseln.</summary> <summary>Fokus zum rechten Fenster wechseln.</summary>
</key> </key>
@@ -44,14 +44,14 @@
<default>10</default> <default>10</default>
<summary>Der Abstand zwischen den Fenstern in Pixeln.</summary> <summary>Der Abstand zwischen den Fenstern in Pixeln.</summary>
</key> </key>
<key name="outer-gap-horizontal" type="i">
<default>5</default>
<summary>Der Abstand zum linken und rechten Bildschirmrand.</summary>
</key>
<key name="outer-gap-vertical" type="i"> <key name="outer-gap-vertical" type="i">
<default>5</default> <default>5</default>
<summary>Der Abstand zum oberen und unteren Bildschirmrand.</summary> <summary>Der Abstand zum oberen und unteren Bildschirmrand.</summary>
</key> </key>
<key name="outer-gap-horizontal" type="i">
<default>10</default>
<summary>Der Abstand zum linken und rechten Bildschirmrand.</summary>
</key>
<key name="new-window-behavior" type="s"> <key name="new-window-behavior" type="s">
<default>'stack'</default> <default>'stack'</default>