summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2014-06-09 21:43:04 +0200
committerFlorian Müllner <fmuellner@gnome.org>2014-06-09 22:27:33 +0200
commitfba022cc06b8c7e80ef36f48d6577a251384cc4b (patch)
treea2ee7cae05e5ac48e8b0d9c2c0df6ab000123333
parent3f6c6f1dd93744e98add7bc3656c13e204b51435 (diff)
downloadmutter-fba022cc06b8c7e80ef36f48d6577a251384cc4b.tar.gz
window-x11: 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. https://bugzilla.gnome.org/show_bug.cgi?id=730681
-rw-r--r--src/core/constraints.c30
-rw-r--r--src/x11/window-x11.c28
2 files changed, 27 insertions, 31 deletions
diff --git a/src/core/constraints.c b/src/core/constraints.c
index f9b5668a9..8035ceffb 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -404,36 +404,6 @@ setup_constraint_info (ConstraintInfo *info,
meta_workspace_get_onmonitor_region (cur_workspace,
monitor_info->number);
- /* Workaround braindead legacy apps that don't know how to
- * fullscreen themselves properly - don't get fooled by
- * windows which hide their titlebar when maximized or which are
- * client decorated; that's not the same as fullscreen, even
- * if there are no struts making the workarea smaller than
- * the monitor.
- */
-
- meta_window_frame_rect_to_client_rect (window, new, new);
-
- if (meta_prefs_get_force_fullscreen() &&
- window->client_type != META_WINDOW_CLIENT_TYPE_WAYLAND &&
- !window->hide_titlebar_when_maximized &&
- (window->decorated || !meta_window_is_client_decorated (window)) &&
- meta_rectangle_equal (new, &monitor_info->rect) &&
- window->has_fullscreen_func &&
- !window->fullscreen)
- {
- /*
- meta_topic (META_DEBUG_GEOMETRY,
- */
- meta_warning (
- "Treating resize request of legacy application %s as a "
- "fullscreen request\n",
- window->desc);
- meta_window_make_fullscreen_internal (window);
- }
-
- meta_window_client_rect_to_frame_rect (window, new, new);
-
/* Log all this information for debugging */
meta_topic (META_DEBUG_GEOMETRY,
"Setting up constraint info:\n"
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index 3a9735d55..f3189ba1b 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -2107,13 +2107,39 @@ meta_window_move_resize_request (MetaWindow *window,
if (flags & (META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION))
{
- MetaRectangle rect;
+ MetaRectangle rect, monitor_rect;
rect.x = x;
rect.y = y;
rect.width = width;
rect.height = height;
+ meta_screen_get_monitor_geometry (window->screen, window->monitor->number, &monitor_rect);
+
+ /* Workaround braindead legacy apps that don't know how to
+ * fullscreen themselves properly - don't get fooled by
+ * windows which hide their titlebar when maximized or 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->hide_titlebar_when_maximized &&
+ (window->decorated || !meta_window_is_client_decorated (window)) &&
+ meta_rectangle_equal (&rect, &monitor_rect) &&
+ window->has_fullscreen_func &&
+ !window->fullscreen)
+ {
+ /*
+ meta_topic (META_DEBUG_GEOMETRY,
+ */
+ meta_warning (
+ "Treating resize request of legacy application %s as a "
+ "fullscreen request\n",
+ window->desc);
+ meta_window_make_fullscreen_internal (window);
+ }
+
adjust_for_gravity (window, TRUE, gravity, &rect);
meta_window_client_rect_to_frame_rect (window, &rect, &rect);
meta_window_move_resize_internal (window, flags, gravity, rect);