move setting supported ewmh atoms to new function
This commit is contained in:
47
src/wm.c
47
src/wm.c
@ -97,6 +97,30 @@ Display* wm_connect_display()
|
|||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wm_set_supported_atoms(Wm *wm)
|
||||||
|
{
|
||||||
|
XChangeProperty(wm->display, wm->root.window,
|
||||||
|
XInternAtom(wm->display, "_NET_NUMBER_OF_DESKTOPS", False), XA_CARDINAL,
|
||||||
|
32, PropModeReplace, (unsigned char *) &wm->smon->wscount, 1);
|
||||||
|
|
||||||
|
char *desktop_names[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9"};
|
||||||
|
|
||||||
|
wm_client_set_atom(wm, &wm->root, "_NET_DESKTOP_NAMES",
|
||||||
|
(unsigned char*) desktop_names, XA_STRING, 9);
|
||||||
|
|
||||||
|
Atom wm_supp[] = {
|
||||||
|
XInternAtom(wm->display, "_NET_NUMBER_OF_DESKTOPS", False),
|
||||||
|
XInternAtom(wm->display, "_NET_DESKTOP_GEOMETRY", False),
|
||||||
|
XInternAtom(wm->display, "_NET_DESKTOP_VIEWPORT", False),
|
||||||
|
XInternAtom(wm->display, "_NET_CURRENT_DESKTOP", False),
|
||||||
|
XInternAtom(wm->display, "_NET_ACTIVE_WINDOW", False),
|
||||||
|
XInternAtom(wm->display, "_NET_DESKTOP_NAMES", False),
|
||||||
|
};
|
||||||
|
|
||||||
|
XChangeProperty(wm->display, wm->root.window,
|
||||||
|
XInternAtom(wm->display, "_NET_SUPPORTED", False), XA_ATOM, 32,
|
||||||
|
PropModeReplace, (unsigned char *) &wm_supp, sizeof(wm_supp)/sizeof(long));
|
||||||
|
}
|
||||||
|
|
||||||
bool wm_window_is_dock(Wm *wm, Window w)
|
bool wm_window_is_dock(Wm *wm, Window w)
|
||||||
{
|
{
|
||||||
@ -546,28 +570,7 @@ void wm_init(Wm *wm)
|
|||||||
// exit(1);
|
// exit(1);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
//TODO: new function!
|
wm_set_supported_atoms(wm);
|
||||||
XChangeProperty(wm->display, wm->root.window,
|
|
||||||
XInternAtom(wm->display, "_NET_NUMBER_OF_DESKTOPS", False), XA_CARDINAL,
|
|
||||||
32, PropModeReplace, (unsigned char *) &wm->smon->wscount, 1);
|
|
||||||
|
|
||||||
char *desktop_names[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9"};
|
|
||||||
|
|
||||||
wm_client_set_atom(wm, &wm->root, "_NET_DESKTOP_NAMES",
|
|
||||||
(unsigned char*) desktop_names, XA_STRING, 9);
|
|
||||||
|
|
||||||
Atom wm_supp[] = {
|
|
||||||
XInternAtom(wm->display, "_NET_NUMBER_OF_DESKTOPS", False),
|
|
||||||
XInternAtom(wm->display, "_NET_DESKTOP_GEOMETRY", False),
|
|
||||||
XInternAtom(wm->display, "_NET_DESKTOP_VIEWPORT", False),
|
|
||||||
XInternAtom(wm->display, "_NET_CURRENT_DESKTOP", False),
|
|
||||||
XInternAtom(wm->display, "_NET_ACTIVE_WINDOW", False),
|
|
||||||
XInternAtom(wm->display, "_NET_DESKTOP_NAMES", False),
|
|
||||||
};
|
|
||||||
|
|
||||||
XChangeProperty(wm->display, wm->root.window,
|
|
||||||
XInternAtom(wm->display, "_NET_SUPPORTED", False), XA_ATOM, 32,
|
|
||||||
PropModeReplace, (unsigned char *) &wm_supp, sizeof(wm_supp)/sizeof(long));
|
|
||||||
|
|
||||||
//XSetErrorHandler(&wm_xerror_handler);
|
//XSetErrorHandler(&wm_xerror_handler);
|
||||||
|
|
||||||
|
1
src/wm.h
1
src/wm.h
@ -143,6 +143,7 @@ struct Wm {
|
|||||||
Monitor wm_monitor_open(Display *d, XineramaScreenInfo info);
|
Monitor wm_monitor_open(Display *d, XineramaScreenInfo info);
|
||||||
void wm_monitors_open_all(Wm *wm, Display *d);
|
void wm_monitors_open_all(Wm *wm, Display *d);
|
||||||
Display* wm_connect_display();
|
Display* wm_connect_display();
|
||||||
|
void wm_set_supported_atoms(Wm *wm);
|
||||||
|
|
||||||
void wm_mstack(Wm *wm, Monitor *m);
|
void wm_mstack(Wm *wm, Monitor *m);
|
||||||
void wm_set_layout(Wm *wm, void(*f)(Wm *wm, Monitor*));
|
void wm_set_layout(Wm *wm, void(*f)(Wm *wm, Monitor*));
|
||||||
|
Reference in New Issue
Block a user