Skip to content

Commit 9235542

Browse files
authored
Merge branch 'main' into lenemter/drop-support-for-static-workspaces
2 parents e23df2d + a567d0c commit 9235542

File tree

3 files changed

+54
-11
lines changed

3 files changed

+54
-11
lines changed

po/ja.po

Lines changed: 5 additions & 5 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: 2024-12-22 20:56+0000\n"
11+
"PO-Revision-Date: 2025-03-01 16:01+0000\n"
1212
"Last-Translator: Ryo Nakano <[email protected]>\n"
1313
"Language-Team: Japanese <https://l10n.elementary.io/projects/desktop/gala/ja/"
1414
">\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=1; plural=0;\n"
20-
"X-Generator: Weblate 5.8.4\n"
20+
"X-Generator: Weblate 5.9.2\n"
2121
"X-Launchpad-Export-Date: 2017-03-02 05:47+0000\n"
2222

2323
#: daemon/DBus.vala:82 daemon-gtk3/BackgroundMenu.vala:11
@@ -193,7 +193,7 @@ msgstr "すべての開いているウィンドウとワークスペースを参
193193

194194
#: data/gala-other.desktop.in:4
195195
msgid "Other"
196-
msgstr "そのほか"
196+
msgstr "その他"
197197

198198
#: data/gala-other.desktop.in:5
199199
msgid "Fallback desktop file for notifications from outdated applications."
@@ -291,11 +291,11 @@ msgstr "スクリーンショット %s"
291291

292292
#: src/WindowManager.vala:2375
293293
msgid "Screenshot is saved to clipboard"
294-
msgstr ""
294+
msgstr "スクリーンショットをクリップボードに保存しました"
295295

296296
#: src/WindowManager.vala:2375
297297
msgid "Screenshot saved to screenshots folder"
298-
msgstr ""
298+
msgstr "スクリーンショットを“スクリーンショット”フォルダーに保存しました"
299299

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

src/DesktopIntegration.vala

Lines changed: 46 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
*/
@@ -20,11 +20,30 @@ public class Gala.DesktopIntegration : GLib.Object {
2020
public uint version { get; default = 1; }
2121
public signal void running_applications_changed ();
2222
public signal void windows_changed ();
23+
public signal void active_workspace_changed ();
24+
public signal void workspace_removed (int index);
2325

2426
public DesktopIntegration (WindowManagerGala wm) {
2527
this.wm = wm;
2628
wm.window_tracker.windows_changed.connect (() => windows_changed ());
27-
wm.get_display ().get_workspace_manager ().active_workspace_changed.connect (() => windows_changed ());
29+
30+
unowned var display = wm.get_display ();
31+
unowned var workspace_manager = display.get_workspace_manager ();
32+
workspace_manager.active_workspace_changed.connect (() => {
33+
active_workspace_changed ();
34+
windows_changed (); // windows have 'on-active-workspace' property that we need to update
35+
});
36+
workspace_manager.workspaces_reordered.connect (() => windows_changed ());
37+
workspace_manager.workspace_added.connect (() => windows_changed ());
38+
workspace_manager.workspace_removed.connect ((index) => {
39+
workspace_removed (index);
40+
windows_changed ();
41+
});
42+
43+
// TODO: figure out if there's a better way to handle ws rearrangement
44+
display.window_created.connect ((window) => {
45+
window.workspace_changed.connect (() => windows_changed ());
46+
});
2847
}
2948

3049
public RunningApplication[] get_running_applications () throws GLib.DBusError, GLib.IOError {
@@ -63,7 +82,7 @@ public class Gala.DesktopIntegration : GLib.Object {
6382
public Window[] get_windows () throws GLib.DBusError, GLib.IOError {
6483
Window[] returned_windows = {};
6584
var apps = Gala.AppSystem.get_default ().get_running_apps ();
66-
var active_workspace = wm.get_display ().get_workspace_manager ().get_active_workspace ();
85+
unowned var active_workspace = wm.get_display ().get_workspace_manager ().get_active_workspace ();
6786
foreach (unowned var app in apps) {
6887
foreach (weak Meta.Window window in app.get_windows ()) {
6988
if (!is_eligible_window (window)) {
@@ -81,6 +100,7 @@ public class Gala.DesktopIntegration : GLib.Object {
81100
properties.insert ("is-hidden", new GLib.Variant.boolean (window.is_hidden ()));
82101
properties.insert ("has-focus", new GLib.Variant.boolean (window.has_focus ()));
83102
properties.insert ("on-active-workspace", new GLib.Variant.boolean (window.located_on_workspace (active_workspace)));
103+
properties.insert ("workspace-index", new GLib.Variant.int32 (window.get_workspace ().index ()));
84104
properties.insert ("width", new GLib.Variant.uint32 (frame_rect.width));
85105
properties.insert ("height", new GLib.Variant.uint32 (frame_rect.height));
86106

@@ -122,6 +142,29 @@ public class Gala.DesktopIntegration : GLib.Object {
122142
}
123143
}
124144

145+
public void activate_workspace (int index) throws GLib.DBusError, GLib.IOError {
146+
unowned var workspace = wm.get_display ().get_workspace_manager ().get_workspace_by_index (index);
147+
if (workspace == null) {
148+
throw new IOError.NOT_FOUND ("Workspace not found");
149+
}
150+
151+
unowned var display = wm.get_display ();
152+
unowned var active_workspace_index = display.get_workspace_manager ().get_active_workspace_index ();
153+
if (active_workspace_index == index) {
154+
InternalUtils.bell_notify (display);
155+
} else {
156+
workspace.activate (display.get_current_time ());
157+
}
158+
}
159+
160+
public int get_n_workspaces () throws GLib.DBusError, GLib.IOError {
161+
return wm.get_display ().get_workspace_manager ().n_workspaces;
162+
}
163+
164+
public int get_active_workspace () throws GLib.DBusError, GLib.IOError {
165+
return wm.get_display ().get_workspace_manager ().get_active_workspace_index ();
166+
}
167+
125168
private bool notifying = false;
126169
private void notify_already_focused (Meta.Window window) {
127170
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;

0 commit comments

Comments
 (0)