Skip to content

Commit 92793a9

Browse files
authored
Merge branch 'main' into leolost/shell-clients-force-hide
2 parents 2ba0b1d + ae33e82 commit 92793a9

File tree

6 files changed

+47
-60
lines changed

6 files changed

+47
-60
lines changed

data/gala.metainfo.xml.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@
3838
</ul>
3939
</description>
4040
<issues>
41+
<issue url="https://github.com/elementary/gala/issues/397">Prevent PIP overlapping wingpanel?</issue>
4142
<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>
4243
<issue url="https://github.com/elementary/gala/issues/1967">Some apps ignore HiDPI mode</issue>
4344
<issue url="https://github.com/elementary/gala/issues/2088">Invisible window clones</issue>
4445
<issue url="https://github.com/elementary/gala/issues/2113">gnome-session-x11-services-ready.target isn't started on Wayland session</issue>
4546
<issue url="https://github.com/elementary/gala/issues/2131">Unthemed cursor style and glitchy menus on some applications</issue>
4647
<issue url="https://github.com/elementary/gala/issues/2159">Crash when moving windows between workspaces and using gestures to switch</issue>
4748
<issue url="https://github.com/elementary/gala/issues/2169">Text UI based Scaling: Tiny Titlebars in XWayland Apps</issue>
49+
<issue url="https://github.com/elementary/gala/issues/2171">PiP dragging doesn't start until after mouse is released</issue>
4850
</issues>
4951
</release>
5052

plugins/pip/PopupWindow.vala

Lines changed: 16 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
6868

6969
clone = new Clutter.Clone (window_actor);
7070

71-
move_action = new DragDropAction (DragDropActionType.SOURCE, "pip");
72-
move_action.drag_begin.connect (on_move_begin);
73-
move_action.drag_canceled.connect (on_move_end);
74-
move_action.actor_clicked.connect (activate);
75-
7671
clone_container = new Clutter.Actor () {
7772
scale_x = 0.35f,
7873
scale_y = 0.35f
@@ -84,24 +79,24 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
8479
};
8580
container.add_child (clone_container);
8681
container.add_effect (new ShadowEffect ("window"));
87-
container.add_action (move_action);
82+
83+
move_action = new DragDropAction (DragDropActionType.SOURCE, "pip");
84+
move_action.drag_begin.connect (on_move_begin);
85+
move_action.drag_canceled.connect (on_move_end);
86+
move_action.actor_clicked.connect (activate);
87+
add_action (move_action);
8888

8989
update_size ();
9090

91-
#if HAS_MUTTER45
92-
Mtk.Rectangle monitor_rect;
93-
#else
94-
Meta.Rectangle monitor_rect;
95-
#endif
96-
get_current_monitor_rect (out monitor_rect);
91+
var workarea_rect = display.get_workspace_manager ().get_active_workspace ().get_work_area_all_monitors ();
9792

9893
float x_position, y_position;
9994
if (Clutter.get_default_text_direction () == Clutter.TextDirection.RTL) {
100-
x_position = SCREEN_MARGIN + monitor_rect.x;
95+
x_position = SCREEN_MARGIN + workarea_rect.x;
10196
} else {
102-
x_position = monitor_rect.width + monitor_rect.x - SCREEN_MARGIN - width;
97+
x_position = workarea_rect.x + workarea_rect.width - SCREEN_MARGIN - width;
10398
}
104-
y_position = monitor_rect.height + monitor_rect.y - SCREEN_MARGIN - height;
99+
y_position = workarea_rect.y + workarea_rect.height - SCREEN_MARGIN - height;
105100

106101
set_position (x_position, y_position);
107102

@@ -431,22 +426,12 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
431426
private void place_window_in_screen () {
432427
off_screen = false;
433428

434-
#if HAS_MUTTER45
435-
Mtk.Rectangle monitor_rect;
436-
#else
437-
Meta.Rectangle monitor_rect;
438-
#endif
439-
get_current_monitor_rect (out monitor_rect);
429+
var workarea_rect = display.get_workspace_manager ().get_active_workspace ().get_work_area_all_monitors ();
440430

441-
int monitor_x = monitor_rect.x;
442-
int monitor_y = monitor_rect.y;
443-
int monitor_width = monitor_rect.width;
444-
int monitor_height = monitor_rect.height;
445-
446-
var screen_limit_start_x = SCREEN_MARGIN + monitor_x;
447-
var screen_limit_end_x = monitor_width + monitor_x - SCREEN_MARGIN - width;
448-
var screen_limit_start_y = SCREEN_MARGIN + monitor_y;
449-
var screen_limit_end_y = monitor_height + monitor_y - SCREEN_MARGIN - height;
431+
var screen_limit_start_x = workarea_rect.x + SCREEN_MARGIN;
432+
var screen_limit_end_x = workarea_rect.x + workarea_rect.width - SCREEN_MARGIN - width;
433+
var screen_limit_start_y = workarea_rect.y + SCREEN_MARGIN;
434+
var screen_limit_end_y = workarea_rect.y + workarea_rect.height - SCREEN_MARGIN - height;
450435

451436
var duration = AnimationsSettings.get_animation_duration (300);
452437

@@ -467,12 +452,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
467452
set_easing_mode (Clutter.AnimationMode.EASE_OUT_BACK);
468453
set_easing_duration (duration);
469454

470-
#if HAS_MUTTER45
471-
Mtk.Rectangle monitor_rect;
472-
#else
473-
Meta.Rectangle monitor_rect;
474-
#endif
475-
get_current_monitor_rect (out monitor_rect);
455+
var monitor_rect = display.get_monitor_geometry (display.get_current_monitor ());
476456

477457
int monitor_x = monitor_rect.x;
478458
int monitor_y = monitor_rect.y;
@@ -546,14 +526,6 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
546526
return false;
547527
}
548528

549-
#if HAS_MUTTER45
550-
private void get_current_monitor_rect (out Mtk.Rectangle rect) {
551-
#else
552-
private void get_current_monitor_rect (out Meta.Rectangle rect) {
553-
#endif
554-
rect = display.get_monitor_geometry (display.get_current_monitor ());
555-
}
556-
557529
private void get_target_window_size (out float width, out float height) {
558530
if (clone_container.has_clip) {
559531
clone_container.get_clip (null, null, out width, out height);

po/pl.po

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ msgstr ""
88
"Project-Id-Version: gala\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2024-12-18 21:23+0000\n"
11-
"PO-Revision-Date: 2024-12-03 18:16+0000\n"
11+
"PO-Revision-Date: 2024-12-21 09: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"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
2020
"|| n%100>=20) ? 1 : 2;\n"
21-
"X-Generator: Weblate 5.6.2\n"
21+
"X-Generator: Weblate 5.8.4\n"
2222
"X-Launchpad-Export-Date: 2017-04-20 06:29+0000\n"
2323

2424
#: daemon/DBus.vala:82 daemon-gtk3/BackgroundMenu.vala:11
@@ -127,17 +127,15 @@ msgstr "Zaktualizowano tłumaczenia"
127127

128128
#: data/gala.metainfo.xml.in:35
129129
msgid "Fixed rare crash when a dock window was killed"
130-
msgstr ""
130+
msgstr "Naprawiono rzadki crash gdy okno doku jest zabite"
131131

132132
#: data/gala.metainfo.xml.in:36
133133
msgid "Added interactive screenshot shortcut"
134-
msgstr ""
134+
msgstr "Dodano interaktywny skrót do zrzutów ekranu"
135135

136136
#: data/gala.metainfo.xml.in:37
137-
#, fuzzy
138-
#| msgid "Fix potential crash when taking screenshots"
139137
msgid "Fixed crash when using tiling shortcuts"
140-
msgstr "Napraw możliwą awarię przy robieniu zrzutów ekranu"
138+
msgstr "Naprawiono crash podczas korzystania ze skrótów kafelkowania"
141139

142140
#: data/gala.metainfo.xml.in:56
143141
msgid "Improved shadows performance"

po/zh_TW.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2024-12-18 21:23+0000\n"
11-
"PO-Revision-Date: 2024-12-09 11:10+0000\n"
11+
"PO-Revision-Date: 2024-12-21 09:16+0000\n"
1212
"Last-Translator: Kisaragi Hiu <[email protected]>\n"
1313
"Language-Team: Chinese (Traditional Han script) <https://l10n.elementary.io/"
1414
"projects/desktop/gala/zh_Hant/>\n"
@@ -125,15 +125,15 @@ msgstr "更新翻譯"
125125

126126
#: data/gala.metainfo.xml.in:35
127127
msgid "Fixed rare crash when a dock window was killed"
128-
msgstr ""
128+
msgstr "修正 dock 視窗被終止時偶爾會發生的崩潰"
129129

130130
#: data/gala.metainfo.xml.in:36
131131
msgid "Added interactive screenshot shortcut"
132-
msgstr ""
132+
msgstr "新增以互動式介面擷取畫面快照的快捷鍵"
133133

134134
#: data/gala.metainfo.xml.in:37
135135
msgid "Fixed crash when using tiling shortcuts"
136-
msgstr ""
136+
msgstr "修正使用鋪排快捷鍵時會崩潰的問題"
137137

138138
#: data/gala.metainfo.xml.in:56
139139
msgid "Improved shadows performance"

src/InternalUtils.vala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,5 +355,19 @@ namespace Gala {
355355
return Source.REMOVE;
356356
});
357357
}
358+
359+
public static void wait_for_window_actor_visible (Meta.Window window, owned WindowActorReadyCallback callback) {
360+
wait_for_window_actor (window, (window_actor) => {
361+
if (window_actor.visible) {
362+
callback (window_actor);
363+
} else {
364+
ulong show_handler = 0;
365+
show_handler = window_actor.show.connect (() => {
366+
window_actor.disconnect (show_handler);
367+
callback (window_actor);
368+
});
369+
}
370+
});
371+
}
358372
}
359373
}

src/WindowManager.vala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,9 +2120,10 @@ namespace Gala {
21202120
// TODO: currently only notifications are handled here, other windows should be too
21212121
switch_workspace_window_created_id = window_created.connect ((window) => {
21222122
if (NotificationStack.is_notification (window)) {
2123-
unowned var actor = (Meta.WindowActor) window.get_compositor_private ();
2124-
clutter_actor_reparent (actor, notification_group);
2125-
notification_stack.show_notification (actor);
2123+
InternalUtils.wait_for_window_actor_visible (window, (actor) => {
2124+
clutter_actor_reparent (actor, notification_group);
2125+
notification_stack.show_notification (actor);
2126+
});
21262127
}
21272128
});
21282129

0 commit comments

Comments
 (0)