From 15a4ec0c4086047c4aa2df1dad8b7ab42411ed4b Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 16 Jan 2014 14:50:56 +0000 Subject: [PATCH] Tiling2: Use resize_mode for detecting resize direction. --- src/modules/tiling/e_mod_tiling.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/modules/tiling/e_mod_tiling.c b/src/modules/tiling/e_mod_tiling.c index aa3dd969f..0f08f6760 100644 --- a/src/modules/tiling/e_mod_tiling.c +++ b/src/modules/tiling/e_mod_tiling.c @@ -703,13 +703,22 @@ static void _move_or_resize(E_Client *ec) { h_diff = ((double) ec->h) / extra->expected.h; } - if (extra->expected.x != ec->x) + switch (ec->resize_mode) { - w_dir = -1; - } - if (extra->expected.y != ec->y) - { - h_dir = -1; + case E_POINTER_RESIZE_L: + case E_POINTER_RESIZE_BL: + w_dir = -1; + break; + case E_POINTER_RESIZE_T: + case E_POINTER_RESIZE_TR: + h_dir = -1; + break; + case E_POINTER_RESIZE_TL: + w_dir = -1; + h_dir = -1; + break; + default: + break; } if ((w_diff != 1.0) || (h_diff != 1.0)) {