From 65437e8f7510df7636db0bc6c293d3f896cb17fc Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Sat, 22 Oct 2005 01:46:48 +0000 Subject: Nailed the "gnome-terminal drifts upward and leftward" problem 2005-10-21 Elijah Newren * constraints-ideas.txt: Nailed the "gnome-terminal drifts upward and leftward" problem * src/boxes.c (meta_rectangle_resize_with_gravity): rect->x and rect->y should be ignored because we're resizing old_rect according to the given gravity, not rect. So, in the cases where nothing fancy needs to be done, we need to at least copy over old_rect->x and old_rect->y. Stupid bug caused by usage being different than original version and most testcases not catching the difference... * src/testboxes.c (test_gravity_resize): modify one of the tests so that it would have caught the above bug --- ChangeLog | 3 +++ src/testboxes.c | 13 ++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 130b322c..0f523f74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,9 @@ different than original version and most testcases not catching the difference... + * src/testboxes.c (test_gravity_resize): modify one of the tests + so that it would have caught the above bug + 2005-10-21 Elijah Newren * constraints-ideas.txt: Five quick ideas/problems/cleanups I diff --git a/src/testboxes.c b/src/testboxes.c index dd961590..fd9d8a9c 100644 --- a/src/testboxes.c +++ b/src/testboxes.c @@ -838,11 +838,14 @@ test_shoving_into_region () static void test_gravity_resize () { - MetaRectangle rect, temp; - - rect = meta_rect ( 50, 300, 250, 400); - temp = meta_rect ( 50, 300, 20, 5); - meta_rectangle_resize_with_gravity (&rect, + MetaRectangle oldrect, rect, temp; + + rect.x = -500; /* Some random amount not equal to oldrect.x to ensure that + * the resize is done with respect to oldrect instead of rect + */ + oldrect = meta_rect ( 50, 300, 250, 400); + temp = meta_rect ( 50, 300, 20, 5); + meta_rectangle_resize_with_gravity (&oldrect, &rect, NorthWestGravity, 20, -- cgit v1.2.1