Use Meta.Window.is_on_primary_monitor () (#1731)

This commit is contained in:
Leo 2023-07-20 15:36:21 +09:00 committed by GitHub
parent eef351e5df
commit b4a6a04d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -677,7 +677,7 @@ public class Gala.WindowClone : Clutter.Actor {
// for an icon group, we only do animations if there is an actual movement possible
if (icon_group != null
&& icon_group.workspace == window.get_workspace ()
&& window.get_monitor () == window.get_display ().get_primary_monitor ()) {
&& window.is_on_primary_monitor ()) {
return;
}
@ -733,7 +733,7 @@ public class Gala.WindowClone : Clutter.Actor {
var will_move = window.get_workspace ().index () != inserter.workspace_index;
if (Meta.Prefs.get_workspaces_only_on_primary () && window.get_monitor () != primary) {
if (Meta.Prefs.get_workspaces_only_on_primary () && !window.is_on_primary_monitor ()) {
window.move_to_monitor (primary);
will_move = true;
}
@ -763,7 +763,7 @@ public class Gala.WindowClone : Clutter.Actor {
bool did_move = false;
if (Meta.Prefs.get_workspaces_only_on_primary () && window.get_monitor () != primary) {
if (Meta.Prefs.get_workspaces_only_on_primary () && !window.is_on_primary_monitor ()) {
window.move_to_monitor (primary);
did_move = true;
}

View File

@ -219,7 +219,7 @@ namespace Gala {
foreach (var window in windows) {
if (window.window_type == Meta.WindowType.NORMAL
&& !window.on_all_workspaces
&& window.get_monitor () == display.get_primary_monitor ()) {
&& window.is_on_primary_monitor ()) {
window_container.add_window (window);
icon_group.add_window (window, true);
}
@ -256,7 +256,7 @@ namespace Gala {
if (window.window_type != Meta.WindowType.NORMAL
|| window.get_workspace () != workspace
|| window.on_all_workspaces
|| window.get_monitor () != window.get_display ().get_primary_monitor ())
|| !window.is_on_primary_monitor ())
return;
foreach (var child in window_container.get_children ())

View File

@ -1896,7 +1896,7 @@ namespace Gala {
unowned Meta.Window window = actor.get_meta_window ();
if (!window.showing_on_its_workspace () ||
(move_primary_only && window.get_monitor () != primary) ||
(move_primary_only && !window.is_on_primary_monitor ()) ||
(moving != null && window == moving))
continue;