diff options
author | rcaridade145 <[email protected]> | 2020-01-25 18:27:26 +0000 |
---|---|---|
committer | monsta <[email protected]> | 2020-02-15 16:30:09 +0300 |
commit | 897a11c196081a31b3cd6035270da28039cb0e52 (patch) | |
tree | a6b75857de6b0a0070d386131b2ae8bfba34fb78 /src/core | |
parent | 251a84f0e5450a3b89385097c62be9285b45b62a (diff) | |
download | marco-897a11c196081a31b3cd6035270da28039cb0e52.tar.bz2 marco-897a11c196081a31b3cd6035270da28039cb0e52.tar.xz |
window: handle legacy fullscreen requests
https://gitlab.gnome.org/GNOME/metacity/commit/1fafd279006ece8cf664fd777143cdfafbefad6d
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
Bug 781946 - Non-native decorated windows stuck maximised on secondary screen with Marco/Metacity
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/constraints.c | 23 | ||||
-rw-r--r-- | src/core/window.c | 31 |
2 files changed, 30 insertions, 24 deletions
diff --git a/src/core/constraints.c b/src/core/constraints.c index a82154e0..ed70b40b 100644 --- a/src/core/constraints.c +++ b/src/core/constraints.c @@ -447,29 +447,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 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->decorated || !meta_window_is_client_decorated (window)) && - meta_rectangle_equal (new, &xinerama_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); - } /* Log all this information for debugging */ meta_topic (META_DEBUG_GEOMETRY, diff --git a/src/core/window.c b/src/core/window.c index bc10e272..99ac36b8 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -4974,13 +4974,42 @@ 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, + { + 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); + + } /* 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 |