Support _NET_SUPPORTING_WM_CHECK

This commit is contained in:
Bastien Dejean 2013-08-30 11:46:57 +02:00
parent 2b92f05e34
commit f98770b8fc
3 changed files with 16 additions and 1 deletions

View file

@ -196,6 +196,7 @@ void setup(void)
xcb_create_window(dpy, XCB_COPY_FROM_PARENT, motion_recorder, root, 0, 0, screen_width, screen_height, 0, XCB_WINDOW_CLASS_INPUT_ONLY, XCB_COPY_FROM_PARENT, mask, values);
xcb_atom_t net_atoms[] = {ewmh->_NET_SUPPORTED,
ewmh->_NET_SUPPORTING_WM_CHECK,
ewmh->_NET_DESKTOP_NAMES,
ewmh->_NET_NUMBER_OF_DESKTOPS,
ewmh->_NET_CURRENT_DESKTOP,
@ -213,6 +214,7 @@ void setup(void)
ewmh->_NET_WM_WINDOW_TYPE_TOOLBAR};
xcb_ewmh_set_supported(ewmh, default_screen, LENGTH(net_atoms), net_atoms);
ewmh_set_supporting();
xcb_intern_atom_reply_t *iar = xcb_intern_atom_reply(dpy, xcb_intern_atom(dpy, 0, strlen("_COMPTON_SHADOW"), "_COMPTON_SHADOW"), NULL);

14
ewmh.c
View file

@ -1,5 +1,6 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <xcb/xcb_ewmh.h>
#include "types.h"
#include "bspwm.h"
@ -16,8 +17,10 @@ void ewmh_init(void)
void ewmh_update_wm_name(void)
{
if (wm_name != NULL)
if (wm_name != NULL) {
xcb_ewmh_set_wm_name(ewmh, root, strlen(wm_name), wm_name);
xcb_ewmh_set_wm_name(ewmh, motion_recorder, strlen(wm_name), wm_name);
}
}
void ewmh_update_active_window(void)
@ -111,3 +114,12 @@ void ewmh_update_client_list(void)
xcb_ewmh_set_client_list(ewmh, default_screen, num_clients, wins);
xcb_ewmh_set_client_list_stacking(ewmh, default_screen, num_clients, wins);
}
void ewmh_set_supporting(void)
{
pid_t wm_pid = getpid();
xcb_ewmh_set_supporting_wm_check(ewmh, root, motion_recorder);
xcb_ewmh_set_supporting_wm_check(ewmh, motion_recorder, motion_recorder);
xcb_ewmh_set_wm_name(ewmh, motion_recorder, strlen(WM_NAME), WM_NAME);
xcb_ewmh_set_wm_pid(ewmh, motion_recorder, wm_pid);
}

1
ewmh.h
View file

@ -15,5 +15,6 @@ void ewmh_update_current_desktop(void);
void ewmh_set_wm_desktop(node_t *, desktop_t *);
void ewmh_update_desktop_names(void);
void ewmh_update_client_list(void);
void ewmh_set_supporting(void);
#endif