From cd41f13ff9f0d892d0c87cadc62ea66d83a45e0d Mon Sep 17 00:00:00 2001 From: Domenico Ferraro Date: Tue, 22 Apr 2025 22:13:57 +0200 Subject: [PATCH 1/2] feat: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06ba946..5b2caa0 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Have issues, you want to suggest a new feature or contribute? Please open a new | [⬇️](#smart-border-radius) **Smart border radius** | [⬇️](#windows-suggestions) **Windows Suggestions** ## 🎉🎉 Tiling Shell's AWESOME Supporters! -Thank you to the :star2: **amazing** and **everyone** who donated on ! :medal_sports:Tomoyuki Kashiro and Markus Huggler on Patreon:medal_sports: and Nick, thy-fi, iatanas0v, Chris, wbezs, DaneshManoharan, Tamas, Ivan Banha and many more on Ko-fi! You are on a mission to **make Linux window management better for everyone**! +Thank you to the :star2: **amazing** and **everyone** who donated on ! :medal_sports:jane, Sean and Markus Huggler on Patreon:medal_sports: and Nick, thy-fi, iatanas0v, Chris, wbezs, DaneshManoharan, Tamas, Ivan Banha and many more on Ko-fi! You are on a mission to **make Linux window management better for everyone**! ### Tiling System ### When grabbing and moving a window, press CTRL key to show the tiling layout (you can choose another key from the preferences). When moving on a tile, it will highlight. Ungrab the window to place that window on the highlighted tile. From 08327d374b69e2ef0a252c0f7d8aea526d76e229 Mon Sep 17 00:00:00 2001 From: Gregorein Date: Wed, 23 Apr 2025 19:56:51 +0200 Subject: [PATCH 2/2] feat: add multi-tile window suggestions feature - Introduced a new setting to enable multi-tile window suggestions, allowing windows to be displayed in all available tiles after snapping. - Updated the preferences UI to include the new setting. - Modified the layout logic to support multi-tile mode, ensuring windows are shown across all previews. --- ...e.shell.extensions.tilingshell.gschema.xml | 5 ++ .../tilingLayoutWithSuggestions.ts | 49 ++++++++++++++++++- src/prefs.ts | 11 ++++- src/settings/settings.ts | 10 ++++ 4 files changed, 72 insertions(+), 3 deletions(-) diff --git a/resources/schemas/org.gnome.shell.extensions.tilingshell.gschema.xml b/resources/schemas/org.gnome.shell.extensions.tilingshell.gschema.xml index 3a861fa..103d505 100644 --- a/resources/schemas/org.gnome.shell.extensions.tilingshell.gschema.xml +++ b/resources/schemas/org.gnome.shell.extensions.tilingshell.gschema.xml @@ -172,6 +172,11 @@ Enable window suggestions for screen edge snapping Suggests windows to occupy empty tiles when snapping to screen edges. + + false + Enable multi-tile window suggestions + Displays window suggestions in all available tiles after a snap. + diff --git a/src/components/windowsSuggestions/tilingLayoutWithSuggestions.ts b/src/components/windowsSuggestions/tilingLayoutWithSuggestions.ts index 3363ab3..079d121 100644 --- a/src/components/windowsSuggestions/tilingLayoutWithSuggestions.ts +++ b/src/components/windowsSuggestions/tilingLayoutWithSuggestions.ts @@ -12,6 +12,7 @@ import LayoutWidget from '@components/layout/LayoutWidget'; import SignalHandling from '@utils/signalHandling'; import SuggestionsTilePreview from '@components/windowsSuggestions/suggestionsTilePreview'; import TilingShellWindowManager from '@components/windowManager/tilingShellWindowManager'; +import Settings from '@settings/settings'; const debug = logger('TilingLayoutWithSuggestions'); @@ -137,12 +138,33 @@ export default class TilingLayoutWithSuggestions extends LayoutWidget { + this._showWindowsInPreview( + preview, + nontiledWindows, + monitorIndex, + ); + }); + return; + } + + // Original single-tile mode logic - find the leftmost preview let preview = this._previews[0]; this._previews.forEach((prev) => { if (prev.x < preview.x) preview = prev; }); + this._showWindowsInPreview(preview, nontiledWindows, monitorIndex); + } + + private _showWindowsInPreview( + preview: SuggestionsTilePreview, + nontiledWindows: Meta.Window[], + monitorIndex: number, + ): void { const clones = nontiledWindows.map((nonTiledWin) => { const winClone = new SuggestedWindowPreview(nonTiledWin); const winActor = @@ -242,7 +264,30 @@ export default class TilingLayoutWithSuggestions extends LayoutWidget { + prev.removeAllWindows(); + this._showWindowsInPreview( + prev, + nontiledWindows, + monitorIndex, + ); + }); + } + } else { + // Original behavior: recursively show popup on the next vacant tile + this._recursivelyShowPopup(nontiledWindows, monitorIndex); + } + return Clutter.EVENT_STOP; // Blocca la propagazione }); return winClone; diff --git a/src/prefs.ts b/src/prefs.ts index cbfa15d..48bf4db 100644 --- a/src/prefs.ts +++ b/src/prefs.ts @@ -124,7 +124,7 @@ export default class TilingShellExtensionPreferences extends ExtensionPreference this._buildSwitchRow( Settings.KEY_ENABLE_SMART_WINDOW_BORDER_RADIUS, _('Smart border radius'), - _('Dynamically adapt to the window’s actual border radius'), + _("Dynamically adapt to the window's actual border radius"), ), ); windowBorderRow.add_row( @@ -334,6 +334,15 @@ export default class TilingShellExtensionPreferences extends ExtensionPreference ); windowsSuggestionsGroup.add(screenEdgesWindowSuggestionRow); + const multiTileWindowSuggestionRow = this._buildSwitchRow( + Settings.KEY_ENABLE_MULTI_TILE_WINDOW_SUGGESTIONS, + _('Enable multi-tile window suggestions'), + _( + 'Displays window suggestions in all available tiles after a snap', + ), + ); + windowsSuggestionsGroup.add(multiTileWindowSuggestionRow); + prefsPage.add(windowsSuggestionsGroup); // Layouts section diff --git a/src/settings/settings.ts b/src/settings/settings.ts index 8a9e647..d086c81 100644 --- a/src/settings/settings.ts +++ b/src/settings/settings.ts @@ -117,6 +117,8 @@ export default class Settings { 'enable-snap-assistant-windows-suggestions'; static KEY_ENABLE_SCREEN_EDGES_WINDOWS_SUGGESTIONS = 'enable-screen-edges-windows-suggestions'; + static KEY_ENABLE_MULTI_TILE_WINDOW_SUGGESTIONS = + 'enable-multi-tile-window-suggestions'; static SETTING_MOVE_WINDOW_RIGHT = 'move-window-right'; static SETTING_MOVE_WINDOW_LEFT = 'move-window-left'; @@ -439,6 +441,14 @@ export default class Settings { set_boolean(Settings.KEY_ENABLE_SCREEN_EDGES_WINDOWS_SUGGESTIONS, val); } + static get ENABLE_MULTI_TILE_WINDOW_SUGGESTIONS(): boolean { + return get_boolean(Settings.KEY_ENABLE_MULTI_TILE_WINDOW_SUGGESTIONS); + } + + static set ENABLE_MULTI_TILE_WINDOW_SUGGESTIONS(val: boolean) { + set_boolean(Settings.KEY_ENABLE_MULTI_TILE_WINDOW_SUGGESTIONS, val); + } + static get_inner_gaps(scaleFactor: number = 1): { top: number; bottom: number;