Skip to content

Commit 01bc618

Browse files
authored
Merge branch 'main' into lenemter/release-8.2.4
2 parents 5948265 + eef0467 commit 01bc618

13 files changed

+231
-76
lines changed

data/gala.metainfo.xml.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@
2727
<update_contact>contact_at_elementary.io</update_contact>
2828

2929
<releases>
30+
<release version="8.2.4" date="2025-06-12" urgency="medium">
31+
<description>
32+
<p>Improvements:</p>
33+
<ul>
34+
<li>Updated translations</li>
35+
</ul>
36+
</description>
37+
<issues>
38+
<issue url="https://github.com/elementary/gala/issues/1264">Applications menu opened but hidden in full screen mode</issue>
39+
<issue url="https://github.com/elementary/gala/issues/2438">Gala randomly segfaults while closing Libreoffice windows</issue>
40+
<issue url="https://github.com/elementary/gala/issues/2450">Apps not being brought to front</issue>
41+
<issue url="https://github.com/elementary/dock/issues/310">Some apps are not showing up in the dock</issue>
42+
</issues>
43+
</release>
44+
3045
<release version="8.2.3" date="2025-05-20" urgency="medium">
3146
<description>
3247
<p>Improvements:</p>

lib/AppSystem.vala

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,64 @@ public class Gala.AppSystem : GLib.Object {
1414
private GLib.HashTable<unowned string, Gala.App> id_to_app;
1515
private GLib.HashTable<string, string> startup_wm_class_to_id;
1616
private Gala.AppCache app_cache;
17+
private string[] all_desktop_files = {};
18+
private GLib.FileMonitor[]? directory_monitors;
1719

1820
construct {
1921
id_to_app = new GLib.HashTable<unowned string, Gala.App> (str_hash, str_equal);
2022
startup_wm_class_to_id = new GLib.HashTable<string, string> (str_hash, str_equal);
2123
running_apps = new GLib.HashTable<Gala.App, unowned Gala.App> (null, null);
2224
app_cache = new AppCache ();
25+
26+
update_desktop_files ();
27+
}
28+
29+
private void update_desktop_files () {
30+
var data_dirs = Environment.get_system_data_dirs ();
31+
data_dirs += Environment.get_user_data_dir ();
32+
33+
var create_monitors = directory_monitors == null;
34+
if (create_monitors) {
35+
directory_monitors = {};
36+
}
37+
38+
foreach (unowned string data_dir in data_dirs) {
39+
var app_dir = Path.build_filename (data_dir, "applications");
40+
if (FileUtils.test (app_dir, FileTest.EXISTS)) {
41+
try {
42+
foreach (var name in enumerate_children (app_dir)) {
43+
if (!name.contains ("~") && name.has_suffix (".desktop")) {
44+
all_desktop_files += name;
45+
}
46+
}
47+
48+
if (!create_monitors) {
49+
continue;
50+
}
51+
52+
var monitor = File.new_for_path (app_dir).monitor (GLib.FileMonitorFlags.NONE, null);
53+
monitor.changed.connect ((file, other_file, event_type) => {
54+
if (event_type == GLib.FileMonitorEvent.CHANGES_DONE_HINT) {
55+
update_desktop_files ();
56+
}
57+
});
58+
directory_monitors += monitor;
59+
} catch (Error e) {
60+
debug ("Error inside %s: %s", app_dir, e.message);
61+
}
62+
}
63+
}
64+
}
65+
66+
private string[] enumerate_children (string dir) throws Error {
67+
string[] result = {};
68+
FileInfo? file_info;
69+
var enumerator = File.new_for_path (dir).enumerate_children (FileAttribute.STANDARD_NAME, 0);
70+
while ((file_info = enumerator.next_file ()) != null) {
71+
result += file_info.get_name ();
72+
}
73+
74+
return result;
2375
}
2476

2577
public unowned Gala.App? lookup_app (string id) {
@@ -105,6 +157,20 @@ public class Gala.AppSystem : GLib.Object {
105157
return lookup_heuristic_basename (desktop_file);
106158
}
107159

160+
public unowned Gala.App? guess_app_by_id (string _id) {
161+
var id = _id.ascii_down ();
162+
unowned Gala.App? result = null;
163+
164+
foreach (var name in all_desktop_files) {
165+
// Try to find desktop file based on the application name
166+
if (name.contains (id) && (result = lookup_app (name)) != null) {
167+
return result;
168+
}
169+
}
170+
171+
return null;
172+
}
173+
108174
public void notify_app_state_changed (Gala.App app) {
109175
if (app.state == Gala.AppState.RUNNING) {
110176
running_apps.insert (app, app);

lib/Drawing/StyleManager.vala

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,16 @@ public class Gala.Drawing.StyleManager : Object {
1818
}
1919

2020
[DBus (name="io.elementary.pantheon.AccountsService")]
21-
private interface AccountsService : DBusProxy {
21+
private interface PantheonAccountsService : DBusProxy {
2222
public abstract int prefers_color_scheme { get; set; }
2323
public abstract int prefers_accent_color { get; set; }
2424
}
2525

26+
[DBus (name="io.elementary.SettingsDaemon.AccountsService")]
27+
private interface SettingsDaemonAccountsService : DBusProxy {
28+
public abstract int accent_color { get; set; }
29+
}
30+
2631
private const string FDO_ACCOUNTS_NAME = "org.freedesktop.Accounts";
2732
private const string FDO_ACCOUNTS_PATH = "/org/freedesktop/Accounts";
2833

@@ -37,10 +42,18 @@ public class Gala.Drawing.StyleManager : Object {
3742
public ColorScheme prefers_color_scheme { get; private set; default = LIGHT; }
3843
public Gdk.RGBA theme_accent_color { get; private set; default = DEFAULT_ACCENT_COLOR; }
3944

40-
private AccountsService? accounts_service_proxy;
45+
private PantheonAccountsService? pantheon_proxy;
46+
private SettingsDaemonAccountsService? settings_daemon_proxy;
4147

4248
construct {
43-
Bus.watch_name (SYSTEM, FDO_ACCOUNTS_NAME, NONE, () => connect_to_accounts_service.begin (), () => accounts_service_proxy = null);
49+
Bus.watch_name (
50+
SYSTEM, FDO_ACCOUNTS_NAME, NONE,
51+
() => connect_to_accounts_service.begin (),
52+
() => {
53+
pantheon_proxy = null;
54+
settings_daemon_proxy = null;
55+
}
56+
);
4457
}
4558

4659
private async void connect_to_accounts_service () {
@@ -49,24 +62,27 @@ public class Gala.Drawing.StyleManager : Object {
4962

5063
var path = yield accounts.find_user_by_name (Environment.get_user_name ());
5164

52-
accounts_service_proxy = yield Bus.get_proxy<AccountsService> (SYSTEM, FDO_ACCOUNTS_NAME, path, GET_INVALIDATED_PROPERTIES);
65+
pantheon_proxy = yield Bus.get_proxy<PantheonAccountsService> (SYSTEM, FDO_ACCOUNTS_NAME, path, GET_INVALIDATED_PROPERTIES);
66+
settings_daemon_proxy = yield Bus.get_proxy<SettingsDaemonAccountsService> (SYSTEM, FDO_ACCOUNTS_NAME, path, GET_INVALIDATED_PROPERTIES);
5367
} catch {
5468
warning ("Could not connect to AccountsService. Default accent color will be used");
5569
return;
5670
}
5771

58-
update_color_scheme (accounts_service_proxy.prefers_color_scheme);
59-
update_color (accounts_service_proxy.prefers_accent_color);
72+
update_color_scheme (pantheon_proxy.prefers_color_scheme);
73+
update_color (settings_daemon_proxy.accent_color);
6074

61-
accounts_service_proxy.g_properties_changed.connect ((changed, invalid) => {
62-
var value = changed.lookup_value ("PrefersAccentColor", new VariantType ("i"));
75+
pantheon_proxy.g_properties_changed.connect ((changed, invalid) => {
76+
var value = changed.lookup_value ("PrefersColorScheme", new VariantType ("i"));
6377
if (value != null) {
64-
update_color (value.get_int32 ());
78+
update_color_scheme (value.get_int32 ());
6579
}
80+
});
6681

67-
value = changed.lookup_value ("PrefersColorScheme", new VariantType ("i"));
82+
settings_daemon_proxy.g_properties_changed.connect ((changed, invalid) => {
83+
var value = changed.lookup_value ("AccentColor", new VariantType ("i"));
6884
if (value != null) {
69-
update_color_scheme (value.get_int32 ());
85+
update_color (value.get_int32 ());
7086
}
7187
});
7288
}

po/es.po

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: gala\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2025-06-09 20:49+0000\n"
11-
"PO-Revision-Date: 2025-05-18 04:55+0000\n"
11+
"PO-Revision-Date: 2025-06-15 15:55+0000\n"
1212
"Last-Translator: Italo Felipe Capasso Ballesteros <[email protected]>\n"
1313
"Language-Team: Spanish <https://l10n.elementaryos.org/projects/desktop/gala/"
1414
"es/>\n"
@@ -295,14 +295,13 @@ msgstr "Captura de pantalla de %s"
295295
#: src/ScreenshotManager.vala:171
296296
#, c-format
297297
msgid "Open in %s"
298-
msgstr ""
298+
msgstr "Abrir en %s"
299299

300300
#. / TRANSLATORS: %s represents a name of file manager
301301
#: src/ScreenshotManager.vala:178
302-
#, fuzzy, c-format
303-
#| msgid "Show in Files"
302+
#, c-format
304303
msgid "Show in %s"
305-
msgstr "Mostar en Archivos"
304+
msgstr "Mostrar en %s"
306305

307306
#: src/ScreenshotManager.vala:189 src/ScreenshotManager.vala:548
308307
msgid "Screenshot taken"

po/hu.po

Lines changed: 5 additions & 6 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-06-09 20:49+0000\n"
11-
"PO-Revision-Date: 2025-04-23 10:55+0000\n"
11+
"PO-Revision-Date: 2025-06-26 09:55+0000\n"
1212
"Last-Translator: TomiOhl <[email protected]>\n"
1313
"Language-Team: Hungarian <https://l10n.elementaryos.org/projects/desktop/"
1414
"gala/hu/>\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.10.4\n"
20+
"X-Generator: Weblate 5.11.4\n"
2121
"X-Launchpad-Export-Date: 2017-02-21 05:47+0000\n"
2222

2323
#: daemon/DBus.vala:84 daemon-gtk3/BackgroundMenu.vala:11
@@ -288,14 +288,13 @@ msgstr "Képernyőkép %s"
288288
#: src/ScreenshotManager.vala:171
289289
#, c-format
290290
msgid "Open in %s"
291-
msgstr ""
291+
msgstr "Megnyitás ebben: %s"
292292

293293
#. / TRANSLATORS: %s represents a name of file manager
294294
#: src/ScreenshotManager.vala:178
295-
#, fuzzy, c-format
296-
#| msgid "Show in Files"
295+
#, c-format
297296
msgid "Show in %s"
298-
msgstr "Megjelenítés a Fájlkezelőben"
297+
msgstr "Megjelenítés itt: %s"
299298

300299
#: src/ScreenshotManager.vala:189 src/ScreenshotManager.vala:548
301300
msgid "Screenshot taken"

src/DesktopIntegration.vala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ public class Gala.DesktopIntegration : GLib.Object {
3737
unowned var display = wm.get_display ();
3838
unowned var workspace_manager = display.get_workspace_manager ();
3939

40-
workspace_manager.active_workspace_changed.connect (() => {
41-
active_workspace_changed ();
42-
windows_changed (); // windows have 'on-active-workspace' property that we need to update
43-
});
40+
workspace_manager.active_workspace_changed.connect (() => active_workspace_changed ());
4441
workspace_manager.workspaces_reordered.connect (() => windows_changed ());
4542
workspace_manager.workspace_added.connect (() => windows_changed ());
4643
workspace_manager.workspace_removed.connect ((index) => {
@@ -99,7 +96,6 @@ public class Gala.DesktopIntegration : GLib.Object {
9996
public Window[] get_windows () throws GLib.DBusError, GLib.IOError {
10097
Window[] returned_windows = {};
10198
var apps = Gala.AppSystem.get_default ().get_running_apps ();
102-
unowned var active_workspace = wm.get_display ().get_workspace_manager ().get_active_workspace ();
10399
foreach (unowned var app in apps) {
104100
foreach (weak Meta.Window window in app.get_windows ()) {
105101
if (!is_eligible_window (window)) {
@@ -116,7 +112,6 @@ public class Gala.DesktopIntegration : GLib.Object {
116112
properties.insert ("client-type", new GLib.Variant.uint32 (window.get_client_type ()));
117113
properties.insert ("is-hidden", new GLib.Variant.boolean (window.is_hidden ()));
118114
properties.insert ("has-focus", new GLib.Variant.boolean (window.has_focus ()));
119-
properties.insert ("on-active-workspace", new GLib.Variant.boolean (window.located_on_workspace (active_workspace)));
120115
properties.insert ("workspace-index", new GLib.Variant.int32 (window.get_workspace ().index ()));
121116
properties.insert ("width", new GLib.Variant.uint32 (frame_rect.width));
122117
properties.insert ("height", new GLib.Variant.uint32 (frame_rect.height));

src/NotificationsManager.vala

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ public class Gala.NotificationsManager : GLib.Object {
1111
[DBus (name = "org.freedesktop.Notifications")]
1212
private interface DBusNotifications : GLib.Object {
1313
public signal void action_invoked (uint32 id, string action_key);
14+
public signal void notification_closed (uint32 id, uint32 reason);
1415

1516
public abstract async uint32 notify (string app_name, uint32 replaces_id, string app_icon, string summary,
1617
string body, string[] actions, HashTable<string, Variant> hints, int32 expire_timeout) throws DBusError, IOError;
1718
}
1819

1920
private const int EXPIRE_TIMEOUT = 2000;
2021

21-
private GLib.SimpleActionGroup action_group = new GLib.SimpleActionGroup ();
22+
public signal void action_invoked (uint32 id, string name, GLib.Variant? target_value);
23+
public signal void notification_closed (uint32 id);
24+
2225
private DBusNotifications? notifications = null;
2326
private GLib.HashTable<string, uint32> replaces_id_table = new GLib.HashTable<string, uint32> (str_hash, str_equal);
2427

@@ -33,6 +36,7 @@ public class Gala.NotificationsManager : GLib.Object {
3336
try {
3437
notifications = ((DBusConnection) obj).get_proxy.end<DBusNotifications> (res);
3538
notifications.action_invoked.connect (handle_action_invoked);
39+
notifications.notification_closed.connect (handle_notification_closed);
3640
} catch (Error e) {
3741
warning ("NotificationsManager: Couldn't connect to notifications server: %s", e.message);
3842
notifications = null;
@@ -57,16 +61,14 @@ public class Gala.NotificationsManager : GLib.Object {
5761
return;
5862
}
5963

60-
if (action_group.has_action (name)) {
61-
action_group.activate_action (name, target_value);
62-
}
64+
action_invoked (id, name, target_value);
6365
}
6466

65-
public void add_action (GLib.Action action) {
66-
action_group.add_action (action);
67+
private void handle_notification_closed (uint32 id, uint32 reason) {
68+
notification_closed (id);
6769
}
6870

69-
public async void send (
71+
public async uint32? send (
7072
string component_name,
7173
string icon,
7274
string summary,
@@ -76,7 +78,7 @@ public class Gala.NotificationsManager : GLib.Object {
7678
) {
7779
if (notifications == null) {
7880
warning ("NotificationsManager: Unable to send notification. No connection to notification server");
79-
return;
81+
return null;
8082
}
8183

8284
uint32? replaces_id = replaces_id_table.get (component_name);
@@ -97,8 +99,11 @@ public class Gala.NotificationsManager : GLib.Object {
9799
);
98100

99101
replaces_id_table.insert (component_name, notification_id);
102+
103+
return notification_id;
100104
} catch (Error e) {
101105
critical ("NotificationsManager: There was an error sending a notification: %s", e.message);
106+
return null;
102107
}
103108
}
104109
}

0 commit comments

Comments
 (0)