Skip to content

Commit 8a1f216

Browse files
committed
version 16.2: enable windows suggestions on edge tiling, add spanish and simplified chinese, add support to GNOME 48 and more
1 parent 73a1558 commit 8a1f216

File tree

26 files changed

+1743
-227
lines changed

26 files changed

+1743
-227
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
[![release](https://img.shields.io/badge/Release_v16-blue?style=for-the-badge)]([https://ko-fi.com/domferr](https://github.com/domferr/tilingshell/releases))
44
![](https://img.shields.io/github/license/domferr/tilingshell?style=for-the-badge)
5-
![](https://img.shields.io/badge/GNOME-42--47-e04196?style=for-the-badge&logo=gnome&logoColor=white)
5+
![](https://img.shields.io/badge/GNOME-42--48-e04196?style=for-the-badge&logo=gnome&logoColor=white)
66
[![kofi](https://img.shields.io/badge/Donate_on_Ko--fi-purple?logo=ko-fi&style=for-the-badge)](https://ko-fi.com/domferr)
7-
[![kofi](https://img.shields.io/badge/Patreon-F96854?style=for-the-badge&logo=patreon&logoColor=white)](https://patreon.com/domferr)
7+
[![patreon](https://img.shields.io/badge/Patreon-F96854?style=for-the-badge&logo=patreon&logoColor=white)](https://patreon.com/domferr)
88

99
# Tiling Shell #
1010

11-
This is a Gnome Shell extension implementing modern windows tiling system by extending GNOME's default 2 columns to any layout you want! Can be installed on Gnome Shells from **40 to 47** on X11 and Wayland: the most recent GNOME Shell is supported, and older releases will include all the features and bug fixes!
11+
This is a Gnome Shell extension implementing modern windows tiling system by extending GNOME's default 2 columns to any layout you want! Can be installed on Gnome Shells from **42 to 48** on X11 and Wayland: the most recent GNOME Shell is supported, and older releases will include all the features and bug fixes!
1212

1313
- 🤩 First and only extension that provides Windows 11's **snap assistant**
1414
- 🖥️🖥️ **multiple monitors support**, even with different scaling factors!
@@ -40,6 +40,9 @@ Have issues, you want to suggest a new feature or contribute? Please open a new
4040
| [⬇️](#tiling-buttons) **Tiling Buttons** | [⬇️](#per-workspace-layout) **Per-workspace layout** | [⬇️](#auto-tiling) **Auto-tiling** | [⬇️](#tiling-context-menu) **Tiling context menu** |
4141
| [⬇️](#smart-border-radius) **Smart border radius** | [⬇️](#windows-suggestions) **Windows Suggestions**
4242

43+
## 🎉🎉 Tiling Shell's AWESOME Supporters!
44+
Thank you to the :star2: **amazing** <a href="https://patreon.com/domferr"><img src="https://img.shields.io/badge/Patreons-F96854?logo=patreon&logoColor=white)" height="14px"/><a/> and **everyone** who donated on <a href="https://ko-fi.com/domferr"><img src="https://img.shields.io/badge/_Ko--fi-794bc4?logo=ko-fi&logoColor=white" height="14px"/><a/>! :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**!
45+
4346
### Tiling System ###
4447
When grabbing and moving a window, press <kbd>CTRL</kbd> 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.
4548

@@ -160,6 +163,7 @@ Right-click on a window to use the auto-tile buttons and the snap assistant from
160163

161164
In GNOME, different windows may have different border radius. Drawing a border around the focused window is hard because it is not possible to know the window border radius. All the existing extensions just draw a border with a static value, making the UI less polished. Tiling Shell, **dynamically** computes the focused window border radius at runtime. Moreover, if you have an extension or anything else who customize the border radius, the focused window border radius adapts as well! This can be enabled/disabled from the extension's preferences too.
162165

166+
163167
<p align="center">
164168
<img src="https://github.com/user-attachments/assets/cfaca5f9-d9b2-4739-9426-1aebb5f33c29" width=304 />
165169
<img src="https://github.com/user-attachments/assets/8e68abff-66e5-4b85-a6ce-0bd2da7be166" width=332 />

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tilingshell",
3-
"version": "16.0",
3+
"version": "16.2",
44
"author": "Domenico Ferraro <[email protected]>",
55
"private": true,
66
"license": "GPL v2.0",
14.4 KB
Binary file not shown.
1.15 KB
Binary file not shown.
12.6 KB
Binary file not shown.

resources/metadata.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
"44",
99
"45",
1010
"46",
11-
"47"
11+
"47",
12+
"48"
1213
],
1314
"version": 99,
14-
"version-name": "16.1",
15+
"version-name": "16.2",
1516
"url": "https://github.com/domferr/tilingshell",
1617
"settings-schema": "org.gnome.shell.extensions.tilingshell",
1718
"gettext-domain": "tilingshell",

src/components/editor/editorDialog.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ import Layout from '@/components/layout/Layout';
88
import Tile from '@/components/layout/Tile';
99
import * as ModalDialog from 'resource:///org/gnome/shell/ui/modalDialog.js';
1010
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
11-
import { enableScalingFactorSupport, getMonitorScalingFactor } from '@utils/ui';
11+
import {
12+
enableScalingFactorSupport,
13+
getMonitorScalingFactor,
14+
setWidgetOrientation,
15+
} from '@utils/ui';
1216
import { _ } from '../../translations';
1317

1418
@registerGObjectClass
@@ -51,7 +55,6 @@ export default class EditorDialog extends ModalDialog.ModalDialog {
5155
);
5256

5357
this._layoutsBoxLayout = new St.BoxLayout({
54-
vertical: false, // horizontal box layout
5558
styleClass: 'layouts-box-layout',
5659
xAlign: Clutter.ActorAlign.CENTER,
5760
});
@@ -83,7 +86,7 @@ export default class EditorDialog extends ModalDialog.ModalDialog {
8386
}
8487

8588
private _makeLegendDialog(params: { onClose: () => void; path: string }) {
86-
const suggestion1 = new St.BoxLayout({ vertical: false });
89+
const suggestion1 = new St.BoxLayout();
8790
// LEFT-CLICK to split a tile
8891
suggestion1.add_child(
8992
new St.Label({
@@ -105,7 +108,7 @@ export default class EditorDialog extends ModalDialog.ModalDialog {
105108
}),
106109
);
107110

108-
const suggestion2 = new St.BoxLayout({ vertical: false });
111+
const suggestion2 = new St.BoxLayout();
109112
// LEFT-CLICK + CTRL to split a tile vertically
110113
suggestion2.add_child(
111114
new St.Label({
@@ -146,7 +149,7 @@ export default class EditorDialog extends ModalDialog.ModalDialog {
146149
}),
147150
);
148151

149-
const suggestion3 = new St.BoxLayout({ vertical: false });
152+
const suggestion3 = new St.BoxLayout();
150153
// RIGHT-CLICK to delete a tile
151154
suggestion3.add_child(
152155
new St.Label({
@@ -169,7 +172,6 @@ export default class EditorDialog extends ModalDialog.ModalDialog {
169172
);
170173

171174
const suggestion4 = new St.BoxLayout({
172-
vertical: false,
173175
xExpand: true,
174176
margin_top: 16,
175177
});
@@ -196,9 +198,9 @@ export default class EditorDialog extends ModalDialog.ModalDialog {
196198
);
197199

198200
const legend = new St.BoxLayout({
199-
vertical: true,
200201
styleClass: 'legend',
201202
});
203+
setWidgetOrientation(legend, true);
202204
legend.add_child(suggestion1);
203205
legend.add_child(suggestion2);
204206
legend.add_child(suggestion3);
@@ -237,10 +239,10 @@ export default class EditorDialog extends ModalDialog.ModalDialog {
237239

238240
params.layouts.forEach((lay, btnInd) => {
239241
const box = new St.BoxLayout({
240-
vertical: true,
241242
xAlign: Clutter.ActorAlign.CENTER,
242243
styleClass: 'layout-button-container',
243244
});
245+
setWidgetOrientation(box, true);
244246
this._layoutsBoxLayout.add_child(box);
245247
const btn = new LayoutButton(
246248
box,
@@ -282,10 +284,10 @@ export default class EditorDialog extends ModalDialog.ModalDialog {
282284
});
283285

284286
const box = new St.BoxLayout({
285-
vertical: true,
286287
xAlign: Clutter.ActorAlign.CENTER,
287288
styleClass: 'layout-button-container',
288289
});
290+
setWidgetOrientation(box, true);
289291
this._layoutsBoxLayout.add_child(box);
290292
const newLayoutBtn = new LayoutButton(
291293
box,

src/components/snapassist/snapAssist.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ class SnapAssistContent extends St.BoxLayout {
6969
name: 'snap_assist_content',
7070
xAlign: Clutter.ActorAlign.CENTER,
7171
yAlign: Clutter.ActorAlign.CENTER,
72-
vertical: false,
7372
reactive: true,
7473
styleClass: 'popup-menu-content snap-assistant',
7574
});

src/components/tilingsystem/resizeManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,9 @@ class WindowClone extends St.Widget {
392392
yAlign: Clutter.ActorAlign.CENTER,
393393
xExpand: true,
394394
yExpand: true,
395-
vertical: true,
396395
style: "spacing: 16px;"
397396
});
397+
setWidgetOrientation(box, true);
398398
box.add_child(this._createAppIcon(window, APP_ICON_SIZE));
399399
box.add_child(new St.Label({
400400
xAlign: Clutter.ActorAlign.CENTER,

src/components/tilingsystem/tilingLayout.ts

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { registerGObjectClass } from '@/utils/gjs';
2-
import { Clutter, Mtk, Meta, St } from '@gi.ext';
2+
import { Clutter, Mtk, Meta } from '@gi.ext';
33
import TilePreview, {
44
TilePreviewConstructorProperties,
55
} from '../tilepreview/tilePreview';
@@ -9,11 +9,12 @@ import Tile from '../layout/Tile';
99
import {
1010
buildRectangle,
1111
buildTileGaps,
12+
clampPointInsideRect,
1213
isPointInsideRect,
1314
squaredEuclideanDistance,
1415
} from '@utils/ui';
1516
import TileUtils from '@components/layout/TileUtils';
16-
import { logger } from '@utils/logger';
17+
import { logger, rect_to_string } from '@utils/logger';
1718
import GlobalState from '@utils/globalState';
1819
import { KeyBindingsDirection } from '@keybindings';
1920

@@ -355,9 +356,13 @@ export default class TilingLayout extends LayoutWidget<DynamicTilePreview> {
355356
return [true, results];
356357
}
357358

359+
// enlarge the side of the direction and search a tile that contains that point
360+
// clamp to ensure we do not go outside of the container area (e.g. the screen)
358361
public findNearestTileDirection(
359362
source: Mtk.Rectangle,
360363
direction: KeyBindingsDirection,
364+
clamp: boolean,
365+
enlarge: number,
361366
): { rect: Mtk.Rectangle; tile: Tile } | undefined {
362367
if (direction === KeyBindingsDirection.NODIRECTION) return undefined;
363368

@@ -366,10 +371,6 @@ export default class TilingLayout extends LayoutWidget<DynamicTilePreview> {
366371
y: source.y + source.height / 2,
367372
};
368373

369-
// enlarge the side of the direction and search a tile that contains that point
370-
// clamp to ensure we do not go outside of the container area (e.g. the screen)
371-
const enlarge = 64;
372-
373374
switch (direction) {
374375
case KeyBindingsDirection.RIGHT:
375376
sourceCoords.x = source.x + source.width + enlarge;
@@ -392,8 +393,20 @@ export default class TilingLayout extends LayoutWidget<DynamicTilePreview> {
392393
this._containerRect.width + this._containerRect.x ||
393394
sourceCoords.y < this._containerRect.y ||
394395
sourceCoords.y > this._containerRect.height + this._containerRect.y
395-
)
396-
return undefined;
396+
) {
397+
if (!clamp) return undefined;
398+
// return undefined;
399+
sourceCoords.x = Math.clamp(
400+
sourceCoords.x,
401+
this._containerRect.x,
402+
this._containerRect.width + this._containerRect.x,
403+
);
404+
sourceCoords.y = Math.clamp(
405+
sourceCoords.y,
406+
this._containerRect.y,
407+
this._containerRect.height + this._containerRect.y,
408+
);
409+
}
397410

398411
// uncomment to show debugging
399412
/* global.windowGroup

0 commit comments

Comments
 (0)