mirror of
https://github.com/dylanaraps/sowm.git
synced 2025-08-01 20:52:01 -07:00
sowm: Add existing clients
This commit is contained in:
15
sowm.c
15
sowm.c
@@ -255,6 +255,20 @@ void input_grab(Window root) {
|
|||||||
XFreeModifiermap(modmap);
|
XFreeModifiermap(modmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void win_init(void) {
|
||||||
|
Window *child;
|
||||||
|
unsigned int i, n_child;
|
||||||
|
|
||||||
|
XQueryTree(d, RootWindow(d, DefaultScreen(d)),
|
||||||
|
&(Window){0}, &(Window){0}, &child, &n_child);
|
||||||
|
|
||||||
|
for (i = 0; i < n_child; i++) {
|
||||||
|
XSelectInput(d, child[i], StructureNotifyMask|EnterWindowMask);
|
||||||
|
XMapWindow(d, child[i]);
|
||||||
|
win_add(child[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
|
|
||||||
@@ -271,6 +285,7 @@ int main(void) {
|
|||||||
XSelectInput(d, root, SubstructureRedirectMask);
|
XSelectInput(d, root, SubstructureRedirectMask);
|
||||||
XDefineCursor(d, root, XCreateFontCursor(d, 68));
|
XDefineCursor(d, root, XCreateFontCursor(d, 68));
|
||||||
input_grab(root);
|
input_grab(root);
|
||||||
|
win_init();
|
||||||
|
|
||||||
while (1 && !XNextEvent(d, &ev))
|
while (1 && !XNextEvent(d, &ev))
|
||||||
if (events[ev.type]) events[ev.type](&ev);
|
if (events[ev.type]) events[ev.type](&ev);
|
||||||
|
1
sowm.h
1
sowm.h
@@ -51,6 +51,7 @@ void win_focus(client *c);
|
|||||||
void win_kill(const Arg arg);
|
void win_kill(const Arg arg);
|
||||||
void win_prev(const Arg arg);
|
void win_prev(const Arg arg);
|
||||||
void win_next(const Arg arg);
|
void win_next(const Arg arg);
|
||||||
|
void win_init(void);
|
||||||
void win_to_ws(const Arg arg);
|
void win_to_ws(const Arg arg);
|
||||||
void ws_go(const Arg arg);
|
void ws_go(const Arg arg);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user