Skip to content

Commit aff55ec

Browse files
authored
Merge branch 'main' into lenemter/search-apps-by-pid-more-cleverly
2 parents eea8754 + 5b3b60f commit aff55ec

File tree

360 files changed

+23862
-21615
lines changed

Some content is hidden

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

360 files changed

+23862
-21615
lines changed

daemon/DBus.vala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
public enum Gala.ActionType {
77
NONE = 0,
8-
SHOW_WORKSPACE_VIEW,
8+
SHOW_MULTITASKING_VIEW,
99
MAXIMIZE_CURRENT,
1010
HIDE_CURRENT,
1111
OPEN_LAUNCHER,
@@ -164,6 +164,15 @@ public class Gala.Daemon.DBus : GLib.Object {
164164
}
165165

166166
private void show_menu (Gtk.Popover menu, int display_width, int display_height, int x, int y) {
167+
if (!DisplayConfig.is_logical_layout ()) {
168+
var scale_factor = window.scale_factor;
169+
170+
display_width /= scale_factor;
171+
display_height /= scale_factor;
172+
x /= scale_factor;
173+
y /= scale_factor;
174+
}
175+
167176
window.default_width = display_width;
168177
window.default_height = display_height;
169178
window.present ();

daemon/DisplayConfig.vala

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* Copyright 2024-2025 elementary, Inc. (https://elementary.io)
3+
* SPDX-License-Identifier: GPL-3.0-or-later
4+
*/
5+
6+
[DBus (name = "org.gnome.Mutter.DisplayConfig")]
7+
public interface Gala.Daemon.DisplayConfig : Object {
8+
private static bool? _is_logical_layout = null;
9+
private static DisplayConfig? proxy = null;
10+
11+
public static bool is_logical_layout () {
12+
if (_is_logical_layout == null) {
13+
init ();
14+
}
15+
16+
return _is_logical_layout;
17+
}
18+
19+
private static void init () {
20+
try {
21+
proxy = Bus.get_proxy_sync (BusType.SESSION, "org.gnome.Mutter.DisplayConfig", "/org/gnome/Mutter/DisplayConfig");
22+
proxy.monitors_changed.connect (update);
23+
} catch (Error e) {
24+
critical (e.message);
25+
_is_logical_layout = true;
26+
return;
27+
}
28+
29+
update ();
30+
}
31+
32+
private static void update () {
33+
uint current_serial;
34+
MutterReadMonitor[] mutter_monitors;
35+
MutterReadLogicalMonitor[] mutter_logical_monitors;
36+
GLib.HashTable<string, GLib.Variant> properties;
37+
try {
38+
proxy.get_current_state (out current_serial, out mutter_monitors, out mutter_logical_monitors, out properties);
39+
} catch (Error e) {
40+
critical (e.message);
41+
_is_logical_layout = true;
42+
return;
43+
}
44+
45+
uint layout_mode = 1; // Absence of "layout-mode" means logical (= 1) according to the documentation.
46+
var layout_mode_variant = properties.lookup ("layout-mode");
47+
if (layout_mode_variant != null) {
48+
layout_mode = layout_mode_variant.get_uint32 ();
49+
}
50+
51+
_is_logical_layout = layout_mode == 1;
52+
}
53+
54+
public signal void monitors_changed ();
55+
public abstract void get_current_state (out uint serial, out MutterReadMonitor[] monitors, out MutterReadLogicalMonitor[] logical_monitors, out GLib.HashTable<string, GLib.Variant> properties) throws Error;
56+
}
57+
58+
public struct MutterReadMonitorInfo {
59+
public string connector;
60+
public string vendor;
61+
public string product;
62+
public string serial;
63+
public uint hash {
64+
get {
65+
return (connector + vendor + product + serial).hash ();
66+
}
67+
}
68+
}
69+
70+
public struct MutterReadMonitorMode {
71+
public string id;
72+
public int width;
73+
public int height;
74+
public double frequency;
75+
public double preferred_scale;
76+
public double[] supported_scales;
77+
public GLib.HashTable<string, GLib.Variant> properties;
78+
}
79+
80+
public struct MutterReadMonitor {
81+
public MutterReadMonitorInfo monitor;
82+
public MutterReadMonitorMode[] modes;
83+
public GLib.HashTable<string, GLib.Variant> properties;
84+
}
85+
86+
public struct MutterReadLogicalMonitor {
87+
public int x;
88+
public int y;
89+
public double scale;
90+
public uint transform;
91+
public bool primary;
92+
public MutterReadMonitorInfo[] monitors;
93+
public GLib.HashTable<string, GLib.Variant> properties;
94+
}

daemon/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
gala_daemon_sources = files(
22
'Main.vala',
3+
'DisplayConfig.vala',
34
'DBus.vala',
45
'MonitorLabel.vala',
56
'Window.vala',

data/gala.gschema.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
<value nick="switch-to-workspace-last" value="10" />
1515
</enum>
1616

17+
<enum id="SuperScrollAction">
18+
<value nick="none" value="0" />
19+
<value nick="switch-workspace" value="1" />
20+
<value nick="zoom" value="2" />
21+
</enum>
22+
1723
<schema path="/io/elementary/desktop/screensaver/" id="io.elementary.desktop.screensaver">
1824
<key type="b" name="lock-on-suspend">
1925
<default>true</default>
@@ -96,6 +102,11 @@
96102
<summary>Whether hotcorners should be enabled when fullscreen window is opened</summary>
97103
<description></description>
98104
</key>
105+
<key enum="SuperScrollAction" name="super-scroll-action">
106+
<default>"none"</default>
107+
<summary>What action should be performed on Super + Scroll</summary>
108+
<description></description>
109+
</key>
99110
</schema>
100111

101112
<schema path="/io/elementary/desktop/wm/keybindings/" id="io.elementary.desktop.wm.keybindings">
@@ -194,7 +205,7 @@
194205
<key type="b" name="enable-animations">
195206
<default>true</default>
196207
<summary>Enable Animations</summary>
197-
<description>Whether animations should be displayed. Note: This is a global key, it changes the behaviour of the window manager, the panel etc.</description>
208+
<description>DEPRECATED: This key is deprecated and ignored.</description>
198209
</key>
199210
</schema>
200211

data/gala.metainfo.xml.in

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

2929
<releases>
30+
<release version="8.2.0" date="2025-03-25" urgency="medium">
31+
<description>
32+
<p>Improvements:</p>
33+
<ul>
34+
<li>Updated translations</li>
35+
<li>Window state is now saved on sleep and shutdown</li>
36+
</ul>
37+
</description>
38+
<issues>
39+
<issue url="https://github.com/elementary/gala/issues/137">Send a persistent notification after taking a screenshot</issue>
40+
<issue url="https://github.com/elementary/gala/issues/321">Use org.gnome.desktop.interface enable-animations</issue>
41+
<issue url="https://github.com/elementary/gala/issues/544">Multitasking View. Wingpanel shows for brief moment if a fullscreen wokspace is selected after coming from a wokspace that shows the wingpanel.</issue>
42+
<issue url="https://github.com/elementary/gala/issues/898">Super+Number. When workspace doesn't exist, switch to last workspace instead.</issue>
43+
<issue url="https://github.com/elementary/gala/issues/1202">Touchpad desktop switching gesture is sometimes unresponsive</issue>
44+
<issue url="https://github.com/elementary/gala/issues/1661">Better post-screenshot animation</issue>
45+
<issue url="https://github.com/elementary/gala/issues/2114">Wrong context menu placement</issue>
46+
<issue url="https://github.com/elementary/gala/issues/2199">Swiping in the multitasking view can close applications</issue>
47+
<issue url="https://github.com/elementary/gala/issues/2260">Ghost of window on another workspace appears when cancelling workspace swipe</issue>
48+
<issue url="https://github.com/elementary/gala/issues/2267">Dock crash may crash Gala</issue>
49+
<issue url="https://github.com/elementary/gala/issues/2279">Can't reveal dock when animations are disabled</issue>
50+
</issues>
51+
</release>
52+
53+
<release version="8.1.0" date="2025-01-11" urgency="medium">
54+
<description>
55+
<p>Improvements:</p>
56+
<ul>
57+
<li>Updated translations</li>
58+
<li>Fixed rare crash when a dock window was killed</li>
59+
<li>Added interactive screenshot shortcut</li>
60+
<li>Fixed crash when using tiling shortcuts</li>
61+
</ul>
62+
</description>
63+
<issues>
64+
<issue url="https://github.com/elementary/gala/issues/397">Prevent PIP overlapping wingpanel?</issue>
65+
<issue url="https://github.com/elementary/gala/issues/551">Return to original workspace if a fullscreen window is closed and there is no more windows open</issue>
66+
<issue url="https://github.com/elementary/gala/issues/815">Zoom with Super + Scroll</issue>
67+
<issue url="https://github.com/elementary/gala/issues/857">Toggling the active window's maximization state during multitasking view messes up the window preview size</issue>
68+
<issue url="https://github.com/elementary/gala/issues/1178">Workspace Switching with Keyboard (meta) + Mouse scroll</issue>
69+
<issue url="https://github.com/elementary/gala/issues/1967">Some apps ignore HiDPI mode</issue>
70+
<issue url="https://github.com/elementary/gala/issues/1986">Does not return to the first virtual desktop after exiting fullscreen mode.</issue>
71+
<issue url="https://github.com/elementary/gala/issues/2088">Invisible window clones</issue>
72+
<issue url="https://github.com/elementary/gala/issues/2102">Notifications sometimes result in segfault</issue>
73+
<issue url="https://github.com/elementary/gala/issues/2113">gnome-session-x11-services-ready.target isn't started on Wayland session</issue>
74+
<issue url="https://github.com/elementary/gala/issues/2131">Unthemed cursor style and glitchy menus on some applications</issue>
75+
<issue url="https://github.com/elementary/gala/issues/2154">Windows do not display correctly after moving between workspaces</issue>
76+
<issue url="https://github.com/elementary/gala/issues/2159">Crash when moving windows between workspaces and using gestures to switch</issue>
77+
<issue url="https://github.com/elementary/gala/issues/2169">Text UI based Scaling: Tiny Titlebars in XWayland Apps</issue>
78+
<issue url="https://github.com/elementary/gala/issues/2170">Don’t show app icons in app window spread</issue>
79+
<issue url="https://github.com/elementary/gala/issues/2171">PiP dragging doesn't start until after mouse is released</issue>
80+
<issue url="https://github.com/elementary/gala/issues/2175">Gala crashes when receiving a notification while switching workspaces</issue>
81+
</issues>
82+
</release>
83+
3084
<release version="8.0.4" date="2024-12-02" urgency="medium">
3185
<description>
3286
<p>Improvements:</p>

lib/AnimationsSettings.vala

Lines changed: 0 additions & 32 deletions
This file was deleted.

lib/CloseButton.vala

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ public class Gala.CloseButton : Clutter.Actor {
7979
pixbuf_actor.background_color = { 255, 0, 0, 255 };
8080
}
8181

82-
#if HAS_MUTTER45
8382
public override bool button_press_event (Clutter.Event e) {
84-
#else
85-
public override bool button_press_event (Clutter.ButtonEvent e) {
86-
#endif
8783
var estimated_duration = (uint) (ANIMATION_DURATION * (scale_x - 0.8) / 0.2);
8884

8985
pixbuf_actor.save_easing_state ();
@@ -97,11 +93,7 @@ public class Gala.CloseButton : Clutter.Actor {
9793
return Clutter.EVENT_STOP;
9894
}
9995

100-
#if HAS_MUTTER45
10196
public override bool button_release_event (Clutter.Event e) {
102-
#else
103-
public override bool button_release_event (Clutter.ButtonEvent e) {
104-
#endif
10597
reset_scale ();
10698

10799
if (is_pressed) {
@@ -112,11 +104,7 @@ public class Gala.CloseButton : Clutter.Actor {
112104
return Clutter.EVENT_STOP;
113105
}
114106

115-
#if HAS_MUTTER45
116107
public override bool leave_event (Clutter.Event event) {
117-
#else
118-
public override bool leave_event (Clutter.CrossingEvent event) {
119-
#endif
120108
reset_scale ();
121109
is_pressed = false;
122110

lib/Constants.vala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ namespace Gala {
3535
NUDGE = 360,
3636
}
3737

38+
public enum GestureAction {
39+
NONE,
40+
SWITCH_WORKSPACE,
41+
SWITCH_WINDOWS,
42+
MULTITASKING_VIEW,
43+
DOCK,
44+
ZOOM,
45+
CLOSE_WINDOW,
46+
N_ACTIONS
47+
}
48+
3849
/**
3950
* Used as a key for Object.set_data<bool> on Meta.Windows that should be
4051
* treated as notifications. Has to be set before the window is mapped.

lib/DragDropAction.vala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ namespace Gala {
7474
*
7575
* @param button The button which was pressed
7676
*/
77-
public signal void actor_clicked (uint32 button);
77+
public signal void actor_clicked (uint32 button, Clutter.InputDeviceType device_type);
7878

7979
/**
8080
* The type of the action
@@ -290,7 +290,10 @@ namespace Gala {
290290

291291
// release has happened within bounds of actor
292292
if (clicked && x < ex && x + actor.width > ex && y < ey && y + actor.height > ey) {
293-
actor_clicked (event.get_type () == BUTTON_RELEASE ? event.get_button () : Clutter.Button.PRIMARY);
293+
actor_clicked (
294+
event.get_type () == BUTTON_RELEASE ? event.get_button () : Clutter.Button.PRIMARY,
295+
event.get_source_device ().get_device_type ()
296+
);
294297
}
295298

296299
if (clicked) {

lib/Drawing/Canvas.vala

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,33 @@ public class Gala.Drawing.Canvas : GLib.Object, Clutter.Content {
99
private int height = -1;
1010
private float scale_factor = 1.0f;
1111

12+
private Cogl.Context? cogl_context;
13+
1214
private Cogl.Texture? texture = null;
1315
private Cogl.Bitmap? bitmap = null;
1416

1517
private bool dirty = false;
1618

1719
public signal void draw (Cairo.Context cr, int width, int height);
1820

19-
private void emit_draw () requires (width > 0 && height > 0) {
21+
public override void attached (Clutter.Actor actor) {
22+
#if HAS_MUTTER47
23+
cogl_context = actor.context.get_backend ().get_cogl_context ();
24+
#else
25+
cogl_context = Clutter.get_default_backend ().get_cogl_context ();
26+
#endif
27+
}
28+
29+
public override void detached (Clutter.Actor actor) {
30+
cogl_context = null;
31+
}
32+
33+
private void emit_draw () requires (width > 0 && height > 0 && cogl_context != null) {
2034
dirty = true;
2135
int real_width = (int) Math.ceilf (width * scale_factor);
2236
int real_height = (int) Math.ceilf (height * scale_factor);
2337
if (bitmap == null) {
24-
unowned Cogl.Context ctx = Clutter.get_default_backend ().get_cogl_context ();
25-
bitmap = new Cogl.Bitmap.with_size (ctx, real_width, real_height, Cogl.PixelFormat.CAIRO_ARGB32_COMPAT);
38+
bitmap = new Cogl.Bitmap.with_size (cogl_context, real_width, real_height, Cogl.PixelFormat.CAIRO_ARGB32_COMPAT);
2639
}
2740

2841
unowned Cogl.Buffer? buffer = bitmap.get_buffer ();

0 commit comments

Comments
 (0)