From 8e5425a86fa5f82ca2154e13c092e8a3f0977bf1 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Sat, 21 Jan 2006 01:09:46 +0000 Subject: [PATCH] fixed_directions is only meant for explicit user interactions; disable it 2006-01-20 Elijah Newren * src/constraints.c (setup_constraint_info): fixed_directions is only meant for explicit user interactions; disable it for everything else. There are other bugs and improvements that could be made with fixed_directions that I should be filing too, but at least put a FIXME there for now--I'm so lame. Fixes #327822. --- ChangeLog | 8 ++++++++ src/constraints.c | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index b91ddec27..098a46d1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-01-20 Elijah Newren + + * src/constraints.c (setup_constraint_info): fixed_directions is + only meant for explicit user interactions; disable it for + everything else. There are other bugs and improvements that could + be made with fixed_directions that I should be filing too, but at + least put a FIXME there for now--I'm so lame. Fixes #327822. + 2006-01-20 Elijah Newren Avoid flashing when closing a maximized window. Fixes #317254. diff --git a/src/constraints.c b/src/constraints.c index ab2dc4d11..15b6c46ca 100644 --- a/src/constraints.c +++ b/src/constraints.c @@ -351,6 +351,12 @@ setup_constraint_info (ConstraintInfo *info, info->resize_gravity = resize_gravity; + /* FIXME: fixed_directions might be more sane if we (a) made it + * depend on the grab_op type instead of current amount of movement + * (thus implying that it only has effect when user_action is true, + * and (b) ignored it for aspect ratio windows -- at least in those + * cases where both directions do actually change size. + */ info->fixed_directions = 0; /* If x directions don't change but either y direction does */ if ( orig->x == new->x && orig->x + orig->width == new->x + new->width && @@ -364,6 +370,14 @@ setup_constraint_info (ConstraintInfo *info, { info->fixed_directions = FIXED_DIRECTION_Y; } + /* The point of fixed directions is just that "move to nearest valid + * position" is sometimes a poorer choice than "move to nearest + * valid position but only change this coordinate" for windows the + * user is explicitly moving. This isn't ever true for things that + * aren't explicit user interaction, though, so just clear it out. + */ + if (!info->is_user_action) + info->fixed_directions = 0; meta_window_get_work_area_current_xinerama (window, &info->work_area_xinerama);