From 9eec06491e1a486e86f9c31fcd46ca07f27db535 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Wed, 11 Jul 2007 09:21:27 +0000 Subject: [PATCH] Add dialog option to select non-grabbing move/resize modes. SVN revision: 30756 --- src/E.h | 2 +- src/draw.c | 2 +- src/mod-misc.c | 2 +- src/moveresize.c | 2 +- src/settings.c | 8 ++++++++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/E.h b/src/E.h index 5347d87e..6afbf9ae 100644 --- a/src/E.h +++ b/src/E.h @@ -321,7 +321,7 @@ typedef struct int mode_resize; int mode_info; unsigned int color; - char old_mode; + char avoid_server_grab; char update_while_moving; char enable_sync_request; } movres; diff --git a/src/draw.c b/src/draw.c index 5ee86e3a..dbce7082 100644 --- a/src/draw.c +++ b/src/draw.c @@ -323,7 +323,7 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, EwinBorderGetSize(ewin, &bl, &br, &bt, &bb); - if (md <= 2 && !Conf.movres.old_mode) + if (md <= 2 && Conf.movres.avoid_server_grab) { static ShapeWin *shape_win = NULL; diff --git a/src/mod-misc.c b/src/mod-misc.c index 9846884e..c77931a3 100644 --- a/src/mod-misc.c +++ b/src/mod-misc.c @@ -149,7 +149,7 @@ static const CfgItem MiscCfgItems[] = { CFG_ITEM_INT(Conf, movres.mode_resize, 2), CFG_ITEM_INT(Conf, movres.mode_info, 1), CFG_ITEM_HEX(Conf, movres.color, 0x00ff0000), - CFG_ITEM_INT(Conf, movres.old_mode, 0), + CFG_ITEM_INT(Conf, movres.avoid_server_grab, 1), CFG_ITEM_BOOL(Conf, movres.update_while_moving, 0), CFG_ITEM_BOOL(Conf, movres.enable_sync_request, 0), diff --git a/src/moveresize.c b/src/moveresize.c index 53567b2c..101ab920 100644 --- a/src/moveresize.c +++ b/src/moveresize.c @@ -51,7 +51,7 @@ _NeedServerGrab(int mode) if (mode == 0) return 0; if (mode <= 2) - return Conf.movres.old_mode; + return !Conf.movres.avoid_server_grab; return 1; } diff --git a/src/settings.c b/src/settings.c index 0c66fa5c..4c4c321d 100644 --- a/src/settings.c +++ b/src/settings.c @@ -28,6 +28,7 @@ static int tmp_move; static int tmp_resize; static int tmp_geominfo; +static char tmp_avoid_server_grab; static char tmp_update_while_moving; static char tmp_sync_request; @@ -39,6 +40,7 @@ CB_ConfigureMoveResize(Dialog * d __UNUSED__, int val, void *data __UNUSED__) Conf.movres.mode_move = tmp_move; Conf.movres.mode_resize = tmp_resize; Conf.movres.mode_info = tmp_geominfo; + Conf.movres.avoid_server_grab = tmp_avoid_server_grab; Conf.movres.update_while_moving = tmp_update_while_moving; Conf.movres.enable_sync_request = tmp_sync_request; } @@ -53,6 +55,7 @@ _DlgFillMoveResize(Dialog * d __UNUSED__, DItem * table, void *data __UNUSED__) tmp_move = Conf.movres.mode_move; tmp_resize = Conf.movres.mode_resize; tmp_geominfo = Conf.movres.mode_info; + tmp_avoid_server_grab = Conf.movres.avoid_server_grab; tmp_update_while_moving = Conf.movres.update_while_moving; tmp_sync_request = Conf.movres.enable_sync_request; @@ -127,6 +130,11 @@ _DlgFillMoveResize(Dialog * d __UNUSED__, DItem * table, void *data __UNUSED__) di = DialogAddItem(table, DITEM_NONE); + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetColSpan(di, 2); + DialogItemSetText(di, _("Avoid server grab")); + DialogItemCheckButtonSetPtr(di, &tmp_avoid_server_grab); + di = DialogAddItem(table, DITEM_SEPARATOR); DialogItemSetColSpan(di, 2);