Skip to content

Commit 9cb861e

Browse files
committed
Merge branch 'leneemter/sort-windows' of https://github.com/elementary/gala into leneemter/sort-windows
2 parents 3a2317b + a355282 commit 9cb861e

File tree

10 files changed

+106
-54
lines changed

10 files changed

+106
-54
lines changed

po/en_GB.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: beat-box\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2025-02-10 20:55+0000\n"
11-
"PO-Revision-Date: 2024-12-19 16:04+0000\n"
11+
"PO-Revision-Date: 2025-02-16 03:16+0000\n"
1212
"Last-Translator: David Hewitt <[email protected]>\n"
1313
"Language-Team: English (United Kingdom) <https://l10n.elementary.io/projects/"
1414
"desktop/gala/en_GB/>\n"
@@ -17,7 +17,7 @@ msgstr ""
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=2; plural=n != 1;\n"
20-
"X-Generator: Weblate 5.8.4\n"
20+
"X-Generator: Weblate 5.9.2\n"
2121
"X-Launchpad-Export-Date: 2017-03-14 07:02+0000\n"
2222

2323
#: daemon/DBus.vala:82 daemon-gtk3/BackgroundMenu.vala:11
@@ -292,11 +292,11 @@ msgstr "Screenshot from %s"
292292

293293
#: src/WindowManager.vala:2375
294294
msgid "Screenshot is saved to clipboard"
295-
msgstr ""
295+
msgstr "Screenshot is saved to clipboard"
296296

297297
#: src/WindowManager.vala:2375
298298
msgid "Screenshot saved to screenshots folder"
299-
msgstr ""
299+
msgstr "Screenshot saved to screenshots folder"
300300

301301
#~ msgid ""
302302
#~ "Set the keyboard layout correctly at startup so that the indicator "

po/fr.po

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ msgstr ""
88
"Project-Id-Version: gala\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2025-02-10 20:55+0000\n"
11-
"PO-Revision-Date: 2025-02-07 15:16+0000\n"
11+
"PO-Revision-Date: 2025-02-13 10:16+0000\n"
1212
"Last-Translator: Nathan <[email protected]>\n"
13-
"Language-Team: French <https://l10n.elementary.io/projects/desktop/gala/fr/"
14-
">\n"
13+
"Language-Team: French <https://l10n.elementary.io/projects/desktop/gala/fr/>"
14+
"\n"
1515
"Language: fr\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
@@ -308,11 +308,11 @@ msgstr "Captures d'écran de %s"
308308

309309
#: src/WindowManager.vala:2375
310310
msgid "Screenshot is saved to clipboard"
311-
msgstr ""
311+
msgstr "Capture d'écran enregistrée dans le presse-papier"
312312

313313
#: src/WindowManager.vala:2375
314314
msgid "Screenshot saved to screenshots folder"
315-
msgstr ""
315+
msgstr "Capture d'écran enregistrée dans le dossier des captures d'écran"
316316

317317
#~ msgid ""
318318
#~ "Set the keyboard layout correctly at startup so that the indicator "

po/hu.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: noise\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2025-02-10 20:55+0000\n"
11-
"PO-Revision-Date: 2025-01-16 17:55+0000\n"
11+
"PO-Revision-Date: 2025-02-21 19:16+0000\n"
1212
"Last-Translator: TomiOhl <[email protected]>\n"
1313
"Language-Team: Hungarian <https://l10n.elementary.io/projects/desktop/gala/"
1414
"hu/>\n"
@@ -301,11 +301,11 @@ msgstr "Képernyőkép %s"
301301

302302
#: src/WindowManager.vala:2375
303303
msgid "Screenshot is saved to clipboard"
304-
msgstr ""
304+
msgstr "Képernyőkép mentve a vágólapra"
305305

306306
#: src/WindowManager.vala:2375
307307
msgid "Screenshot saved to screenshots folder"
308-
msgstr ""
308+
msgstr "Képernyőkép mentve a Képernyőképek mappába"
309309

310310
#~ msgid ""
311311
#~ "Set the keyboard layout correctly at startup so that the indicator "

po/nl.po

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ msgstr ""
88
"Project-Id-Version: gala\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2025-02-10 20:55+0000\n"
11-
"PO-Revision-Date: 2024-12-19 16:04+0000\n"
11+
"PO-Revision-Date: 2025-02-16 03:16+0000\n"
1212
"Last-Translator: DutchVipperloid <[email protected]>\n"
1313
"Language-Team: Dutch <https://l10n.elementary.io/projects/desktop/gala/nl/>\n"
1414
"Language: nl\n"
1515
"MIME-Version: 1.0\n"
1616
"Content-Type: text/plain; charset=UTF-8\n"
1717
"Content-Transfer-Encoding: 8bit\n"
1818
"Plural-Forms: nplurals=2; plural=n != 1;\n"
19-
"X-Generator: Weblate 5.8.4\n"
19+
"X-Generator: Weblate 5.9.2\n"
2020
"X-Launchpad-Export-Date: 2017-02-21 05:47+0000\n"
2121

2222
#: daemon/DBus.vala:82 daemon-gtk3/BackgroundMenu.vala:11
@@ -229,7 +229,7 @@ msgstr ""
229229

230230
#: src/Dialogs/CloseDialog.vala:29
231231
msgid "Force Quit"
232-
msgstr "Afsluiten forceren"
232+
msgstr "Geforceerd afsluiten"
233233

234234
#: src/Dialogs/CloseDialog.vala:30
235235
msgid "Wait"
@@ -299,11 +299,11 @@ msgstr "Schermafbeelding van %s"
299299

300300
#: src/WindowManager.vala:2375
301301
msgid "Screenshot is saved to clipboard"
302-
msgstr ""
302+
msgstr "Schermafdruk is opgeslagen op het klembord"
303303

304304
#: src/WindowManager.vala:2375
305305
msgid "Screenshot saved to screenshots folder"
306-
msgstr ""
306+
msgstr "Schermafdruk is opgeslagen naar de schermafbeeldingen-map"
307307

308308
#, fuzzy
309309
#~| msgid "Enable rounded corner mask"

po/uk.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: beat-box\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2025-02-10 20:55+0000\n"
11-
"PO-Revision-Date: 2024-12-24 00:16+0000\n"
11+
"PO-Revision-Date: 2025-02-14 00:32+0000\n"
1212
"Last-Translator: Ihor Hordiichuk <[email protected]>\n"
1313
"Language-Team: Ukrainian <https://l10n.elementary.io/projects/desktop/gala/"
1414
"uk/>\n"
@@ -18,7 +18,7 @@ msgstr ""
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
2020
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
21-
"X-Generator: Weblate 5.8.4\n"
21+
"X-Generator: Weblate 5.9.2\n"
2222
"X-Launchpad-Export-Date: 2017-02-21 05:47+0000\n"
2323

2424
#: daemon/DBus.vala:82 daemon-gtk3/BackgroundMenu.vala:11
@@ -300,11 +300,11 @@ msgstr "Знімок екрана від %s"
300300

301301
#: src/WindowManager.vala:2375
302302
msgid "Screenshot is saved to clipboard"
303-
msgstr ""
303+
msgstr "Знімок екрана збережено до буфера обміну"
304304

305305
#: src/WindowManager.vala:2375
306306
msgid "Screenshot saved to screenshots folder"
307-
msgstr ""
307+
msgstr "Знімок екрана збережено до теки знімків екрана"
308308

309309
#~ msgid ""
310310
#~ "Set the keyboard layout correctly at startup so that the indicator "

src/DesktopIntegration.vala

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 elementary, Inc. <https://elementary.io>
2+
* Copyright 2022-2025 elementary, Inc. <https://elementary.io>
33
* Copyright 2022 Corentin Noël <[email protected]>
44
* SPDX-License-Identifier: GPL-3.0-or-later
55
*/
@@ -21,7 +21,6 @@ public class Gala.DesktopIntegration : GLib.Object {
2121
public signal void windows_changed ();
2222
public signal void active_workspace_changed ();
2323
public signal void workspace_removed (int index);
24-
2524
private unowned WindowManagerGala wm;
2625
private GLib.HashTable<Meta.Window, int64?> time_appeared_on_workspace;
2726

@@ -30,6 +29,9 @@ public class Gala.DesktopIntegration : GLib.Object {
3029
time_appeared_on_workspace = new GLib.HashTable<Meta.Window, int64?> (GLib.direct_hash, GLib.direct_equal);
3130

3231
wm.window_tracker.windows_changed.connect (() => windows_changed ());
32+
33+
unowned var display = wm.get_display ();
34+
unowned var workspace_manager = display.get_workspace_manager ();
3335
workspace_manager.active_workspace_changed.connect (() => {
3436
active_workspace_changed ();
3537
windows_changed (); // windows have 'on-active-workspace' property that we need to update
@@ -53,6 +55,8 @@ public class Gala.DesktopIntegration : GLib.Object {
5355
window.unmanaging.connect ((_window) => {
5456
time_appeared_on_workspace.remove (_window);
5557
});
58+
59+
window.workspace_changed.connect (() => windows_changed ());
5660
});
5761
}
5862

@@ -91,7 +95,7 @@ public class Gala.DesktopIntegration : GLib.Object {
9195
public Window[] get_windows () throws GLib.DBusError, GLib.IOError {
9296
Window[] returned_windows = {};
9397
var apps = Gala.AppSystem.get_default ().get_running_apps ();
94-
var active_workspace = wm.get_display ().get_workspace_manager ().get_active_workspace ();
98+
unowned var active_workspace = wm.get_display ().get_workspace_manager ().get_active_workspace ();
9599
foreach (unowned var app in apps) {
96100
foreach (weak Meta.Window window in app.get_windows ()) {
97101
if (!is_eligible_window (window)) {
@@ -109,6 +113,7 @@ public class Gala.DesktopIntegration : GLib.Object {
109113
properties.insert ("is-hidden", new GLib.Variant.boolean (window.is_hidden ()));
110114
properties.insert ("has-focus", new GLib.Variant.boolean (window.has_focus ()));
111115
properties.insert ("on-active-workspace", new GLib.Variant.boolean (window.located_on_workspace (active_workspace)));
116+
properties.insert ("workspace-index", new GLib.Variant.int32 (window.get_workspace ().index ()));
112117
properties.insert ("width", new GLib.Variant.uint32 (frame_rect.width));
113118
properties.insert ("height", new GLib.Variant.uint32 (frame_rect.height));
114119

@@ -154,6 +159,29 @@ public class Gala.DesktopIntegration : GLib.Object {
154159
}
155160
}
156161

162+
public void activate_workspace (int index) throws GLib.DBusError, GLib.IOError {
163+
unowned var workspace = wm.get_display ().get_workspace_manager ().get_workspace_by_index (index);
164+
if (workspace == null) {
165+
throw new IOError.NOT_FOUND ("Workspace not found");
166+
}
167+
168+
unowned var display = wm.get_display ();
169+
unowned var active_workspace_index = display.get_workspace_manager ().get_active_workspace_index ();
170+
if (active_workspace_index == index) {
171+
InternalUtils.bell_notify (display);
172+
} else {
173+
workspace.activate (display.get_current_time ());
174+
}
175+
}
176+
177+
public int get_n_workspaces () throws GLib.DBusError, GLib.IOError {
178+
return wm.get_display ().get_workspace_manager ().n_workspaces;
179+
}
180+
181+
public int get_active_workspace () throws GLib.DBusError, GLib.IOError {
182+
return wm.get_display ().get_workspace_manager ().get_active_workspace_index ();
183+
}
184+
157185
private bool notifying = false;
158186
private void notify_already_focused (Meta.Window window) {
159187
if (notifying) {

src/Gestures/ToucheggBackend.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,19 @@ public class Gala.ToucheggBackend : Object, GestureBackend {
200200
on_gesture_detected (make_gesture (type, direction, fingers, performed_on_device_type), Meta.CURRENT_TIME);
201201
on_begin (delta, elapsed_time);
202202
return false;
203-
});
203+
}, Priority.DEFAULT);
204204
break;
205205
case DBUS_ON_GESTURE_UPDATE:
206206
Idle.add (() => {
207207
on_update (delta, elapsed_time);
208208
return false;
209-
});
209+
}, Priority.DEFAULT);
210210
break;
211211
case DBUS_ON_GESTURE_END:
212212
Idle.add (() => {
213213
on_end (delta, elapsed_time);
214214
return false;
215-
});
215+
}, Priority.DEFAULT);
216216
break;
217217
default:
218218
break;

src/ShellClients/HideTracker.vala

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,15 @@ public class Gala.HideTracker : Object {
3737
Object (display: display, panel: panel);
3838
}
3939

40-
~HideTracker () {
41-
if (hide_timeout_id != 0) {
42-
Source.remove (hide_timeout_id);
43-
}
44-
45-
if (update_timeout_id != 0) {
46-
Source.remove (update_timeout_id);
47-
}
48-
}
49-
5040
construct {
41+
panel.window.unmanaging.connect_after (() => {
42+
// The timeouts hold refs on us so we stay connected to signal handlers that might
43+
// access the panel which was already freed. To prevent that make sure we reset
44+
// the timeouts so that we get freed immediately
45+
reset_hide_timeout ();
46+
reset_update_timeout ();
47+
});
48+
5149
// Can't be local otherwise we get a memory leak :(
5250
// See https://gitlab.gnome.org/GNOME/vala/-/issues/1548
5351
current_focus_window = display.focus_window;
@@ -152,6 +150,13 @@ public class Gala.HideTracker : Object {
152150
});
153151
}
154152

153+
private void reset_update_timeout () {
154+
if (update_timeout_id != 0) {
155+
Source.remove (update_timeout_id);
156+
update_timeout_id = 0;
157+
}
158+
}
159+
155160
public void update_overlap () {
156161
overlap = false;
157162
focus_overlap = false;

src/ShellClients/NotificationsClient.vala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class Gala.NotificationsClient : Object {
2020
client.window_created.connect ((window) => {
2121
window.set_data (NOTIFICATION_DATA_KEY, true);
2222
window.make_above ();
23+
window.stick ();
2324
#if HAS_MUTTER46
2425
client.wayland_client.make_dock (window);
2526
#endif

0 commit comments

Comments
 (0)