Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions lib/Utils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,7 @@ namespace Gala {
}

if (
(window.window_type == Meta.WindowType.NORMAL
|| window.window_type == Meta.WindowType.DIALOG
|| window.window_type == Meta.WindowType.MODAL_DIALOG)
get_window_is_normal (window)
&& (!on_primary || (on_primary && window.is_on_primary_monitor ()))) {
n ++;
}
Expand Down Expand Up @@ -454,5 +452,16 @@ namespace Gala {
public static uint get_animation_duration (uint duration) {
return Meta.Prefs.get_gnome_animations () ? duration : 0;
}

public static inline bool get_window_is_normal (Meta.Window window) {
switch (window.window_type) {
case Meta.WindowType.NORMAL:
case Meta.WindowType.DIALOG:
case Meta.WindowType.MODAL_DIALOG:
return true;
default:
return false;
}
}
}
}
11 changes: 2 additions & 9 deletions plugins/pip/PopupWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
height = src_height * ratio;
}

private static bool get_window_is_normal (Meta.Window window) {
var window_type = window.get_window_type ();
return window_type == Meta.WindowType.NORMAL
|| window_type == Meta.WindowType.DIALOG
|| window_type == Meta.WindowType.MODAL_DIALOG;
}

public PopupWindow (Meta.Display display, Meta.WindowActor window_actor) {
Object (display: display, window_actor: window_actor);
}
Expand Down Expand Up @@ -320,8 +313,8 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {

private void update_window_focus () {
unowned Meta.Window focus_window = display.get_focus_window ();
if ((focus_window != null && !get_window_is_normal (focus_window))
|| (previous_focus != null && !get_window_is_normal (previous_focus))) {
if ((focus_window != null && !Utils.get_window_is_normal (focus_window))
|| (previous_focus != null && !Utils.get_window_is_normal (previous_focus))) {
previous_focus = focus_window;
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/WindowManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ namespace Gala {
var xwin = window.get_xwindow ();
#endif
if (xwin == bottom_xwin
|| !InternalUtils.get_window_is_normal (window)
|| !Utils.get_window_is_normal (window)
|| window.minimized) {
return;
}
Expand Down Expand Up @@ -1339,7 +1339,7 @@ namespace Gala {
if (!Meta.Prefs.get_gnome_animations ()) {
map_completed (actor);

if (InternalUtils.get_window_is_normal (window) && window.get_layer () == Meta.StackLayer.BOTTOM) {
if (Utils.get_window_is_normal (window) && window.get_layer () == Meta.StackLayer.BOTTOM) {
show_bottom_stack_window (window);
}

Expand Down
4 changes: 2 additions & 2 deletions src/WindowTracker.vala
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public class Gala.WindowTracker : GLib.Object {
private void on_unmanaged (Meta.Window window) {
disassociate_window (window);

if (InternalUtils.get_window_is_normal (window)) {
if (Utils.get_window_is_normal (window)) {
windows_changed ();
}
}
Expand All @@ -350,7 +350,7 @@ public class Gala.WindowTracker : GLib.Object {
app.add_window (window);
window_to_app.insert (window, app);

if (InternalUtils.get_window_is_normal (window)) {
if (Utils.get_window_is_normal (window)) {
windows_changed ();
}
}
Expand Down