Skip to content

Commit 0bdf0b4

Browse files
Merge branch 'main' into lenemter/guess-app
2 parents 5bce18c + 5d7775c commit 0bdf0b4

File tree

3 files changed

+43
-12
lines changed

3 files changed

+43
-12
lines changed

data/gala.metainfo.xml.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@
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/2438">Gala randomly segfaults while closing Libreoffice windows</issue>
39+
</issues>
40+
</release>
41+
3042
<release version="8.2.3" date="2025-05-20" urgency="medium">
3143
<description>
3244
<p>Improvements:</p>

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
}

src/WindowStateSaver.vala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ public class Gala.WindowStateSaver : GLib.Object {
147147
var app_id = GLib.Markup.escape_text (window_tracker.get_app_for_window (window).id);
148148

149149
var window_index = find_window_index (window, app_id);
150-
app_windows[app_id].remove_index (window_index);
150+
if (window_index < app_windows[app_id].length) {
151+
app_windows[app_id].remove_index (window_index);
152+
}
153+
151154
var value = null; // insert_val requires lvalue
152155
app_windows[app_id].insert_val (window_index, value);
153156

0 commit comments

Comments
 (0)