Skip to content

Commit 9cfdd10

Browse files
authored
Merge branch 'main' into lenemter/pip-mask-window
2 parents 6cfa36b + a05fdfe commit 9cfdd10

File tree

79 files changed

+1931
-1396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1931
-1396
lines changed

.github/workflows/gettext.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
apt-get install git -y
1818
1919
- name: Clone repository
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@v5
2121
with:
2222
token: ${{ secrets.GIT_USER_TOKEN }}
2323

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
image: ghcr.io/elementary/docker:${{ matrix.version }}
2828

2929
steps:
30-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v5
3131
- name: Install Dependencies
3232
run: |
3333
apt update
@@ -47,7 +47,7 @@ jobs:
4747
image: fedora:latest
4848

4949
steps:
50-
- uses: actions/checkout@v4
50+
- uses: actions/checkout@v5
5151
- name: Install Dependencies
5252
run: |
5353
dnf install -y desktop-file-utils gettext gsettings-desktop-schemas-devel atk-devel libcanberra-devel clutter-devel libgee-devel glib2-devel gnome-desktop3-devel granite-devel granite-7-devel gtk3-devel gtk4-devel libhandy-devel mutter-devel sqlite-devel meson valac valadoc
@@ -70,7 +70,7 @@ jobs:
7070
zypper addrepo https://download.opensuse.org/repositories/X11:Pantheon/15.6/X11:Pantheon.repo
7171
zypper --gpg-auto-import-keys refresh
7272
zypper --non-interactive install tar git desktop-file-utils gsettings-desktop-schemas-devel libatk-1_0-0 libcanberra-devel clutter-devel libgee-devel glib2-devel libgnome-desktop-3-devel granite6-devel granite-devel gtk3-devel gtk4-devel libhandy-devel mutter-devel sqlite3-devel meson vala valadoc gcc
73-
- uses: actions/checkout@v4
73+
- uses: actions/checkout@v5
7474
- name: Build
7575
env:
7676
DESTDIR: out
@@ -85,7 +85,7 @@ jobs:
8585
image: valalang/lint
8686

8787
steps:
88-
- uses: actions/checkout@v4
88+
- uses: actions/checkout@v5
8989
- name: Lint
9090
run: |
9191
io.elementary.vala-lint -d daemon

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
runs-on: ubuntu-22.04
1111
if: github.event.pull_request.merged == true && true == contains(join(github.event.pull_request.labels.*.name), 'Release')
1212
steps:
13-
- uses: actions/checkout@v4
14-
- uses: elementary/actions/release@master
13+
- uses: actions/checkout@v5
14+
- uses: elementary/actions/release@main
1515
env:
1616
GIT_USER_TOKEN: "${{ secrets.GIT_USER_TOKEN }}"
1717
GIT_USER_NAME: "elementaryBot"

daemon-gtk3/BackgroundMenu.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*/
55

66
public class Gala.Daemon.BackgroundMenu : Gtk.Menu {
7-
public const string ACTION_GROUP_PREFIX = "background-menu";
8-
public const string ACTION_PREFIX = ACTION_GROUP_PREFIX + ".";
7+
private const string ACTION_GROUP_PREFIX = "background-menu";
8+
private const string ACTION_PREFIX = ACTION_GROUP_PREFIX + ".";
99

1010
construct {
1111
var change_wallpaper = new Gtk.MenuItem.with_label (_("Change Wallpaper…")) {

daemon/MonitorLabel.vala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
public class Gala.Daemon.MonitorLabel : Gtk.Window {
7-
private const int SPACING = 12;
87
private const string COLORED_STYLE_CSS = """
98
.%s {
109
background-color: alpha(%s, 0.8);

data/[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Type=notify
2222
ExecStart=@bindir@/gala
2323

2424
# unset some environment variables that were set by the compositor and won't work now that the compositor is gone
25-
ExecStopPost=-/bin/sh -c 'test "$SERVICE_RESULT" != "exec-condition" && systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY'
25+
ExecStopPost=-/bin/sh -c 'test "$SERVICE_RESULT" != "exec-condition" && systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY && rm -f "$XDG_RUNTIME_DIR/wayland-0" "$XDG_RUNTIME_DIR/wayland-0.lock"'
2626

2727
# On wayland we cannot restart
2828
Restart=no

lib/DragDropAction.vala

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ namespace Gala {
5555
*/
5656
public signal void destination_crossed (Clutter.Actor destination, bool hovered);
5757

58+
/**
59+
* Emitted on the source when we are hovering over a destination.
60+
*
61+
* @param destination The destination actor that we are hovering over
62+
* @param x The x coordinate relative to the destination actor
63+
* @param y The y coordinate relative to the destination actor
64+
*/
65+
public signal void destination_motion (Clutter.Actor destination, float x, float y);
66+
5867
/**
5968
* The source has been clicked, but the movement was not larger than
6069
* the drag threshold. Useful if the source is also activatable.
@@ -341,7 +350,7 @@ namespace Gala {
341350
last_y = y;
342351

343352
var stage = actor.get_stage ();
344-
var actor = stage.get_actor_at_pos (Clutter.PickMode.REACTIVE, (int) x, (int) y);
353+
var actor = stage.get_actor_at_pos (NONE, (int) x, (int) y);
345354
DragDropAction action = null;
346355
// if we're allowed to bubble and this actor is not a destination, check its parents
347356
if (actor != null && (action = get_drag_drop_action (actor)) == null && allow_bubbling) {
@@ -352,8 +361,12 @@ namespace Gala {
352361
}
353362

354363
// didn't change, no need to do anything
355-
if (actor == hovered)
364+
if (actor == hovered) {
365+
if (hovered != null) {
366+
destination_motion (hovered, x - hovered.x, y - hovered.y);
367+
}
356368
return Clutter.EVENT_STOP;
369+
}
357370

358371
if (action == null) {
359372
// apparently we left ours if we had one before
@@ -436,12 +449,12 @@ namespace Gala {
436449
}
437450

438451
private void finish () {
452+
drag_end (hovered);
453+
439454
// make sure they reset the style or whatever they changed when hovered
440455
emit_crossed (hovered, false);
441456

442457
cleanup ();
443-
444-
drag_end (hovered);
445458
}
446459

447460
private void cleanup () {

lib/Gestures/Gesture.vala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ namespace Gala {
3939
SWITCH_WORKSPACE,
4040
SWITCH_WINDOWS,
4141
MULTITASKING_VIEW,
42-
DOCK,
4342
ZOOM,
44-
CLOSE_WINDOW,
43+
CUSTOM,
4544
N_ACTIONS
4645
}
4746

lib/Gestures/GestureBackend.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
private interface Gala.GestureBackend : Object {
99
public signal bool on_gesture_detected (Gesture gesture, uint32 timestamp);
10-
public signal void on_begin (double delta, uint64 time);
11-
public signal void on_update (double delta, uint64 time);
12-
public signal void on_end (double delta, uint64 time);
10+
public signal void on_begin (double percentage, uint64 time);
11+
public signal void on_update (double percentage, uint64 time);
12+
public signal void on_end (double percentage, uint64 time);
1313

1414
public virtual void prepare_gesture_handling () { }
1515

lib/Gestures/GestureController.vala

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,17 @@
1919
* it will be a hard boundary, if they are fractional it will slow the gesture progress when over the
2020
* limit simulating a kind of spring that pushes against it.
2121
* Note that the progress snaps to full integer values after a gesture ends.
22+
* Events are always shared between all GestureControllers in the same group (except for the group NONE).
23+
* This means that two gestures that can be done in one motion (e.g. horizontal and vertical swipe)
24+
* can be done simultaneously if each of two GestureControllers in the same group handle one of
25+
* the gestures.
2226
*/
2327
public class Gala.GestureController : Object {
28+
public enum Group {
29+
NONE,
30+
MULTITASKING_VIEW,
31+
}
32+
2433
/**
2534
* When a gesture ends with a velocity greater than this constant, the action is not cancelled,
2635
* even if the animation threshold has not been reached.
@@ -34,6 +43,7 @@ public class Gala.GestureController : Object {
3443

3544
public GestureAction action { get; construct; }
3645
public WindowManager wm { get; construct; }
46+
public Group group { get; construct; }
3747

3848
private unowned RootTarget? _target;
3949
public RootTarget target {
@@ -50,6 +60,7 @@ public class Gala.GestureController : Object {
5060
public double distance { get; construct set; }
5161
public double overshoot_lower_clamp { get; construct set; default = 0d; }
5262
public double overshoot_upper_clamp { get; construct set; default = 1d; }
63+
public bool follow_natural_scroll { get; set; default = false; }
5364

5465
/**
5566
* When disabled gesture progress will stay where the gesture ended and not snap to full integers values.
@@ -77,7 +88,8 @@ public class Gala.GestureController : Object {
7788

7889
public bool recognizing { get; private set; }
7990

80-
private ToucheggBackend? touchpad_backend;
91+
private ToucheggBackend? touchegg_backend;
92+
private TouchpadBackend? touchpad_backend;
8193
private ScrollBackend? scroll_backend;
8294

8395
private GestureBackend? recognizing_backend;
@@ -90,8 +102,8 @@ public class Gala.GestureController : Object {
90102

91103
private SpringTimeline? timeline;
92104

93-
public GestureController (GestureAction action, WindowManager wm) {
94-
Object (action: action, wm: wm);
105+
public GestureController (GestureAction action, WindowManager wm, Group group = NONE) {
106+
Object (action: action, wm: wm, group: group);
95107
}
96108

97109
/**
@@ -107,12 +119,20 @@ public class Gala.GestureController : Object {
107119
unref ();
108120
}
109121

110-
public void enable_touchpad () {
111-
touchpad_backend = ToucheggBackend.get_default ();
112-
touchpad_backend.on_gesture_detected.connect (gesture_detected);
113-
touchpad_backend.on_begin.connect (gesture_begin);
114-
touchpad_backend.on_update.connect (gesture_update);
115-
touchpad_backend.on_end.connect (gesture_end);
122+
public void enable_touchpad (Clutter.Actor actor) {
123+
if (Meta.Util.is_wayland_compositor ()) {
124+
touchpad_backend = new TouchpadBackend (actor, group);
125+
touchpad_backend.on_gesture_detected.connect (gesture_detected);
126+
touchpad_backend.on_begin.connect (gesture_begin);
127+
touchpad_backend.on_update.connect (gesture_update);
128+
touchpad_backend.on_end.connect (gesture_end);
129+
}
130+
131+
touchegg_backend = ToucheggBackend.get_default (); // Will automatically filter events on wayland
132+
touchegg_backend.on_gesture_detected.connect (gesture_detected);
133+
touchegg_backend.on_begin.connect (gesture_begin);
134+
touchegg_backend.on_update.connect (gesture_update);
135+
touchegg_backend.on_end.connect (gesture_end);
116136
}
117137

118138
public void enable_scroll (Clutter.Actor actor, Clutter.Orientation orientation) {
@@ -147,6 +167,12 @@ public class Gala.GestureController : Object {
147167
direction_multiplier = -1;
148168
}
149169

170+
if (follow_natural_scroll &&
171+
!GestureSettings.is_natural_scroll_enabled (gesture.performed_on_device_type)
172+
) {
173+
direction_multiplier *= -1;
174+
}
175+
150176
if (snap && !Meta.Prefs.get_gnome_animations ()) {
151177
recognizing = false;
152178
prepare ();

0 commit comments

Comments
 (0)