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
31589b5e94
commit
4b91bb3ba6
32
sowm.c
32
sowm.c
@ -9,7 +9,8 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#define WIN (c=list;c;c=c->next)
|
#define WIN (c=list;c;c=c->next)
|
||||||
|
#define FOC(W) XSetInputFocus(dis, W, RevertToParent, CurrentTime);
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
const char** com;
|
const char** com;
|
||||||
@ -89,12 +90,11 @@ static void (*events[LASTEvent])(XEvent *e) = {
|
|||||||
void notify_destroy(XEvent *e) {
|
void notify_destroy(XEvent *e) {
|
||||||
win_del(e->xdestroywindow.window);
|
win_del(e->xdestroywindow.window);
|
||||||
|
|
||||||
if (list) XSetInputFocus(dis, list->win, RevertToParent, CurrentTime);
|
if (list) FOC(list->win);
|
||||||
}
|
}
|
||||||
|
|
||||||
void notify_enter(XEvent *e) {
|
void notify_enter(XEvent *e) {
|
||||||
if (e->xcrossing.window != root)
|
if (e->xcrossing.window != root) FOC(e->xcrossing.window)
|
||||||
XSetInputFocus(dis, e->xcrossing.window, RevertToParent, CurrentTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void notify_motion(XEvent *e) {
|
void notify_motion(XEvent *e) {
|
||||||
@ -225,16 +225,14 @@ void win_center(Window w) {
|
|||||||
void win_fs(Window w) {
|
void win_fs(Window w) {
|
||||||
client *c;
|
client *c;
|
||||||
|
|
||||||
for WIN if (c->win == w) break;
|
for WIN if (c->win == w) {
|
||||||
|
if ((c->f = c->f == 0 ? 1 : 0)) {
|
||||||
|
XGetWindowAttributes(dis, w, &c->a);
|
||||||
|
XMoveResizeWindow(dis, w, 0, 0, sw, sh);
|
||||||
|
|
||||||
if (!c) return;
|
} else
|
||||||
|
XMoveResizeWindow(dis, w, c->a.x, c->a.y, c->a.width, c->a.height);
|
||||||
if ((c->f = c->f == 0 ? 1 : 0)) {
|
}
|
||||||
XGetWindowAttributes(dis, w, &c->a);
|
|
||||||
XMoveResizeWindow(dis, w, 0, 0, sw, sh);
|
|
||||||
|
|
||||||
} else
|
|
||||||
XMoveResizeWindow(dis, w, c->a.x, c->a.y, c->a.width, c->a.height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void win_to_ws(const Arg arg) {
|
void win_to_ws(const Arg arg) {
|
||||||
@ -252,7 +250,7 @@ void win_to_ws(const Arg arg) {
|
|||||||
XUnmapWindow(dis, cur);
|
XUnmapWindow(dis, cur);
|
||||||
ws_save(tmp);
|
ws_save(tmp);
|
||||||
|
|
||||||
if (list) XSetInputFocus(dis, list->win, RevertToParent, CurrentTime);
|
if (list) FOC(list->win);
|
||||||
}
|
}
|
||||||
|
|
||||||
void win_next() {
|
void win_next() {
|
||||||
@ -266,7 +264,7 @@ void win_next() {
|
|||||||
|
|
||||||
c = c->next ? c->next : list;
|
c = c->next ? c->next : list;
|
||||||
|
|
||||||
XSetInputFocus(dis, c->win, RevertToParent, CurrentTime);
|
FOC(c->win);
|
||||||
XRaiseWindow(dis, c->win);
|
XRaiseWindow(dis, c->win);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -296,7 +294,7 @@ void ws_go(const Arg arg) {
|
|||||||
|
|
||||||
ws_sel(arg.i);
|
ws_sel(arg.i);
|
||||||
|
|
||||||
if (list) XSetInputFocus(dis, list->win, RevertToParent, CurrentTime);
|
if (list) FOC(list->win);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ws_save(int i) {
|
void ws_save(int i) {
|
||||||
@ -327,7 +325,7 @@ void map_request(XEvent *e) {
|
|||||||
EnterWindowMask|FocusChangeMask);
|
EnterWindowMask|FocusChangeMask);
|
||||||
win_center(ev->window);
|
win_center(ev->window);
|
||||||
XMapWindow(dis, ev->window);
|
XMapWindow(dis, ev->window);
|
||||||
XSetInputFocus(dis, ev->window, RevertToParent, CurrentTime);
|
FOC(ev->window);
|
||||||
win_add(ev->window);
|
win_add(ev->window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user