Репозитории ALT
S: | 0.96.0-alt1 |
5.1: | 0.92.0-alt6 |
4.1: | 0.92.0-alt2 |
4.0: | 0.92.0-alt2 |
3.0: | 0.91.0-alt1 |
+backports: | 0.92.0-alt0.M30.1 |
Группа :: Графические оболочки/Window Maker
Пакет: WindowMaker
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: WindowMaker-0.92.0-sga-moving-add.patch
Скачать
Скачать
src/defaults.c | 27 ++++++++++++
src/event.c | 15 ++++++
src/keybind.h | 15 +++++-
src/moveres.c | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
4 files changed, 181 insertions(+), 7 deletions(-)
diff --git a/src/defaults.c b/src/defaults.c
index 794516d..1c40d62 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -705,6 +705,33 @@ WDefaultEntry optionList[] = {
NULL, getKeybind, setKeyGrab
},
#endif /* LITE */
+ {"MoveLeftBottomKey", "None", (void*)WKBD_MOVELEFTBOTTOM,
+ NULL, getKeybind, setKeyGrab
+ },
+ {"MoveBottomKey", "None", (void*)WKBD_MOVEBOTTOM,
+ NULL, getKeybind, setKeyGrab
+ },
+ {"MoveRightBottomKey", "None", (void*)WKBD_MOVERIGHTBOTTOM,
+ NULL, getKeybind, setKeyGrab
+ },
+ {"MoveLeftKey", "None", (void*)WKBD_MOVELEFT,
+ NULL, getKeybind, setKeyGrab
+ },
+ {"MoveCenterKey", "None", (void*)WKBD_MOVECENTER,
+ NULL, getKeybind, setKeyGrab
+ },
+ {"MoveRightKey", "None", (void*)WKBD_MOVERIGHT,
+ NULL, getKeybind, setKeyGrab
+ },
+ {"MoveLeftTopKey", "None", (void*)WKBD_MOVELEFTTOP,
+ NULL, getKeybind, setKeyGrab
+ },
+ {"MoveTopKey", "None", (void*)WKBD_MOVETOP,
+ NULL, getKeybind, setKeyGrab
+ },
+ {"MoveRightTopKey", "None", (void*)WKBD_MOVERIGHTTOP,
+ NULL, getKeybind, setKeyGrab
+ },
{"AllMinimizeKey", "None", (void*)WKBD_ALLMINIMIZE,
NULL, getKeybind, setKeyGrab
},
diff --git a/src/event.c b/src/event.c
index 1bfe8f3..90153bd 100644
--- a/src/event.c
+++ b/src/event.c
@@ -1409,6 +1409,21 @@ handleKeyPress(XEvent *event)
}
break;
#endif /* !LITE */
+ case WKBD_MOVELEFTBOTTOM:
+ case WKBD_MOVEBOTTOM:
+ case WKBD_MOVERIGHTBOTTOM:
+ case WKBD_MOVELEFT:
+ case WKBD_MOVECENTER:
+ case WKBD_MOVERIGHT:
+ case WKBD_MOVELEFTTOP:
+ case WKBD_MOVETOP:
+ case WKBD_MOVERIGHTTOP:
+ if (ISMAPPED(wwin) && ISFOCUSED(wwin) &&
+ (!WFLAGP(wwin, no_resizable) || !WFLAGP(wwin, no_movable))) {
+ CloseWindowMenu(scr);
+ wKeyboardMoveWindowAdditional(wwin, command);
+ }
+ break;
case WKBD_WINDOWMENU:
if (ISMAPPED(wwin) && ISFOCUSED(wwin))
OpenWindowMenu(wwin, wwin->frame_x,
diff --git a/src/keybind.h b/src/keybind.h
index a45b371..68dca25 100644
--- a/src/keybind.h
+++ b/src/keybind.h
@@ -78,12 +78,21 @@
#define WKBD_SWITCH_SCREEN 45
#define WKBD_ALLMINIMIZE 46
+#define WKBD_MOVELEFTBOTTOM 47
+#define WKBD_MOVEBOTTOM 48
+#define WKBD_MOVERIGHTBOTTOM 49
+#define WKBD_MOVELEFT 50
+#define WKBD_MOVECENTER 51
+#define WKBD_MOVERIGHT 52
+#define WKBD_MOVELEFTTOP 53
+#define WKBD_MOVETOP 54
+#define WKBD_MOVERIGHTTOP 55
#ifdef KEEP_XKB_LOCK_STATUS
-# define WKBD_TOGGLE 47
-# define WKBD_TMP 48
+# define WKBD_TOGGLE 56
+# define WKBD_TMP 57
#else
-# define WKBD_TMP 47
+# define WKBD_TMP 56
#endif
#ifdef VIRTUAL_DESKTOP
diff --git a/src/moveres.c b/src/moveres.c
index 07ec2b1..b67cc33 100644
--- a/src/moveres.c
+++ b/src/moveres.c
@@ -44,6 +44,8 @@
#include "screen.h"
#include "xinerama.h"
+#include "keybind.h"
+
#include <WINGs/WINGsP.h>
@@ -1415,10 +1417,15 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
case XK_Escape:
done=1;
break;
- case XK_Up:
#ifdef XK_KP_Up
case XK_KP_Up:
#endif
+ case XK_8:
+ if (!ctrlmode){
+ off_y=-src_y;
+ }
+ break;
+ case XK_Up:
case XK_k:
if (ctrlmode){
if (moment != UP)
@@ -1429,10 +1436,15 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
}
else off_y-=kspeed;
break;
- case XK_Down:
#ifdef XK_KP_Down
case XK_KP_Down:
#endif
+ case XK_2:
+ if (!ctrlmode){
+ off_y=-src_y+scr_height-wh;
+ }
+ break;
+ case XK_Down:
case XK_j:
if (ctrlmode){
if (moment != DOWN)
@@ -1442,10 +1454,15 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
}
else off_y+=kspeed;
break;
- case XK_Left:
#ifdef XK_KP_Left
case XK_KP_Left:
#endif
+ case XK_4:
+ if (!ctrlmode){
+ off_x=-src_x;
+ }
+ break;
+ case XK_Left:
case XK_h:
if (ctrlmode) {
if (moment != LEFT)
@@ -1456,10 +1473,15 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
}
else off_x-=kspeed;
break;
- case XK_Right:
#ifdef XK_KP_Right
case XK_KP_Right:
#endif
+ case XK_6:
+ if (!ctrlmode){
+ off_x=-src_x+scr_width-ww;
+ }
+ break;
+ case XK_Right:
case XK_l:
if (ctrlmode) {
if (moment != RIGHT)
@@ -1469,6 +1491,51 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
}
else off_x+=kspeed;
break;
+#ifdef XK_KP_Home
+ case XK_KP_Home:
+#endif
+ case XK_7:
+ if (!ctrlmode){
+ off_x=-src_x;
+ off_y=-src_y;
+ }
+ break;
+#ifdef XK_KP_Prior
+ case XK_KP_Prior:
+#endif
+ case XK_9:
+ if (!ctrlmode){
+ off_y=-src_y;
+ off_x=-src_x+scr_width-ww;
+ }
+ break;
+#ifdef XK_KP_Next
+ case XK_KP_Next:
+#endif
+ case XK_3:
+ if (!ctrlmode){
+ off_y=-src_y+scr_height-wh;
+ off_x=-src_x+scr_width-ww;
+ }
+ break;
+#ifdef XK_KP_End
+ case XK_KP_End:
+#endif
+ case XK_1:
+ if (!ctrlmode){
+ off_y=-src_y+scr_height-wh;
+ off_x=-src_x;
+ }
+ break;
+#ifdef XK_KP_Begin
+ case XK_KP_Begin:
+#endif
+ case XK_5:
+ if (!ctrlmode){
+ off_y=-src_y+(scr_height-wh)/2;
+ off_x=-src_x+(scr_width-ww)/2;
+ }
+ break;
}
ww=w;wh=h;
@@ -2426,3 +2493,59 @@ InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
}
}
+int
+wKeyboardMoveWindowAdditional(WWindow *wwin, int command)
+{
+ WScreen *scr = wwin->screen_ptr;
+ int w = wwin->frame->core->width;
+ int h = wwin->frame->core->height;
+ int scr_width = wwin->screen_ptr->scr_width;
+ int scr_height = wwin->screen_ptr->scr_height;
+ int src_x = wwin->frame_x;
+ int src_y = wwin->frame_y;
+ int rc = scr_width - w;
+ int bc = scr_height - h;
+ int new_x = src_x;
+ int new_y = src_y;
+
+ switch (command) {
+ case WKBD_MOVELEFTBOTTOM:
+ new_x = 0;
+ new_y = bc;
+ break;
+ case WKBD_MOVEBOTTOM:
+ new_y = bc;
+ break;
+ case WKBD_MOVERIGHTBOTTOM:
+ new_x = rc;
+ new_y = bc;
+ break;
+ case WKBD_MOVELEFT:
+ new_x = 0;
+ break;
+ case WKBD_MOVECENTER:
+ new_x = rc/2;
+ new_y = bc/2;
+ break;
+ case WKBD_MOVERIGHT:
+ new_x = rc;
+ break;
+ case WKBD_MOVELEFTTOP:
+ new_x = 0;
+ new_y = 0;
+ break;
+ case WKBD_MOVETOP:
+ new_y = 0;
+ break;
+ case WKBD_MOVERIGHTTOP:
+ new_x = rc;
+ new_y = 0;
+ }
+
+ if (!scr->selected_windows) {
+ wWindowMove(wwin, new_x, new_y);
+ wWindowSynthConfigureNotify(wwin);
+ }
+ return 1;
+}
+