c->locked = c->sticky = c->urgent = c->private = c->icccm_focus = false;
xcb_icccm_get_wm_protocols_reply_t protocols;
if (xcb_icccm_get_wm_protocols_reply(dpy, xcb_icccm_get_wm_protocols(dpy, win, ewmh->WM_PROTOCOLS), &protocols, NULL) == 1) {
- if (has_proto(WM_TAKE_FOCUS, &protocols))
+ if (has_proto(WM_TAKE_FOCUS, &protocols)) {
c->icccm_focus = true;
+ }
xcb_icccm_get_wm_protocols_reply_wipe(&protocols);
}
c->num_states = 0;
if (n == NULL) {
clear_input_focus();
} else {
- if (n->client->icccm_focus)
+ if (n->client->icccm_focus && strstr(ICCCM_FOCUS_EXCEPTIONS, n->client->class_name) == NULL) {
send_client_message(n->client->window, ewmh->WM_PROTOCOLS, WM_TAKE_FOCUS);
- xcb_set_input_focus(dpy, XCB_INPUT_FOCUS_POINTER_ROOT, n->client->window, XCB_CURRENT_TIME);
+ } else {
+ xcb_set_input_focus(dpy, XCB_INPUT_FOCUS_POINTER_ROOT, n->client->window, XCB_CURRENT_TIME);
+ }
}
}
#ifndef BSPWM_WINDOW_H
#define BSPWM_WINDOW_H
+/* A comma separated list of class names of programs that include the WM_FOCUS
+ * atom in their WM_PROTOCOLS property but don't handle the corresponding
+ * client message */
+#define ICCCM_FOCUS_EXCEPTIONS "Skype"
+
#include <stdarg.h>
#include <xcb/xcb.h>
#include <xcb/xcb_event.h>