mirror of
https://github.com/elementary/gala.git
synced 2024-10-27 00:12:08 +03:00
Add watches for window_left_monitors to the places where we use window clones
This commit is contained in:
parent
1487a78b27
commit
b06b3137ac
@ -60,7 +60,7 @@ namespace Gala
|
||||
Gee.HashSet<Meta.WindowActor> unmaximizing = new Gee.HashSet<Meta.WindowActor> ();
|
||||
Gee.HashSet<Meta.WindowActor> mapping = new Gee.HashSet<Meta.WindowActor> ();
|
||||
Gee.HashSet<Meta.WindowActor> destroying = new Gee.HashSet<Meta.WindowActor> ();
|
||||
|
||||
|
||||
public Plugin ()
|
||||
{
|
||||
info = PluginInfo () {name = "Gala", version = Config.VERSION, author = "Gala Developers",
|
||||
|
@ -565,6 +565,8 @@ namespace Gala
|
||||
workspace.window_added.connect (add_window);
|
||||
workspace.window_removed.connect (remove_window);
|
||||
}
|
||||
|
||||
screen.window_left_monitor.connect (window_left_monitor);
|
||||
|
||||
#if HAS_MUTTER38
|
||||
plugin.wallpaper.
|
||||
@ -601,6 +603,17 @@ namespace Gala
|
||||
|
||||
calculate_places (get_children ());
|
||||
}
|
||||
|
||||
void window_left_monitor (int num, Window window)
|
||||
{
|
||||
// see if that's happened on one of our workspaces
|
||||
foreach (var workspace in workspaces) {
|
||||
if (window.located_on_workspace (workspace)) {
|
||||
remove_window (window);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void add_window (Window window)
|
||||
{
|
||||
@ -681,6 +694,7 @@ namespace Gala
|
||||
workspace.window_added.disconnect (add_window);
|
||||
workspace.window_removed.disconnect (remove_window);
|
||||
}
|
||||
screen.window_left_monitor.disconnect (window_left_monitor);
|
||||
|
||||
ready = false;
|
||||
|
||||
|
@ -132,10 +132,7 @@ namespace Gala
|
||||
closing = true;
|
||||
|
||||
var screen = plugin.get_screen ();
|
||||
|
||||
var workspace = screen.get_active_workspace ();
|
||||
workspace.window_added.disconnect (add_window);
|
||||
workspace.window_removed.disconnect (remove_window);
|
||||
|
||||
if (dock_window != null)
|
||||
dock_window.opacity = 0;
|
||||
@ -186,6 +183,10 @@ namespace Gala
|
||||
if (window.get_workspace () == workspace.index ())
|
||||
window.show ();
|
||||
}
|
||||
|
||||
workspace.window_added.disconnect (add_window);
|
||||
workspace.window_removed.disconnect (remove_window);
|
||||
screen.window_left_monitor.disconnect (window_left_monitor);
|
||||
});
|
||||
}
|
||||
|
||||
@ -278,6 +279,15 @@ namespace Gala
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
void window_left_monitor (int num, Meta.Window window)
|
||||
{
|
||||
// see if that's happened on our workspace
|
||||
var workspace = plugin.get_screen ().get_active_workspace ();
|
||||
if (window.located_on_workspace (workspace)) {
|
||||
remove_window (window);
|
||||
}
|
||||
}
|
||||
|
||||
void add_window (Meta.Window window)
|
||||
{
|
||||
@ -423,6 +433,7 @@ namespace Gala
|
||||
|
||||
workspace.window_added.connect (add_window);
|
||||
workspace.window_removed.connect (remove_window);
|
||||
screen.window_left_monitor.connect (window_left_monitor);
|
||||
|
||||
//grab the windows to be switched
|
||||
var layout = dock.layout_manager as BoxLayout;
|
||||
|
@ -78,6 +78,7 @@ namespace Gala
|
||||
|
||||
workspace.window_added.connect (handle_window_added);
|
||||
workspace.window_removed.connect (handle_window_removed);
|
||||
screen.window_left_monitor.connect (window_left_monitor);
|
||||
|
||||
reactive = true;
|
||||
|
||||
@ -259,6 +260,7 @@ namespace Gala
|
||||
screen.workspace_switched.disconnect (handle_workspace_switched);
|
||||
screen.workspace_added.disconnect (workspace_added);
|
||||
screen.monitors_changed.disconnect (resize);
|
||||
screen.window_left_monitor.disconnect (window_left_monitor);
|
||||
}
|
||||
|
||||
void close_workspace (Clutter.Actor actor)
|
||||
@ -329,6 +331,12 @@ namespace Gala
|
||||
check_last_workspace ();
|
||||
}
|
||||
|
||||
void window_left_monitor (int num, Meta.Window window)
|
||||
{
|
||||
if (window.located_on_workspace (workspace))
|
||||
handle_window_removed (window);
|
||||
}
|
||||
|
||||
void update_windows ()
|
||||
{
|
||||
windows.remove_all_children ();
|
||||
|
Loading…
Reference in New Issue
Block a user