Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

constraints.c: Allow resize of windows moved above screen #696

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/core/constraints.c
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,7 @@ constrain_titlebar_visible (MetaWindow *window,
gboolean check_only)
{
gboolean unconstrained_user_action;
gboolean user_nonnorthern_resize;
gboolean retval;
int bottom_amount;
int horiz_amount_offscreen, vert_amount_offscreen;
Expand All @@ -1734,6 +1735,18 @@ constrain_titlebar_visible (MetaWindow *window,
unconstrained_user_action =
info->is_user_action && !window->display->grab_frame_action;

/* If the user is resizing anything other than the top, then don't check if
* the titlebar is beyond the top of the screen. This resize might be
* immediately following an unconstrained move or unconstrained resize that
* placed the titlebar above the top of the screen, in which case we don't
* want the titlebar immediately popping back below the screen or other
* glitching (https://gitlab.gnome.org/GNOME/mutter/-/issues/1206).
*/
user_nonnorthern_resize =
info->is_user_action &&
meta_grab_op_is_resizing (window->display->grab_op) &&
info->orig.y == info->current.y;

/* Exit early if we know the constraint won't apply--note that this constraint
* is only meant for normal windows (e.g. we don't want docks to be shoved
* "onscreen" by their own strut).
Expand All @@ -1743,6 +1756,7 @@ constrain_titlebar_visible (MetaWindow *window,
window->fullscreen ||
!window->require_titlebar_visible ||
unconstrained_user_action ||
user_nonnorthern_resize ||
meta_window_get_placement_rule (window))
return TRUE;

Expand Down
Loading