Skip to content

Commit 80b79e8

Browse files
authored
Merge branch 'main' into lenemter/wait-for-bg
2 parents df35983 + 7314387 commit 80b79e8

25 files changed

+381
-398
lines changed

data/io.elementary.desktop.wm.shell

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
launch-on-x=true
33
args=io.elementary.wingpanel
44

5-
[io.elementary.desktop.agent-polkit]
6-
launch-on-x=true
7-
args=/usr/libexec/policykit-1-pantheon/io.elementary.desktop.agent-polkit
8-
95
[io.elementary.dock]
10-
launch-on-x=false
6+
launch-on-x=true
117
args=io.elementary.dock

plugins/pip/PopupWindow.vala

Lines changed: 57 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
1919
public Gala.WindowManager wm { get; construct; }
2020
public Meta.WindowActor window_actor { get; construct; }
2121

22-
private bool dynamic_container = false;
23-
24-
private Clutter.Actor clone;
25-
private Clutter.Actor container;
22+
private Clutter.Clone clone; // clone itself
23+
private Clutter.Actor clone_container; // clips the clone
24+
private Clutter.Actor container; // draws the shadow
2625
private Gala.CloseButton close_button;
2726
private Clutter.Actor resize_button;
2827
private DragDropAction move_action;
@@ -65,33 +64,30 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
6564
container_margin = button_size / 2;
6665

6766
reactive = true;
68-
6967
set_pivot_point (0.5f, 0.5f);
7068
set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);
7169

72-
unowned var window = window_actor.get_meta_window ();
73-
window.unmanaged.connect (on_close_click_clicked);
74-
window.notify["appears-focused"].connect (update_window_focus);
75-
76-
unowned var workspace_manager = wm.get_display ().get_workspace_manager ();
77-
workspace_manager.active_workspace_changed.connect (update_window_focus);
78-
7970
clone = new Clutter.Clone (window_actor);
8071

8172
move_action = new DragDropAction (DragDropActionType.SOURCE, "pip");
8273
move_action.drag_begin.connect (on_move_begin);
8374
move_action.drag_canceled.connect (on_move_end);
8475
move_action.actor_clicked.connect (activate);
8576

86-
container = new Clutter.Actor ();
87-
container.reactive = true;
88-
container.set_scale (0.35f, 0.35f);
89-
container.add_effect (new ShadowEffect ("window") { border_radius = 6});
90-
container.add_child (clone);
77+
clone_container = new Clutter.Actor () {
78+
scale_x = 0.35f,
79+
scale_y = 0.35f
80+
};
81+
clone_container.add_child (clone);
82+
83+
container = new Clutter.Actor () {
84+
reactive = true
85+
};
86+
container.add_child (clone_container);
87+
container.add_effect (new ShadowEffect ("window"));
9188
container.add_action (move_action);
9289

9390
update_size ();
94-
update_container_position ();
9591

9692
#if HAS_MUTTER45
9793
Mtk.Rectangle monitor_rect;
@@ -132,6 +128,13 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
132128
window_actor.notify["allocation"].connect (on_allocation_changed);
133129
container.set_position (container_margin, container_margin);
134130
update_clone_clip ();
131+
132+
unowned var window = window_actor.get_meta_window ();
133+
window.unmanaged.connect (on_close_click_clicked);
134+
window.notify["appears-focused"].connect (update_window_focus);
135+
136+
unowned var workspace_manager = wm.get_display ().get_workspace_manager ();
137+
workspace_manager.active_workspace_changed.connect (update_window_focus);
135138
}
136139

137140
public override void show () {
@@ -206,9 +209,8 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
206209
}
207210

208211
public void set_container_clip (Graphene.Rect? container_clip) {
209-
container.clip_rect = container_clip;
210-
dynamic_container = true;
211-
update_container_scale ();
212+
clone_container.clip_rect = container_clip;
213+
update_clone_container_scale ();
212214
on_allocation_changed ();
213215
}
214216

@@ -269,7 +271,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
269271
width = begin_resize_width + diff_x;
270272
height = begin_resize_height + diff_y;
271273

272-
update_container_scale ();
274+
update_clone_container_scale ();
273275
update_size ();
274276

275277
break;
@@ -348,17 +350,28 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
348350
}
349351

350352
private void update_size () {
351-
if (dynamic_container) {
353+
int clone_container_width, clone_container_height;
354+
355+
if (clone_container.has_clip) {
352356
float src_width = 0.0f, src_height = 0.0f;
353-
container.get_clip (null, null, out src_width, out src_height);
354-
width = (int)(src_width * container.scale_x + button_size);
355-
height = (int)(src_height * container.scale_y + button_size);
357+
clone_container.get_clip (null, null, out src_width, out src_height);
358+
clone_container_width = (int) (src_width * clone_container.scale_x);
359+
clone_container_height = (int) (src_height * clone_container.scale_y);
356360
} else {
357-
width = (int)(container.width * container.scale_x + button_size);
358-
height = (int)(container.height * container.scale_y + button_size);
361+
clone_container_width = (int) (clone_container.width * clone_container.scale_x);
362+
clone_container_height = (int) (clone_container.height * clone_container.scale_y);
359363
}
364+
365+
container.width = clone_container_width;
366+
container.height = clone_container_height;
367+
368+
width = clone_container_width + button_size;
369+
height = clone_container_height + button_size;
360370
}
361371

372+
/*
373+
* Offsets clone by csd shadow size.
374+
*/
362375
private void update_clone_clip () {
363376
var rect = window_actor.get_meta_window ().get_frame_rect ();
364377

@@ -367,16 +380,16 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
367380
clone.set_clip (x_offset, y_offset, rect.width, rect.height);
368381
clone.set_position (-x_offset, -y_offset);
369382

370-
container.set_size (rect.width, rect.height);
383+
clone_container.set_size (rect.width, rect.height);
371384
}
372385

373-
private void update_container_scale () {
386+
private void update_clone_container_scale () {
374387
float src_width = 1.0f, src_height = 1.0f;
375-
if (dynamic_container) {
376-
container.get_clip (null, null, out src_width, out src_height);
388+
if (clone_container.has_clip) {
389+
clone_container.get_clip (null, null, out src_width, out src_height);
377390
} else {
378-
src_width = container.width;
379-
src_height = container.height;
391+
src_width = clone_container.width;
392+
src_height = clone_container.height;
380393
}
381394

382395
float max_width = width - button_size;
@@ -395,18 +408,18 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
395408
float new_scale_x = new_width / window_width;
396409
float new_scale_y = new_height / window_height;
397410

398-
container.scale_x = new_scale_x.clamp (MINIMUM_SCALE, MAXIMUM_SCALE);
399-
container.scale_y = new_scale_y.clamp (MINIMUM_SCALE, MAXIMUM_SCALE);
411+
clone_container.scale_x = new_scale_x.clamp (MINIMUM_SCALE, MAXIMUM_SCALE);
412+
clone_container.scale_y = new_scale_y.clamp (MINIMUM_SCALE, MAXIMUM_SCALE);
400413

401-
update_container_position ();
414+
update_clone_container_position ();
402415
}
403416

404-
private void update_container_position () {
405-
if (dynamic_container) {
417+
private void update_clone_container_position () {
418+
if (clone_container.has_clip) {
406419
float clip_x = 0.0f, clip_y = 0.0f;
407-
container.get_clip (out clip_x, out clip_y, null, null);
408-
container.x = (float)(-clip_x * container.scale_x + container_margin);
409-
container.y = (float)(-clip_y * container.scale_y + container_margin);
420+
clone_container.get_clip (out clip_x, out clip_y, null, null);
421+
clone_container.x = (float) (-clip_x * clone_container.scale_x);
422+
clone_container.y = (float) (-clip_y * clone_container.scale_y);
410423
}
411424
}
412425

@@ -545,8 +558,8 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
545558
}
546559

547560
private void get_target_window_size (out float width, out float height) {
548-
if (dynamic_container) {
549-
container.get_clip (null, null, out width, out height);
561+
if (clone_container.has_clip) {
562+
clone_container.get_clip (null, null, out width, out height);
550563
} else if (clone.has_clip) {
551564
clone.get_clip (null, null, out width, out height);
552565
} else {

po/bs.po

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ msgstr ""
88
"Project-Id-Version: noise\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2024-07-18 17:28+0000\n"
11-
"PO-Revision-Date: 2019-12-16 18:35+0000\n"
12-
"Last-Translator: Daniel Foré <[email protected]>\n"
13-
"Language-Team: Bosnian <https://l10n.elementary.io/projects/desktop/gala/bs/"
14-
">\n"
11+
"PO-Revision-Date: 2024-08-07 18:17+0000\n"
12+
"Last-Translator: anonymous <[email protected]>\n"
13+
"Language-Team: Bosnian <https://l10n.elementary.io/projects/desktop/gala/bs/>"
14+
"\n"
1515
"Language: bs\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%10==1 && n%100!=11 ? 0 : n%10>=2 && "
2020
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
21-
"X-Generator: Weblate 3.9.1\n"
21+
"X-Generator: Weblate 5.6.2\n"
2222
"X-Launchpad-Export-Date: 2017-02-21 05:47+0000\n"
2323

2424
#: daemon/DBus.vala:82 daemon-gtk3/BackgroundMenu.vala:11
@@ -220,7 +220,7 @@ msgstr ""
220220

221221
#: src/ScreenshotManager.vala:290
222222
msgid "Screenshots"
223-
msgstr ""
223+
msgstr "Snimke ekrana"
224224

225225
#: src/ScreenshotManager.vala:369
226226
msgid "Screenshot taken"

po/cs.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ msgstr ""
88
"Project-Id-Version: beat-box\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2024-07-18 17:28+0000\n"
11-
"PO-Revision-Date: 2023-08-30 11:08+0000\n"
12-
"Last-Translator: Jakub Kyzr <[email protected]>\n"
11+
"PO-Revision-Date: 2024-08-07 18:17+0000\n"
12+
"Last-Translator: anonymous <[email protected]>\n"
1313
"Language-Team: Czech <https://l10n.elementary.io/projects/desktop/gala/cs/>\n"
1414
"Language: cs\n"
1515
"MIME-Version: 1.0\n"
1616
"Content-Type: text/plain; charset=UTF-8\n"
1717
"Content-Transfer-Encoding: 8bit\n"
1818
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
19-
"X-Generator: Weblate 4.17\n"
19+
"X-Generator: Weblate 5.6.2\n"
2020
"X-Launchpad-Export-Date: 2017-02-21 05:47+0000\n"
2121

2222
#: daemon/DBus.vala:82 daemon-gtk3/BackgroundMenu.vala:11
@@ -217,7 +217,7 @@ msgstr ""
217217

218218
#: src/Dialogs.vala:223
219219
msgid "Allow"
220-
msgstr ""
220+
msgstr "Povolit"
221221

222222
#: src/Dialogs.vala:224
223223
msgid "Deny"

po/de.po

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ msgstr ""
88
"Project-Id-Version: gala\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2024-07-18 17:28+0000\n"
11-
"PO-Revision-Date: 2024-04-29 20:13+0000\n"
12-
"Last-Translator: Uwe S <[email protected]>\n"
13-
"Language-Team: German <https://l10n.elementary.io/projects/desktop/gala/de/"
14-
">\n"
11+
"PO-Revision-Date: 2024-08-07 18:17+0000\n"
12+
"Last-Translator: anonymous <[email protected]>\n"
13+
"Language-Team: German <https://l10n.elementary.io/projects/desktop/gala/de/>"
14+
"\n"
1515
"Language: de\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=2; plural=n != 1;\n"
20-
"X-Generator: Weblate 5.5\n"
20+
"X-Generator: Weblate 5.6.2\n"
2121
"X-Launchpad-Export-Date: 2017-02-21 05:47+0000\n"
2222

2323
#: daemon/DBus.vala:82 daemon-gtk3/BackgroundMenu.vala:11
@@ -215,7 +215,7 @@ msgstr ""
215215

216216
#: src/Dialogs.vala:223
217217
msgid "Allow"
218-
msgstr ""
218+
msgstr "Erlauben"
219219

220220
#: src/Dialogs.vala:224
221221
msgid "Deny"

po/en_AU.po

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ msgstr ""
88
"Project-Id-Version: gala 3.2.0\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2024-07-18 17:28+0000\n"
11-
"PO-Revision-Date: 2019-12-10 17:16-0800\n"
12-
"Last-Translator: Automatically generated\n"
13-
"Language-Team: none\n"
11+
"PO-Revision-Date: 2024-08-07 18:17+0000\n"
12+
"Last-Translator: anonymous <[email protected]>\n"
13+
"Language-Team: English (Australia) <https://l10n.elementary.io/projects/"
14+
"desktop/gala/en_AU/>\n"
1415
"Language: en_AU\n"
1516
"MIME-Version: 1.0\n"
1617
"Content-Type: text/plain; charset=UTF-8\n"
1718
"Content-Transfer-Encoding: 8bit\n"
18-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
19+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
20+
"X-Generator: Weblate 5.6.2\n"
1921

2022
#: daemon/DBus.vala:82 daemon-gtk3/BackgroundMenu.vala:11
2123
msgid "Change Wallpaper…"
@@ -125,7 +127,7 @@ msgstr ""
125127
#: data/gala.metainfo.xml.in:95 data/gala.metainfo.xml.in:110
126128
#: data/gala.metainfo.xml.in:125
127129
msgid "Updated translations"
128-
msgstr ""
130+
msgstr "Updated translations"
129131

130132
#: data/gala.metainfo.xml.in:69
131133
msgid ""
@@ -217,7 +219,7 @@ msgstr ""
217219

218220
#: src/ScreenshotManager.vala:290
219221
msgid "Screenshots"
220-
msgstr ""
222+
msgstr "Screenshots"
221223

222224
#: src/ScreenshotManager.vala:369
223225
msgid "Screenshot taken"

po/en_CA.po

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ msgstr ""
88
"Project-Id-Version: noise\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2024-07-18 17:28+0000\n"
11-
"PO-Revision-Date: 2018-02-23 18:17+0000\n"
12-
"Last-Translator: Shawn <[email protected]>\n"
13-
"Language-Team: English (Canada) <https://weblate.elementary.io/projects/"
14-
"desktop/gala/en_CA/>\n"
11+
"PO-Revision-Date: 2024-08-07 18:17+0000\n"
12+
"Last-Translator: anonymous <[email protected]>\n"
13+
"Language-Team: English (Canada) <https://l10n.elementary.io/projects/desktop/"
14+
"gala/en_CA/>\n"
1515
"Language: en_CA\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=2; plural=n != 1;\n"
20-
"X-Generator: Weblate 2.18\n"
20+
"X-Generator: Weblate 5.6.2\n"
2121
"X-Launchpad-Export-Date: 2017-02-21 05:48+0000\n"
2222

2323
#: daemon/DBus.vala:82 daemon-gtk3/BackgroundMenu.vala:11
@@ -104,13 +104,13 @@ msgstr ""
104104

105105
#: data/gala.metainfo.xml.in:24
106106
msgid "elementary, Inc."
107-
msgstr ""
107+
msgstr "elementary, Inc."
108108

109109
#: data/gala.metainfo.xml.in:32 data/gala.metainfo.xml.in:67
110110
#: data/gala.metainfo.xml.in:92 data/gala.metainfo.xml.in:108
111111
#: data/gala.metainfo.xml.in:123
112112
msgid "Improvements:"
113-
msgstr ""
113+
msgstr "Improvements:"
114114

115115
#: data/gala.metainfo.xml.in:34
116116
#, fuzzy
@@ -126,7 +126,7 @@ msgstr ""
126126
#: data/gala.metainfo.xml.in:95 data/gala.metainfo.xml.in:110
127127
#: data/gala.metainfo.xml.in:125
128128
msgid "Updated translations"
129-
msgstr ""
129+
msgstr "Updated translations"
130130

131131
#: data/gala.metainfo.xml.in:69
132132
msgid ""
@@ -218,7 +218,7 @@ msgstr ""
218218

219219
#: src/ScreenshotManager.vala:290
220220
msgid "Screenshots"
221-
msgstr ""
221+
msgstr "Screenshots"
222222

223223
#: src/ScreenshotManager.vala:369
224224
msgid "Screenshot taken"

0 commit comments

Comments
 (0)