diff options
-rw-r--r-- | src/core/atomnames.h | 1 | ||||
-rw-r--r-- | src/core/window.c | 23 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/core/atomnames.h b/src/core/atomnames.h index cda2e33a..8e149060 100644 --- a/src/core/atomnames.h +++ b/src/core/atomnames.h @@ -158,6 +158,7 @@ item(_NET_WM_ACTION_ABOVE) item(_NET_WM_ACTION_BELOW) item(_NET_WM_STATE_STICKY) item(_NET_WM_FULLSCREEN_MONITORS) +item(_NET_WM_STATE_FOCUSED) #if 0 /* We apparently never use: */ diff --git a/src/core/window.c b/src/core/window.c index 3f6314d6..abd5af4b 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -1259,7 +1259,7 @@ static void set_net_wm_state (MetaWindow *window) { int i; - unsigned long data[12]; + unsigned long data[13]; i = 0; if (window->shaded) @@ -1322,6 +1322,11 @@ set_net_wm_state (MetaWindow *window) data[i] = window->display->atom__NET_WM_STATE_STICKY; ++i; } + if (window->has_focus) + { + data[i] = window->display->atom__NET_WM_STATE_FOCUSED; + ++i; + } meta_verbose ("Setting _NET_WM_STATE with %d atoms\n", i); @@ -5490,6 +5495,15 @@ meta_window_client_message (MetaWindow *window, return FALSE; } +static void +meta_window_appears_focused_changed (MetaWindow *window) +{ + set_net_wm_state (window); + + if (window->frame) + meta_frame_queue_draw (window->frame); +} + gboolean meta_window_notify_focus (MetaWindow *window, XEvent *event) @@ -5599,8 +5613,7 @@ meta_window_notify_focus (MetaWindow *window, window); } - if (window->frame) - meta_frame_queue_draw (window->frame); + meta_window_appears_focused_changed (window); meta_error_trap_push (window->display); XInstallColormap (window->display->xdisplay, @@ -5652,8 +5665,8 @@ meta_window_notify_focus (MetaWindow *window, window->display->focus_window = NULL; window->has_focus = FALSE; - if (window->frame) - meta_frame_queue_draw (window->frame); + + meta_window_appears_focused_changed (window); meta_compositor_set_active_window (window->display->compositor, window->screen, NULL); |