docs: update

This commit is contained in:
Dylan Araps 2019-10-15 13:30:13 +03:00
parent cb68a94196
commit bbe9255d16
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

20
sowm.c
View File

@ -136,6 +136,24 @@ void notify_enter(XEvent *e) {
if (e->xcrossing.window != root) FOC(e->xcrossing.window) if (e->xcrossing.window != root) FOC(e->xcrossing.window)
} }
/*
When the mouse is moved and the paired modifier is
pressed this function handles a window move or a window
resize.
'mouse' is defined on a modifier+mouse press and then
discarded on a modifier+mouse release.
The while loop firstly compresses all 'MotionNotify'
events down to only the latest which is an optimization
when motion happens very quickly.
There's no use in computing each and every event as we
only really care about the newest one.
The window is then moved or resized and finally its
fullscreen value is reset to '0' (False).
*/
void notify_motion(XEvent *e) { void notify_motion(XEvent *e) {
client *c; client *c;
@ -150,10 +168,10 @@ void notify_motion(XEvent *e) {
attr.y + (mouse.button==1 ? yd : 0), attr.y + (mouse.button==1 ? yd : 0),
attr.width + (mouse.button==3 ? xd : 0), attr.width + (mouse.button==3 ? xd : 0),
attr.height + (mouse.button==3 ? yd : 0)); attr.height + (mouse.button==3 ? yd : 0));
}
for WIN if (c->w == mouse.subwindow) c->f = 0; for WIN if (c->w == mouse.subwindow) c->f = 0;
} }
}
void key_grab() { void key_grab() {
KeyCode code; KeyCode code;