mirror of
https://github.com/dylanaraps/sowm.git
synced 2025-05-19 09:30:24 -07:00
docs: update
This commit is contained in:
parent
121f17d632
commit
c027e8912b
29
sowm.c
29
sowm.c
@ -124,22 +124,19 @@ void key_grab() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void key_press(XEvent *e) {
|
void key_press(XEvent *e) {
|
||||||
XKeyEvent ke = e->xkey;
|
KeySym keysym = XKeycodeToKeysym(dis, e->xkey.keycode, 0);
|
||||||
KeySym keysym = XKeycodeToKeysym(dis,ke.keycode,0);
|
|
||||||
|
|
||||||
for (int i=0; i < sizeof(keys)/sizeof(*keys); ++i)
|
for (int i=0; i < sizeof(keys)/sizeof(*keys); ++i)
|
||||||
if (keys[i].keysym == keysym && keys[i].mod == ke.state)
|
if (keys[i].keysym == keysym && keys[i].mod == e->xkey.state)
|
||||||
keys[i].function(keys[i].arg);
|
keys[i].function(keys[i].arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void button_press(XEvent *e) {
|
void button_press(XEvent *e) {
|
||||||
XButtonEvent bu = e->xbutton;
|
if (e->xbutton.subwindow == None) return;
|
||||||
|
|
||||||
if (bu.subwindow != None) {
|
XGetWindowAttributes(dis, e->xbutton.subwindow, &attr);
|
||||||
XGetWindowAttributes(dis, bu.subwindow, &attr);
|
XRaiseWindow(dis, e->xbutton.subwindow);
|
||||||
XRaiseWindow(dis, bu.subwindow);
|
start = e->xbutton;
|
||||||
start = bu;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void button_release() {
|
void button_release() {
|
||||||
@ -316,14 +313,14 @@ void configure_request(XEvent *e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void map_request(XEvent *e) {
|
void map_request(XEvent *e) {
|
||||||
XMapRequestEvent *ev = &e->xmaprequest;
|
Window w = e->xmaprequest.window;
|
||||||
|
|
||||||
XSelectInput(dis, ev->window, PropertyChangeMask|StructureNotifyMask|
|
XSelectInput(dis, w, PropertyChangeMask|StructureNotifyMask|
|
||||||
EnterWindowMask|FocusChangeMask);
|
EnterWindowMask|FocusChangeMask);
|
||||||
win_center(ev->window);
|
win_center(w);
|
||||||
XMapWindow(dis, ev->window);
|
XMapWindow(dis, w);
|
||||||
FOC(ev->window);
|
FOC(w);
|
||||||
win_add(ev->window);
|
win_add(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
void run(const Arg arg) {
|
void run(const Arg arg) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user