From ab75c8caccd67d411ef83e86e009c08f14484771 Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Tue, 6 Apr 2010 21:14:54 +0200 Subject: [PATCH] [chrome] Fix fullscreen check for broken apps Document fullscreen checks and add a third case to catch apps like flash who position there windows sightly offscreen to hide there decorations. https://bugzilla.gnome.org/show_bug.cgi?id=614509 --- js/ui/chrome.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/js/ui/chrome.js b/js/ui/chrome.js index b87c30936..406fae1a9 100644 --- a/js/ui/chrome.js +++ b/js/ui/chrome.js @@ -208,9 +208,18 @@ Chrome.prototype = { this._obscuredByFullscreen = false; for (let i = windows.length - 1; i > -1; i--) { let layer = windows[i].get_meta_window().get_layer(); + + // There are 3 cases we check here for: + // 1.) Monitor sized window + // 2.) Window with a position somewhere on the primary screen having the _NET_WM_FULLSCREEN flag set + // 3.) Window that is partly off screen (tries to hide its decorations) which might have negative coords + // We check for 1.) and 2.) by checking if the upper right corner is on the primary monitor, but avoid the case + // where it overlaps with the secondary screen (like window.x + window.width == primary.x + primary.width) + // For 3.) we just ignore negative values as they don't really make sense + if (layer == Meta.StackLayer.FULLSCREEN) { - if (windows[i].x >= primary.x && windows[i].x < primary.x + primary.width && - windows[i].y >= primary.y && windows[i].y < primary.y + primary.height) { + if (Math.max(windows[i].x, 0) >= primary.x && Math.max(windows[i].x, 0) < primary.x + primary.width && + Math.max(windows[i].y, 0) >= primary.y && Math.max(windows[i].y, 0) < primary.y + primary.height) { this._obscuredByFullscreen = true; break; }