Skip to content

Commit f1cd80e

Browse files
authored
Merge branch 'main' into lenemter/remove-show-desktop
2 parents 068a91d + 5007257 commit f1cd80e

File tree

243 files changed

+11296
-8330
lines changed

Some content is hidden

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

243 files changed

+11296
-8330
lines changed

daemon/DBus.vala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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.metainfo.xml.in

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,37 @@
2727
<update_contact>contact_at_elementary.io</update_contact>
2828

2929
<releases>
30-
<release version="8.1.0" date="2025-01-11" urgency="medium">
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+
<li>Remove scaling effect from menus</li>
37+
<li>Swipe up to close windows in Multitasking View</li>
38+
</ul>
39+
</description>
40+
<issues>
41+
<issue url="https://github.com/elementary/gala/issues/137">Send a persistent notification after taking a screenshot</issue>
42+
<issue url="https://github.com/elementary/gala/issues/321">Use org.gnome.desktop.interface enable-animations</issue>
43+
<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>
44+
<issue url="https://github.com/elementary/gala/issues/823">Check for redacted font</issue>
45+
<issue url="https://github.com/elementary/gala/issues/898">Super+Number. When workspace doesn't exist, switch to last workspace instead.</issue>
46+
<issue url="https://github.com/elementary/gala/issues/1202">Touchpad desktop switching gesture is sometimes unresponsive</issue>
47+
<issue url="https://github.com/elementary/gala/issues/1235">Overview window title should follow keyboard focus</issue>
48+
<issue url="https://github.com/elementary/gala/issues/1661">Better post-screenshot animation</issue>
49+
<issue url="https://github.com/elementary/gala/issues/2114">Wrong context menu placement</issue>
50+
<issue url="https://github.com/elementary/gala/issues/2199">Swiping in the multitasking view can close applications</issue>
51+
<issue url="https://github.com/elementary/gala/issues/2260">Ghost of window on another workspace appears when cancelling workspace swipe</issue>
52+
<issue url="https://github.com/elementary/gala/issues/2267">Dock crash may crash Gala</issue>
53+
<issue url="https://github.com/elementary/gala/issues/2279">Can't reveal dock when animations are disabled</issue>
54+
<issue url="https://github.com/elementary/gala/issues/2294">Unlocking firewall settings leads to crash</issue>
55+
<issue url="https://github.com/elementary/gala/issues/2341">Lutris Flatpak crashes gala with GE setup</issue>
56+
<issue url="https://github.com/elementary/portals/issues/97">False detection of "background activity" for some Flatpak apps</issue>
57+
</issues>
58+
</release>
59+
60+
<release version="8.1.0" date="2025-01-11" urgency="medium">
3161
<description>
3262
<p>Improvements:</p>
3363
<ul>

lib/Constants.vala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ namespace Gala {
4242
MULTITASKING_VIEW,
4343
DOCK,
4444
ZOOM,
45+
CLOSE_WINDOW,
4546
N_ACTIONS
4647
}
4748

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/ShadowEffect.vala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,17 @@ public class Gala.ShadowEffect : Clutter.Effect {
5050
}
5151
}
5252

53-
public float scale_factor { get; set; default = 1; }
53+
public float monitor_scale { get; construct set; }
54+
5455
public uint8 shadow_opacity { get; set; default = 255; }
5556
public int border_radius { get; set; default = 9;}
5657

5758
private int shadow_size;
5859
private Cogl.Pipeline? pipeline;
5960
private string? current_key = null;
6061

61-
public ShadowEffect (string css_class = "") {
62-
Object (css_class: css_class);
62+
public ShadowEffect (string css_class, float monitor_scale) {
63+
Object (css_class: css_class, monitor_scale: monitor_scale);
6364
}
6465

6566
~ShadowEffect () {
@@ -122,7 +123,7 @@ public class Gala.ShadowEffect : Clutter.Effect {
122123

123124
cr.save ();
124125
cr.set_operator (Cairo.Operator.CLEAR);
125-
var size = shadow_size * scale_factor;
126+
var size = shadow_size * monitor_scale;
126127
Drawing.Utilities.cairo_rounded_rectangle (cr, size, size, actor.width, actor.height, border_radius);
127128
cr.fill ();
128129
cr.restore ();
@@ -161,7 +162,7 @@ public class Gala.ShadowEffect : Clutter.Effect {
161162
}
162163

163164
private Clutter.ActorBox get_bounding_box () {
164-
var size = shadow_size * scale_factor;
165+
var size = shadow_size * monitor_scale;
165166
var bounding_box = Clutter.ActorBox ();
166167

167168
bounding_box.set_origin (-size, -size);

plugins/pip/PopupWindow.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
7878
reactive = true
7979
};
8080
container.add_child (clone_container);
81-
container.add_effect (new ShadowEffect ("window"));
81+
container.add_effect (new ShadowEffect ("window", scale));
8282

8383
move_action = new DragDropAction (DragDropActionType.SOURCE, "pip");
8484
move_action.drag_begin.connect (on_move_begin);

po/LINGUAS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,4 @@ frp
203203
ca@valencia
204204
en_ZA
205205
pap
206+
sco

po/POTFILES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ src/Widgets/MultitaskingView/WorkspaceInsertThumb.vala
9090
src/Widgets/MultitaskingView/WorkspaceRow.vala
9191
src/Widgets/PixelPicker.vala
9292
src/Widgets/PointerLocator.vala
93-
src/Widgets/ScreenShield.vala
9493
src/Widgets/SelectionArea.vala
94+
src/Widgets/SessionLocker.vala
9595
src/Widgets/WindowOverview.vala
9696
src/Widgets/WindowSwitcher/WindowSwitcherIcon.vala
9797
src/Widgets/WindowSwitcher/WindowSwitcher.vala

0 commit comments

Comments
 (0)