Skip to content

Commit a88891a

Browse files
committed
display.c: Allow non-maximized windows to affect a monitor's
fullscreen state. Currently, if you're in a fullscreen app and alt-tab to another, windowed application, that window will focus, but the rest of the monitor remains in 'fullscreen' mode - no panels. You can only alt-tab some more or go back to your fullscreen app. Muffin's calculation for determining a monitor's fullscreen state allows maximized windows to break out of it (in the example, if I maximize the window, suddenly my panels appear!) Change this behavior to mean any normal window of a reasonably size. As soon as you're interacting with a different window you should have your full ui back. ref: linuxmint/cinnamon#12958
1 parent 297259e commit a88891a

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/core/display.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ enum
176176

177177
static guint display_signals [LAST_SIGNAL] = { 0 };
178178

179+
#define MIN_FULLSCREEN_OBSCURING_WINDOW_SIZE 100
180+
179181
/*
180182
* The display we're managing. This is a singleton object. (Historically,
181183
* this was a list of displays, but there was never any way to add more
@@ -3540,15 +3542,20 @@ check_fullscreen_func (gpointer data)
35403542
if (meta_window_is_monitor_sized (window))
35413543
covers_monitors = TRUE;
35423544
}
3543-
else if (window->maximized_horizontally &&
3544-
window->maximized_vertically)
3545+
else if (window->type == META_WINDOW_NORMAL)
35453546
{
3546-
MetaLogicalMonitor *logical_monitor;
3547+
MetaRectangle window_rect;
3548+
meta_window_get_frame_rect (window, &window_rect);
35473549

3548-
logical_monitor = meta_window_get_main_logical_monitor (window);
3549-
if (!g_slist_find (obscured_monitors, logical_monitor))
3550-
obscured_monitors = g_slist_prepend (obscured_monitors,
3551-
logical_monitor);
3550+
if (window_rect.width > MIN_FULLSCREEN_OBSCURING_WINDOW_SIZE && window_rect.height > MIN_FULLSCREEN_OBSCURING_WINDOW_SIZE)
3551+
{
3552+
MetaLogicalMonitor *logical_monitor;
3553+
3554+
logical_monitor = meta_window_get_main_logical_monitor (window);
3555+
if (!g_slist_find (obscured_monitors, logical_monitor))
3556+
obscured_monitors = g_slist_prepend (obscured_monitors,
3557+
logical_monitor);
3558+
}
35523559
}
35533560

35543561
if (covers_monitors)

src/core/window.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4433,6 +4433,7 @@ meta_window_update_monitor (MetaWindow *window,
44334433
meta_window_change_workspace (window, workspace_manager->active_workspace);
44344434

44354435
meta_window_main_monitor_changed (window, old);
4436+
meta_display_queue_check_fullscreen (window->display);
44364437

44374438
/* If we're changing monitors, we need to update the has_maximize_func flag,
44384439
* as the working area has changed. */

0 commit comments

Comments
 (0)