Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PiP: Check workspace before hiding the window #1708

Merged
merged 5 commits into from Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions data/gala.metainfo.xml.in
Expand Up @@ -25,6 +25,18 @@
<update_contact>contact_at_elementary.io</update_contact>

<releases>
<release version="7.1.1" date="2023-07-04" urgency="medium">
<description>
<p>Improvements:</p>
<ul>
<li>Updated translations</li>
</ul>
</description>
<issues>
<issue url="https://github.com/elementary/gala/issues/1700">PiP doesn't become visible by changing workspaces</issue>
</issues>
</release>

<release version="7.1.0" date="2023-06-26" urgency="medium">
<description>
<p>Improvements:</p>
Expand Down
19 changes: 10 additions & 9 deletions plugins/pip/PopupWindow.vala
Expand Up @@ -71,14 +71,12 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
set_pivot_point (0.5f, 0.5f);
set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);

var window = window_actor.get_meta_window ();
unowned var window = window_actor.get_meta_window ();
window.unmanaged.connect (on_close_click_clicked);
window.notify["appears-focused"].connect (() => {
Idle.add (() => {
update_window_focus ();
return Source.REMOVE;
});
});
window.notify["appears-focused"].connect (update_window_focus);

unowned var workspace_manager = wm.get_display ().get_workspace_manager ();
workspace_manager.active_workspace_changed.connect (update_window_focus);

clone = new Clutter.Clone (window_actor);

Expand Down Expand Up @@ -318,8 +316,11 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
return;
}

var window = window_actor.get_meta_window ();
if (window.appears_focused) {
unowned var workspace_manager = wm.get_display ().get_workspace_manager ();
unowned var active_workspace = workspace_manager.get_active_workspace ();
unowned var window = window_actor.get_meta_window ();

if (window.appears_focused && window.located_on_workspace (active_workspace)) {
hide ();
} else if (!window_actor.is_destroyed ()) {
show ();
Expand Down