Skip to content

Commit acbfa41

Browse files
authored
Merge branch 'main' into leolost/windowclone-allocate
2 parents 0f60645 + 24b05bb commit acbfa41

File tree

4 files changed

+66
-25
lines changed

4 files changed

+66
-25
lines changed

data/gala.gschema.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</description>
6363
</key>
6464
<key type="s" name="panel-main-menu-action">
65-
<default>''</default>
65+
<default>'io.elementary.wingpanel --toggle-indicator=app-launcher'</default>
6666
<summary>Panel main menu action</summary>
6767
<description>Sets the command to run when the panel-main-menu keybinding is pressed.</description>
6868
</key>
@@ -72,10 +72,15 @@
7272
<description></description>
7373
</key>
7474
<key type="s" name="overlay-action">
75-
<default>''</default>
75+
<default>'io.elementary.wingpanel --toggle-indicator=app-launcher'</default>
7676
<summary></summary>
7777
<description></description>
7878
</key>
79+
<key type="s" name="interactive-screenshot-action">
80+
<default>'flatpak run io.elementary.screenshot'</default>
81+
<summary>Interactive screenshot action</summary>
82+
<description>Sets the command to run when the interactive-screenshot keybinding is pressed.</description>
83+
</key>
7984
<key type="b" name="move-maximized-workspace">
8085
<default>false</default>
8186
<summary>Automatically move maximized windows to a new workspace</summary>
@@ -144,6 +149,10 @@
144149
<default><![CDATA[['Print']]]></default>
145150
<summary>Take a screenshot</summary>
146151
</key>
152+
<key name="interactive-screenshot" type="as">
153+
<default><![CDATA[['<Super>Print']]]></default>
154+
<summary>Launch the interactive screenshot tool</summary>
155+
</key>
147156
<key name="window-screenshot" type="as">
148157
<default><![CDATA[['<Alt>Print']]]></default>
149158
<summary>Take a screenshot of a window</summary>

po/pl.po

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ msgstr ""
88
"Project-Id-Version: gala\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2024-11-23 16:06+0000\n"
11-
"PO-Revision-Date: 2024-09-23 10:39+0000\n"
11+
"PO-Revision-Date: 2024-12-03 18:16+0000\n"
1212
"Last-Translator: Marcin Serwin <[email protected]>\n"
13-
"Language-Team: Polish <https://l10n.elementary.io/projects/desktop/gala/pl/"
14-
">\n"
13+
"Language-Team: Polish <https://l10n.elementary.io/projects/desktop/gala/pl/>"
14+
"\n"
1515
"Language: pl\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
@@ -124,10 +124,8 @@ msgid "Updated translations"
124124
msgstr "Zaktualizowano tłumaczenia"
125125

126126
#: data/gala.metainfo.xml.in:35
127-
#, fuzzy
128-
#| msgid "Improve window shadows for legacy apps"
129127
msgid "Improved shadows performance"
130-
msgstr "Popraw cienie okien dla przestarzałych aplikacji"
128+
msgstr "Poprawiona wydajność cieni"
131129

132130
#: data/gala.metainfo.xml.in:78
133131
msgid "Fix a potential crash when moving windows between workspaces"

src/ShellClients/HideTracker.vala

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ public class Gala.HideTracker : Object {
5151
if (hide_timeout_id != 0) {
5252
Source.remove (hide_timeout_id);
5353
}
54+
55+
if (update_timeout_id != 0) {
56+
Source.remove (update_timeout_id);
57+
}
5458
}
5559

5660
construct {
@@ -95,7 +99,7 @@ public class Gala.HideTracker : Object {
9599
display.get_stage ().add_action_full ("panel-swipe-gesture", CAPTURE, pan_action);
96100
}
97101

98-
//Can be removed with mutter > 45
102+
#if !HAS_MUTTER45
99103
private bool window_has_pointer () {
100104
var cursor_tracker = display.get_cursor_tracker ();
101105
Graphene.Point pointer_pos;
@@ -114,6 +118,7 @@ public class Gala.HideTracker : Object {
114118
};
115119
return graphene_window_rect.contains_point (pointer_pos);
116120
}
121+
#endif
117122

118123
private void track_focus_window (Meta.Window? window) {
119124
if (window == null) {
@@ -208,13 +213,10 @@ public class Gala.HideTracker : Object {
208213
}
209214

210215
private void toggle_display (bool should_hide) {
211-
unowned var window_actor = (Meta.WindowActor) panel.window.get_compositor_private ();
212-
213-
// Window actor receives pointer events while hidden on X11: https://github.com/elementary/gala/issues/2083
214216
#if HAS_MUTTER45
215-
hovered = panel.window.has_pointer () && window_actor.visible;
217+
hovered = panel.window.has_pointer ();
216218
#else
217-
hovered = window_has_pointer () && window_actor.visible;
219+
hovered = window_has_pointer ();
218220
#endif
219221

220222
if (should_hide && !hovered && !panel.window.has_focus ()) {

src/WindowManager.vala

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,38 @@ namespace Gala {
148148
display.gl_video_memory_purged.connect (() => {
149149
Meta.Background.refresh_all ();
150150
});
151+
152+
#if WITH_SYSTEMD
153+
if (Meta.Util.is_wayland_compositor ()) {
154+
display.init_xserver.connect ((task) => {
155+
start_x11_services.begin (task);
156+
return true;
157+
});
158+
}
159+
#endif
160+
}
161+
162+
#if WITH_SYSTEMD
163+
private async void start_x11_services (GLib.Task task) {
164+
try {
165+
var session_bus = yield GLib.Bus.@get (GLib.BusType.SESSION);
166+
yield session_bus.call (
167+
"org.freedesktop.systemd1",
168+
"/org/freedesktop/systemd1",
169+
"org.freedesktop.systemd1.Manager",
170+
"StartUnit",
171+
new GLib.Variant ("(ss)", "gnome-session-x11-services-ready.target", "fail"),
172+
new GLib.VariantType ("(o)"),
173+
GLib.DBusCallFlags.NONE,
174+
-1
175+
);
176+
} catch (Error e) {
177+
critical (e.message);
178+
} finally {
179+
task.return_boolean (true);
180+
}
151181
}
182+
#endif
152183

153184
private void show_stage () {
154185
unowned Meta.Display display = get_display ();
@@ -255,6 +286,7 @@ namespace Gala {
255286
display.add_keybinding ("switch-input-source-backward", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_switch_input_source);
256287

257288
display.add_keybinding ("screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
289+
display.add_keybinding ("interactive-screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
258290
display.add_keybinding ("window-screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
259291
display.add_keybinding ("area-screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
260292
display.add_keybinding ("screenshot-clip", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
@@ -295,8 +327,7 @@ namespace Gala {
295327
// Most things inside this "later" depend on GTK. We get segfaults if we try to do GTK stuff before the window manager
296328
// is initialized, so we hold this stuff off until we're ready to draw
297329
laters.add (Meta.LaterType.BEFORE_REDRAW, () => {
298-
unowned string xdg_session_type = Environment.get_variable ("XDG_SESSION_TYPE");
299-
if (xdg_session_type == "x11") {
330+
if (!Meta.Util.is_wayland_compositor ()) {
300331
string[] args = {};
301332
unowned string[] _args = args;
302333
Gtk.init (ref _args);
@@ -410,10 +441,12 @@ namespace Gala {
410441
private void launch_action (string action_key) {
411442
try {
412443
var action = behavior_settings.get_string (action_key);
413-
if (action != null && action != "") {
444+
if (action != null) {
414445
Process.spawn_command_line_async (action);
415446
}
416-
} catch (Error e) { warning (e.message); }
447+
} catch (Error e) {
448+
warning (e.message);
449+
}
417450
}
418451

419452
private void on_monitors_changed () {
@@ -516,6 +549,9 @@ namespace Gala {
516549
case "screenshot":
517550
screenshot_screen.begin ();
518551
break;
552+
case "interactive-screenshot":
553+
launch_action ("interactive-screenshot-action");
554+
break;
519555
case "area-screenshot":
520556
screenshot_area.begin ();
521557
break;
@@ -1045,13 +1081,7 @@ namespace Gala {
10451081
current.@delete (Gtk.get_current_event_time ());
10461082
break;
10471083
case ActionType.OPEN_LAUNCHER:
1048-
try {
1049-
Process.spawn_command_line_async (
1050-
behavior_settings.get_string ("panel-main-menu-action")
1051-
);
1052-
} catch (Error e) {
1053-
warning (e.message);
1054-
}
1084+
launch_action ("panel-main-menu-action");
10551085
break;
10561086
case ActionType.WINDOW_OVERVIEW:
10571087
if (window_overview == null) {
@@ -1300,6 +1330,8 @@ namespace Gala {
13001330
case Meta.SizeChange.UNFULLSCREEN:
13011331
handle_fullscreen_window (window, which_change_local);
13021332
break;
1333+
default:
1334+
break;
13031335
}
13041336

13051337
size_change_completed (actor);

0 commit comments

Comments
 (0)