diff --git a/src/wmspec.c b/src/wmspec.c index c2bb35c0..57a72d16 100644 --- a/src/wmspec.c +++ b/src/wmspec.c @@ -104,6 +104,7 @@ static Atom net_wm_state_hidden; static Atom net_wm_state_fullscreen; static Atom net_wm_state_above; static Atom net_wm_state_below; +static Atom net_wm_state_focused; static Atom net_wm_allowed_actions; static Atom net_wm_action_move; static Atom net_wm_action_resize; @@ -187,6 +188,7 @@ static atomitem_t atomNames[] = { {"_NET_WM_STATE_FULLSCREEN", &net_wm_state_fullscreen}, {"_NET_WM_STATE_ABOVE", &net_wm_state_above}, {"_NET_WM_STATE_BELOW", &net_wm_state_below}, + {"_NET_WM_STATE_FOCUSED", &net_wm_state_focused}, {"_NET_WM_ALLOWED_ACTIONS", &net_wm_allowed_actions}, {"_NET_WM_ACTION_MOVE", &net_wm_action_move}, {"_NET_WM_ACTION_RESIZE", &net_wm_action_resize}, @@ -313,6 +315,7 @@ static void setSupportedHints(WScreen *scr) atom[i++] = net_wm_state_fullscreen; atom[i++] = net_wm_state_above; atom[i++] = net_wm_state_below; + atom[i++] = net_wm_state_focused; atom[i++] = net_wm_allowed_actions; atom[i++] = net_wm_action_move; @@ -1013,6 +1016,8 @@ static void updateStateHint(WWindow *wwin, Bool changedWorkspace, Bool del) state[i++] = net_wm_state_above; if (wwin->flags.fullscreen) state[i++] = net_wm_state_fullscreen; + if (wwin->flags.focused) + state[i++] = net_wm_state_focused; XChangeProperty(dpy, wwin->client_win, net_wm_state, XA_ATOM, 32, PropModeReplace, (unsigned char *)state, i); @@ -1828,8 +1833,9 @@ static void observer(void *self, WMNotification *notif) } else if (strcmp(name, WMNChangedStacking) == 0 && wwin) { updateClientListStacking(wwin->screen_ptr, NULL); updateStateHint(wwin, False, False); - } else if (strcmp(name, WMNChangedFocus) == 0) { + } else if (strcmp(name, WMNChangedFocus) == 0 && wwin) { updateFocusHint(ndata->scr); + updateStateHint(wwin, False, False); } else if (strcmp(name, WMNChangedWorkspace) == 0 && wwin) { updateWorkspaceHint(wwin, False, False); updateStateHint(wwin, True, False);