From b03d82661fe17ef0406d4edba50fa37127c7197b Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Tue, 22 Nov 2005 00:22:41 +0000 Subject: [PATCH] Relax the partially onscreen constraint to allow the titlebar to touch the 2005-11-21 Elijah Newren * src/constraints.c (constrain_partially_onscreen): Relax the partially onscreen constraint to allow the titlebar to touch the bottom panel in order to make the new constraints code function the same as the old version. Fixes #322071. --- ChangeLog | 9 ++++++++- src/constraints.c | 17 +++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 663332138..619286786 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,15 @@ +2005-11-21 Elijah Newren + + * src/constraints.c (constrain_partially_onscreen): Relax the + partially onscreen constraint to allow the titlebar to touch the + bottom panel in order to make the new constraints code function + the same as the old version. Fixes #322071. + 2005-11-21 Elijah Newren * src/constraints.c (place_window_if_needed): When updating the xinerama due to placement, update which maximal/spanning rect set - to use as well + to use as well. Fixes #322068. 2005-11-21 Elijah Newren diff --git a/src/constraints.c b/src/constraints.c index 7870b3f21..8f25e3a2e 100644 --- a/src/constraints.c +++ b/src/constraints.c @@ -1058,12 +1058,21 @@ constrain_partially_onscreen (MetaWindow *window, * Then, the amount that is allowed off is just the window size minus * this amount. */ + int top_amount, bottom_amount; int horiz_amount = info->current.width / 4; int vert_amount = info->current.height / 4; horiz_amount = CLAMP (horiz_amount, 10, 75); vert_amount = CLAMP (vert_amount, 10, 75); horiz_amount = info->current.width - horiz_amount; vert_amount = info->current.height - vert_amount; + top_amount = vert_amount; + /* Allow the titlebar to touch the bottom panel; If there is no titlebar, + * require vert_amount to remain on the screen. + */ + if (window->frame) + bottom_amount = info->current.height + info->fgeom->bottom_height; + else + bottom_amount = vert_amount; /* Extend the region, have a helper function handle the constraint, * then return the region to its original size. @@ -1071,8 +1080,8 @@ constrain_partially_onscreen (MetaWindow *window, meta_rectangle_expand_region (info->usable_screen_region, horiz_amount, horiz_amount, - vert_amount, - vert_amount); + top_amount, + bottom_amount); gboolean retval = do_screen_and_xinerama_relative_constraints (window, info->usable_screen_region, @@ -1081,8 +1090,8 @@ constrain_partially_onscreen (MetaWindow *window, meta_rectangle_expand_region (info->usable_screen_region, -horiz_amount, -horiz_amount, - -vert_amount, - -vert_amount); + -top_amount, + -bottom_amount); return retval; }