Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# Window Gestures

Window Gestures is GNOME Shell extension for managing window with touchpad gestures.
Support only for GNOME 45.
Support up to gnome 49.

## Installation
[![Get from GNOME Extension](./gext.svg)](https://extensions.gnome.org/extension/6343/window-gestures/)
*Gnome extension repository don't support Gnome 49*
### Manually
Comment on lines +4 to +8
**Clone the repository and enter it**
`git clone https://github.com/spitzerl/windowgestures && cd windowgestures`
**Run the building script**
`./build.sh`
**Then install the generated zip**
`gnome-extensions install windowgestures@extension.amarullz.com.zip`
Restart your session and then open your extension manager to activate it.
<!--[![Get from GNOME Extension](./gext.svg)](https://extensions.gnome.org/extension/6343/window-gestures/)-->


## Features
Expand Down
21 changes: 11 additions & 10 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Meta from 'gi://Meta';
import St from 'gi://St';
import Shell from 'gi://Shell';
import Gio from 'gi://Gio';
import Mtk from 'gi://Mtk';

import * as Main from 'resource:///org/gnome/shell/ui/main.js';
import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js';
Expand Down Expand Up @@ -557,7 +558,7 @@ class Manager {
return;
}
global.window_manager.emit("show-tile-preview",
global.display.get_focus_window(), new Meta.Rectangle(
global.display.get_focus_window(), new Mtk.Rectangle(
{ x: rx, y: ry, width: rw, height: rh }
)
, this._monitorId
Expand Down Expand Up @@ -1038,7 +1039,7 @@ class Manager {
}
if (setmove) {
if (this._targetWindow.allows_move() &&
!this._targetWindow.get_maximized()) {
!this._targetWindow.is_maximized()) {
this._edgeAction = WindowEdgeAction.MOVE;
}
}
Expand Down Expand Up @@ -1100,7 +1101,7 @@ class Manager {
let holdMove = this._getTapHoldMove();

if (!allowMove || holdMove) {
if (!this._targetWindow.get_maximized() &&
if (!this._targetWindow.is_maximized() &&
!this._targetWindow.isTiled) {
this._edgeGestured = 1;
}
Expand All @@ -1111,7 +1112,7 @@ class Manager {
else if (
!this._edgeGestured &&
!this._targetWindow.is_fullscreen() &&
!this._targetWindow.get_maximized() &&
!this._targetWindow.is_maximized() &&
this._targetWindow.allows_move()) {
this._edgeAction = WindowEdgeAction.MOVE;
return this._swipeUpdateMove();
Expand Down Expand Up @@ -1330,7 +1331,7 @@ class Manager {
if (this._isEdge(WindowEdgeAction.MOVE_SNAP_TOP)) {
if (this._targetWindow.can_maximize()) {
this._resetWinPos();
this._targetWindow.maximize(Meta.MaximizeFlags.BOTH);
this._targetWindow.set_maximize_flags(Meta.MaximizeFlags.BOTH);
}
}
else if (this._isEdge(WindowEdgeAction.MOVE_SNAP_LEFT)) {
Expand Down Expand Up @@ -1550,7 +1551,7 @@ class Manager {
activeWin = global.display.get_focus_window();
}
if (activeWin && ((activeWin.allows_move() &&
!activeWin.get_maximized()) || !isWin)) {
!activeWin.is_maximized()) || !isWin)) {
activeWin.activate(
Meta.CURRENT_TIME
);
Expand Down Expand Up @@ -2502,7 +2503,7 @@ class Manager {
}

let winCanMax = activeWin.allows_move() && activeWin.can_maximize();
let winIsMaximized = activeWin.get_maximized();
let winIsMaximized = activeWin.is_maximized();
let winMaxed = Meta.MaximizeFlags.BOTH == winIsMaximized;
if (activeWin.isTiled) {
winIsMaximized = Meta.MaximizeFlags.VERTICAL;
Expand Down Expand Up @@ -2608,7 +2609,7 @@ class Manager {
}
if (this._actionWidgets[wid] && (progress > 0)) {
if (ui == 1) {
activeWin.maximize(Meta.MaximizeFlags.BOTH);
activeWin.set_maximize_flags(Meta.MaximizeFlags.BOTH);
}
else if (ui == 2) {
this._setSnapWindow(0);
Expand Down Expand Up @@ -2647,7 +2648,7 @@ class Manager {
}
else if (ui == 6) {
// restore
activeWin.unmaximize(
activeWin.set_unmaximize_flags(
Meta.MaximizeFlags.BOTH
);
if (activeWin.isTiled) {
Expand Down Expand Up @@ -2679,4 +2680,4 @@ export default class WindowGesturesExtension extends Extension {
this.manager.destroy();
this.manager = null;
}
}
}
Loading