Skip to content

Commit 53a27d7

Browse files
Merge branch 'main' into lenemter/optimize-active-workspace
2 parents 76479c4 + 5d7775c commit 53a27d7

File tree

266 files changed

+12560
-10673
lines changed

Some content is hidden

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

266 files changed

+12560
-10673
lines changed

daemon-gtk3/Window.vala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
*/
77

88
public class Gala.Daemon.Window : Gtk.Window {
9+
public int width { get; construct; }
10+
public int height { get; construct; }
911
public Gtk.Box content { get; construct; }
1012

1113
public Window (int width, int height) {
12-
Object (
13-
default_width: width,
14-
default_height: height
15-
);
14+
Object (width: width, height: height);
1615
}
1716

1817
class construct {
@@ -34,7 +33,9 @@ public class Gala.Daemon.Window : Gtk.Window {
3433
title = "MODAL";
3534
child = content = new Gtk.Box (HORIZONTAL, 0) {
3635
hexpand = true,
37-
vexpand = true
36+
vexpand = true,
37+
width_request = width,
38+
height_request = height
3839
};
3940

4041
set_visual (get_screen ().get_rgba_visual ());

daemon-gtk3/WindowMenu.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ public class Gala.Daemon.WindowMenu : Gtk.Menu {
174174
SignalHandler.unblock (always_on_top, always_on_top_sid);
175175
SignalHandler.unblock (on_visible_workspace, on_visible_workspace_sid);
176176

177-
move_right.sensitive = !on_visible_workspace.active;
177+
move_right.sensitive = !on_visible_workspace.active && Gala.WindowFlags.ALLOWS_MOVE_RIGHT in flags;
178178
if (move_right.sensitive) {
179179
move_right_accellabel.accel_string = keybind_settings.get_strv ("move-to-workspace-right")[0];
180180
}
181181

182-
move_left.sensitive = !on_visible_workspace.active;
182+
move_left.sensitive = !on_visible_workspace.active && Gala.WindowFlags.ALLOWS_MOVE_LEFT in flags;
183183
if (move_left.sensitive) {
184184
move_left_accellabel.accel_string = keybind_settings.get_strv ("move-to-workspace-left")[0];
185185
}

daemon/DBus.vala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ public enum Gala.WindowFlags {
3636
ALWAYS_ON_TOP,
3737
ON_ALL_WORKSPACES,
3838
CAN_CLOSE,
39-
IS_TILED
39+
IS_TILED,
40+
ALLOWS_MOVE_LEFT,
41+
ALLOWS_MOVE_RIGHT
4042
}
4143

4244
[DBus (name = "org.pantheon.gala")]
@@ -173,8 +175,8 @@ public class Gala.Daemon.DBus : GLib.Object {
173175
y /= scale_factor;
174176
}
175177

176-
window.default_width = display_width;
177-
window.default_height = display_height;
178+
window.child.width_request = display_width;
179+
window.child.height_request = display_height;
178180
window.present ();
179181

180182
Gdk.Rectangle rect = {

daemon/WindowMenu.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,12 @@ public class Gala.Daemon.WindowMenu : Gtk.Popover {
200200
SignalHandler.unblock (always_on_top, always_on_top_sid);
201201
SignalHandler.unblock (on_visible_workspace, on_visible_workspace_sid);
202202

203-
move_right.sensitive = !on_visible_workspace.active;
203+
move_right.sensitive = !on_visible_workspace.active && Gala.WindowFlags.ALLOWS_MOVE_RIGHT in flags;
204204
if (move_right.sensitive) {
205205
move_right_accellabel.accel_string = keybind_settings.get_strv ("move-to-workspace-right")[0];
206206
}
207207

208-
move_left.sensitive = !on_visible_workspace.active;
208+
move_left.sensitive = !on_visible_workspace.active && Gala.WindowFlags.ALLOWS_MOVE_LEFT in flags;
209209
if (move_left.sensitive) {
210210
move_left_accellabel.accel_string = keybind_settings.get_strv ("move-to-workspace-left")[0];
211211
}

data/gala.metainfo.xml.in

Lines changed: 26 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>
@@ -35,7 +47,21 @@
3547
</ul>
3648
</description>
3749
<issues>
50+
<issue url="https://github.com/elementary/dock/issues/68">Cannot move window to display below dock.</issue>
51+
<issue url="https://github.com/elementary/dock/issues/425">Improper dock behaviour when it hides on vertically stacked monitors</issue>
52+
<issue url="https://github.com/elementary/gala/issues/76">PIP: Grabbing an area too close to a Gtk3 window only grabs it's shadow</issue>
53+
<issue url="https://github.com/elementary/gala/issues/132">Closing last window in the window overview doesn't close it</issue>
54+
<issue url="https://github.com/elementary/gala/issues/340">"Move to left workspace" is a no-op on left-most workspace</issue>
55+
<issue url="https://github.com/elementary/gala/issues/2060">Gala.ShadowEffect has performance issues</issue>
56+
<issue url="https://github.com/elementary/gala/issues/2424">Mouse pointer often stuck between displays when external display is the primary display and is arranged above built-in display</issue>
57+
<issue url="https://github.com/elementary/gala/issues/2230">Multitasking view background clipped when using multiple monitors above each other</issue>
58+
<issue url="https://github.com/elementary/gala/issues/2263">Prevent windows from breaking workflow</issue>
3859
<issue url="https://github.com/elementary/gala/issues/2400">Switching workspaces makes the windows move down with multiple monitors</issue>
60+
<issue url="https://github.com/elementary/gala/issues/2401">Context menus appear at the top left corner of the secondary monitor</issue>
61+
<issue url="https://github.com/elementary/gala/issues/2409">Windows sometimes get stuck in an un-interactive state after using gestures to switch workspaces</issue>
62+
<issue url="https://github.com/elementary/gala/issues/2410">Window position not restored correctly when going back from fullscreen</issue>
63+
<issue url="https://github.com/elementary/gala/issues/2414">During workspace switch, windows on secondary display aren't shown</issue>
64+
<issue url="https://github.com/elementary/gala/issues/2415">Wrong animation origin for windows on display 2 on workspace overview</issue>
3965
</issues>
4066
</release>
4167

lib/CloseButton.vala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ public class Gala.CloseButton : Clutter.Actor {
3333
var pixbuf = get_close_button_pixbuf (scale);
3434
if (pixbuf != null) {
3535
try {
36-
var image = new Clutter.Image ();
37-
Cogl.PixelFormat pixel_format = (pixbuf.get_has_alpha () ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888);
38-
image.set_data (pixbuf.get_pixels (), pixel_format, pixbuf.width, pixbuf.height, pixbuf.rowstride);
39-
36+
var image = new Gala.Image.from_pixbuf (pixbuf);
4037
pixbuf_actor.set_content (image);
4138
pixbuf_actor.set_size (pixbuf.width, pixbuf.height);
4239
set_size (pixbuf.width, pixbuf.height);

lib/DragDropAction.vala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,11 @@ namespace Gala {
313313
event.get_coords (out x, out y);
314314

315315
if (!dragging && clicked) {
316+
#if HAS_MUTTER47
317+
var drag_threshold = actor.context.get_settings ().dnd_drag_threshold;
318+
#else
316319
var drag_threshold = Clutter.Settings.get_default ().dnd_drag_threshold;
320+
#endif
317321
if (Math.fabsf (last_x - x) > drag_threshold || Math.fabsf (last_y - y) > drag_threshold) {
318322
handle = drag_begin (last_x, last_y);
319323
if (handle == null) {

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
}

lib/Image.vala

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* Copyright 2015 Corentin Noël
3+
* Copyright 2025 elementary, Inc. <https://elementary.io>
4+
* SPDX-License-Identifier: GPL-3.0-or-later
5+
*/
6+
7+
#if !HAS_MUTTER48
8+
public class Gala.Image : Clutter.Image {
9+
public Image.from_pixbuf (Gdk.Pixbuf pixbuf) {
10+
Object ();
11+
12+
Cogl.PixelFormat pixel_format = (pixbuf.get_has_alpha () ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888);
13+
try {
14+
set_data (pixbuf.get_pixels (), pixel_format, pixbuf.width, pixbuf.height, pixbuf.rowstride);
15+
} catch (Error e) {}
16+
}
17+
}
18+
#else
19+
public class Gala.Image : GLib.Object, Clutter.Content {
20+
Gdk.Pixbuf? pixbuf;
21+
Cogl.Texture? texture;
22+
uint width;
23+
uint height;
24+
25+
public Image.from_pixbuf (Gdk.Pixbuf pixbuf) {
26+
this.pixbuf = pixbuf;
27+
width = pixbuf.width;
28+
height = pixbuf.height;
29+
invalidate ();
30+
}
31+
32+
public bool get_preferred_size (out float width, out float height) {
33+
if (texture == null) {
34+
width = 0;
35+
height = 0;
36+
return false;
37+
}
38+
39+
width = texture.get_width ();
40+
height = texture.get_height ();
41+
return true;
42+
}
43+
44+
public void paint_content (Clutter.Actor actor, Clutter.PaintNode node, Clutter.PaintContext paint_context) {
45+
if (pixbuf != null && texture == null) {
46+
var cogl_context = actor.context.get_backend ().get_cogl_context ();
47+
Cogl.PixelFormat pixel_format = (pixbuf.get_has_alpha () ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888);
48+
try {
49+
texture = new Cogl.Texture2D.from_data (cogl_context, pixbuf.width, pixbuf.height, pixel_format, pixbuf.rowstride, pixbuf.get_pixels ());
50+
if (width != texture.get_width () || height != texture.get_height ()) {
51+
width = texture.get_width ();
52+
height = texture.get_height ();
53+
invalidate_size ();
54+
}
55+
} catch (Error e) {
56+
critical (e.message);
57+
}
58+
}
59+
60+
if (texture == null)
61+
return;
62+
63+
var content_node = actor.create_texture_paint_node (texture);
64+
content_node.set_static_name ("Image Content");
65+
node.add_child (content_node);
66+
}
67+
68+
public void invalidate () {
69+
texture = null;
70+
}
71+
72+
public void invalidate_size () {
73+
}
74+
}
75+
#endif

0 commit comments

Comments
 (0)