summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2017-06-28 19:39:25 +0300
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2017-06-28 21:20:27 +0300
commit1fafd279006ece8cf664fd777143cdfafbefad6d (patch)
tree55d13ec62865966d1ac0fc96b143e961c898d023
parentf8a2894721b478699a416892cf99510d1f001a39 (diff)
downloadmetacity-1fafd279006ece8cf664fd777143cdfafbefad6d.tar.gz
window: handle legacy fullscreen requests
Doing this on the actual resize requests makes more sense than handling it as a window-manager imposed constraints, so move the code accordingly. Adapted from mutter patch by Florian Müllner: https://git.gnome.org/browse/mutter/commit/?id=fba022cc06b8c7e80ef36f48d6577a251384cc4b https://bugzilla.gnome.org/show_bug.cgi?id=781946
-rw-r--r--src/core/constraints.c17
-rw-r--r--src/core/window.c37
2 files changed, 33 insertions, 21 deletions
diff --git a/src/core/constraints.c b/src/core/constraints.c
index 45902218..9b7a541a 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -467,23 +467,6 @@ setup_constraint_info (ConstraintInfo *info,
meta_workspace_get_onxinerama_region (cur_workspace,
xinerama_info->number);
- /* Workaround braindead legacy apps that don't know how to
- * fullscreen themselves properly - don't get fooled by
- * windows which are client decorated; that's not the same
- * as fullscreen, even if there are no struts making the
- * workarea smaller than the monitor.
- */
- if (meta_prefs_get_force_fullscreen() &&
- (window->decorated || !meta_window_is_client_decorated (window)) &&
- meta_rectangle_equal (new, &xinerama_info->rect) &&
- window->has_fullscreen_func &&
- !window->fullscreen)
- {
- g_warning ("Treating resize request of legacy application %s as a "
- "fullscreen request", window->desc);
- meta_window_make_fullscreen_internal (window);
- }
-
/* Log all this information for debugging */
meta_topic (META_DEBUG_GEOMETRY,
"Setting up constraint info:\n"
diff --git a/src/core/window.c b/src/core/window.c
index bd9790a3..93548133 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -5114,10 +5114,39 @@ meta_window_move_resize_request (MetaWindow *window,
flags |= META_IS_RESIZE_ACTION;
if (flags & (META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION))
- meta_window_move_resize_internal (window, flags, gravity,
- x, y, width, height,
- configure_notify,
- moved, resized);
+ {
+ const MetaXineramaScreenInfo *xinerama_info;
+ MetaRectangle rect;
+
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = height;
+
+ xinerama_info = meta_screen_get_xinerama_for_rect (window->screen, &rect);
+
+ /* Workaround braindead legacy apps that don't know how to
+ * fullscreen themselves properly - don't get fooled by
+ * windows which are client decorated; that's not the same
+ * as fullscreen, even if there are no struts making the
+ * workarea smaller than the monitor.
+ */
+ if (meta_prefs_get_force_fullscreen() &&
+ (window->decorated || !meta_window_is_client_decorated (window)) &&
+ meta_rectangle_equal (&rect, &xinerama_info->rect) &&
+ window->has_fullscreen_func &&
+ !window->fullscreen)
+ {
+ g_warning ("Treating resize request of legacy application %s as a "
+ "fullscreen request", window->desc);
+ meta_window_make_fullscreen_internal (window);
+ }
+
+ meta_window_move_resize_internal (window, flags, gravity,
+ x, y, width, height,
+ configure_notify,
+ moved, resized);
+ }
/* window->user_rect exists to allow "snapping-back" the window if a
* new strut is set (causing the window to move) and then the strut