mirror of
https://github.com/dylanaraps/sowm.git
synced 2025-05-19 09:30:24 -07:00
Merge pull request #49 from SeungheonOh/master
Patch: Wheel resize update
This commit is contained in:
commit
087e276736
BIN
patches/.sowm-wheelresize.patch.swp
Normal file
BIN
patches/.sowm-wheelresize.patch.swp
Normal file
Binary file not shown.
@ -1,43 +1,41 @@
|
|||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index aaaf38d..5a95d71 100644
|
index cae2009..a7a9fa7 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -2,6 +2,7 @@
|
@@ -1,6 +1,7 @@
|
||||||
|
#ifndef CONFIG_H
|
||||||
#define CONFIG_H
|
#define CONFIG_H
|
||||||
|
|
||||||
|
+#define WHELLSTEP 5
|
||||||
#define MOD Mod4Mask
|
#define MOD Mod4Mask
|
||||||
+#define WheelResizeStep 5
|
|
||||||
|
|
||||||
const char* menu[] = {"dmenu_run", 0};
|
const char* menu[] = {"dmenu_run", 0};
|
||||||
const char* term[] = {"st", 0};
|
|
||||||
diff --git a/sowm.c b/sowm.c
|
diff --git a/sowm.c b/sowm.c
|
||||||
index bc14c4e..3b95c28 100644
|
index 90ae3bc..cbb56b5 100644
|
||||||
--- a/sowm.c
|
--- a/sowm.c
|
||||||
+++ b/sowm.c
|
+++ b/sowm.c
|
||||||
@@ -120,6 +120,17 @@ void button_press(XEvent *e) {
|
@@ -126,6 +126,15 @@ void button_press(XEvent *e) {
|
||||||
|
|
||||||
win_size(e->xbutton.subwindow, &wx, &wy, &ww, &wh);
|
win_size(e->xbutton.subwindow, &wx, &wy, &ww, &wh);
|
||||||
XRaiseWindow(d, e->xbutton.subwindow);
|
XRaiseWindow(d, e->xbutton.subwindow);
|
||||||
+
|
+
|
||||||
+ int sd = 0;
|
+ int sd = 0;
|
||||||
+ if(e->xbutton.button == Button4) sd = WheelResizeStep;
|
+ if(e->xbutton.button == Button4) sd = WHELLSTEP;
|
||||||
+ else if(e->xbutton.button == Button5) sd = -WheelResizeStep;
|
+ else if(e->xbutton.button == Button5) sd = -WHELLSTEP;
|
||||||
+
|
+
|
||||||
+ XMoveResizeWindow(d, e->xbutton.subwindow,
|
+ XMoveResizeWindow(d, e->xbutton.subwindow,
|
||||||
+ wx - sd,
|
+ wx - sd, wy - sd,
|
||||||
+ wy - sd,
|
+ ww + sd*2, wh + sd*2);
|
||||||
+ ww + sd*2,
|
|
||||||
+ wh + sd*2);
|
|
||||||
+
|
+
|
||||||
mouse = e->xbutton;
|
mouse = e->xbutton;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,7 +296,7 @@ int main(void) {
|
@@ -295,7 +304,7 @@ void input_grab(Window root) {
|
||||||
XGrabKey(d, XKeysymToKeycode(d, keys[i].keysym), keys[i].mod,
|
XGrabKey(d, code, keys[i].mod | modifiers[j], root,
|
||||||
root, True, GrabModeAsync, GrabModeAsync);
|
True, GrabModeAsync, GrabModeAsync);
|
||||||
|
|
||||||
- for (int i=1; i<4; i+=2)
|
- for (i = 1; i < 4; i += 2)
|
||||||
+ for (int i=1; i<6; i++)
|
+ for (i = 1; i < 6; i++)
|
||||||
XGrabButton(d, i, MOD, root, True,
|
for (j = 0; j < sizeof(modifiers)/sizeof(*modifiers); j++)
|
||||||
ButtonPressMask|ButtonReleaseMask|PointerMotionMask,
|
XGrabButton(d, i, MOD | modifiers[j], root, True,
|
||||||
GrabModeAsync, GrabModeAsync, 0, 0);
|
ButtonPressMask|ButtonReleaseMask|PointerMotionMask,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user