Skip to content

Commit c5bd0b4

Browse files
committed
DRY
1 parent 09bd499 commit c5bd0b4

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/InternalUtils.vala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,5 +350,11 @@ namespace Gala {
350350
Clutter.get_default_backend ().get_default_seat ().bell_notify ();
351351
#endif
352352
}
353+
354+
public static bool get_x11_in_fullscreen (Meta.Display display) {
355+
var primary_monitor = display.get_primary_monitor ();
356+
var is_in_fullscreen = display.get_monitor_in_fullscreen (primary_monitor);
357+
return !Meta.Util.is_wayland_compositor () && is_in_fullscreen;;
358+
}
353359
}
354360
}

src/ShellClients/HideTracker.vala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,7 @@ public class Gala.HideTracker : Object {
212212
hovered = panel.window.has_pointer ();
213213

214214
// Showing panels in fullscreen is broken in X11
215-
var x11_in_fullscreen = !Meta.Util.is_wayland_compositor () && display.get_monitor_in_fullscreen (panel.window.get_monitor ());
216-
217-
if (should_hide && !hovered && !panel.window.has_focus () || x11_in_fullscreen) {
215+
if (should_hide && !hovered && !panel.window.has_focus () || InternalUtils.get_x11_in_fullscreen (display)) {
218216
trigger_hide ();
219217
} else {
220218
trigger_show ();
@@ -342,8 +340,7 @@ public class Gala.HideTracker : Object {
342340

343341
private void on_barrier_triggered () {
344342
// Showing panels in fullscreen is broken in X11
345-
var x11_in_fullscreen = !Meta.Util.is_wayland_compositor () && display.get_monitor_in_fullscreen (panel.window.get_monitor ());
346-
if (x11_in_fullscreen) {
343+
if (InternalUtils.get_x11_in_fullscreen (display)) {
347344
return;
348345
}
349346

src/WindowManager.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,9 @@ namespace Gala {
331331

332332
display.overlay_key.connect (() => {
333333
// Showing panels in fullscreen is broken in X11
334-
var primary_monitor = display.get_primary_monitor ();
335-
var x11_in_fullscreen = !Meta.Util.is_wayland_compositor () && display.get_monitor_in_fullscreen (primary_monitor);
336-
if (x11_in_fullscreen && behavior_settings.get_string ("overlay-action") == OPEN_APPLICATIONS_MENU) {
334+
if (InternalUtils.get_x11_in_fullscreen (display) &&
335+
behavior_settings.get_string ("overlay-action") == OPEN_APPLICATIONS_MENU
336+
) {
337337
return;
338338
}
339339

0 commit comments

Comments
 (0)