mirror of
https://github.com/brl/mutter.git
synced 2025-02-18 06:04:10 +00:00
Adjust the position of attached dialogs to fit on-screen
As the position of attached modal dialogs is determined entirely by the position of the parent window, the dialog may end up partially off-screen (especially if the dialog is wider than the parent). In this case, diverge from the calculated position and try to fit the dialog on-screen. https://bugzilla.gnome.org/show_bug.cgi?id=631308
This commit is contained in:
parent
c5d1d2db62
commit
92e317ec2a
@ -142,6 +142,11 @@ typedef struct
|
|||||||
GList *usable_screen_region;
|
GList *usable_screen_region;
|
||||||
GList *usable_monitor_region;
|
GList *usable_monitor_region;
|
||||||
} ConstraintInfo;
|
} ConstraintInfo;
|
||||||
|
|
||||||
|
static gboolean do_screen_and_monitor_relative_constraints (MetaWindow *window,
|
||||||
|
GList *region_spanning_rectangles,
|
||||||
|
ConstraintInfo *info,
|
||||||
|
gboolean check_only);
|
||||||
static gboolean constrain_modal_dialog (MetaWindow *window,
|
static gboolean constrain_modal_dialog (MetaWindow *window,
|
||||||
ConstraintInfo *info,
|
ConstraintInfo *info,
|
||||||
ConstraintPriority priority,
|
ConstraintPriority priority,
|
||||||
@ -776,7 +781,12 @@ constrain_modal_dialog (MetaWindow *window,
|
|||||||
|
|
||||||
info->current.y = y;
|
info->current.y = y;
|
||||||
info->current.x = x;
|
info->current.x = x;
|
||||||
return TRUE;
|
/* The calculated position above may need adjustment to make sure the
|
||||||
|
* dialog does not end up partially off-screen */
|
||||||
|
return do_screen_and_monitor_relative_constraints (window,
|
||||||
|
info->usable_screen_region,
|
||||||
|
info,
|
||||||
|
check_only);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
Loading…
x
Reference in New Issue
Block a user