Skip to content

Commit c3dfe86

Browse files
laurentlbmjackpot51
authored andcommitted
fix(tiling): support resizing/moving windows with the mouse in GNOME 40
Fixes #932.
1 parent 475b49d commit c3dfe86

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/extension.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,14 +1789,24 @@ export class Ext extends Ecs.System<ExtEvent> {
17891789
this.register({ tag: 3, window });
17901790
});
17911791

1792-
this.connect(display, 'grab-op-begin', (_, _display, win, op) => {
1793-
this.on_grab_start(win, op);
1794-
});
1792+
if (GNOME_VERSION?.startsWith("3.")) {
1793+
// GNOME 40 removed the first argument of the callback
1794+
this.connect(display, 'grab-op-begin', (_, _display, win, op) => {
1795+
this.on_grab_start(win, op);
1796+
});
17951797

1796-
this.connect(display, 'grab-op-end', (_, _display, win, op) => {
1797-
this.register_fn(() => this.on_grab_end(win, op));
1798+
this.connect(display, 'grab-op-end', (_, _display, win, op) => {
1799+
this.register_fn(() => this.on_grab_end(win, op));
1800+
});
1801+
} else {
1802+
this.connect(display, 'grab-op-begin', (_display, win, op) => {
1803+
this.on_grab_start(win, op);
1804+
});
17981805

1799-
});
1806+
this.connect(display, 'grab-op-end', (_display, win, op) => {
1807+
this.register_fn(() => this.on_grab_end(win, op));
1808+
});
1809+
}
18001810

18011811
this.connect(overview, 'window-drag-begin', (_, win) => {
18021812
this.on_grab_start(win, 1)

0 commit comments

Comments
 (0)