*
*/
static void change_ewmh_focus(xcb_window_t new_focus, xcb_window_t old_focus) {
+ if (new_focus == old_focus) {
+ return;
+ }
+
ewmh_update_active_window(new_focus);
if (new_focus != XCB_WINDOW_NONE) {
fresh_workspace;
$windowA = open_window;
-
ok(is_net_wm_state_focused($windowA), 'a newly opened window that is focused should have _NET_WM_STATE_FOCUSED set');
$windowB = open_window;
-
ok(!is_net_wm_state_focused($windowA), 'when a another window is focused, the old window should not have _NET_WM_STATE_FOCUSED set');
+ok(is_net_wm_state_focused($windowB), 'a newly opened window that is focused should have _NET_WM_STATE_FOCUSED set');
-fresh_workspace;
+# See issue #3495.
+cmd 'kill';
+ok(is_net_wm_state_focused($windowA), 'when the second window is closed, the first window should have _NET_WM_STATE_FOCUSED set');
-ok(!is_net_wm_state_focused($windowB), 'when focus moves to the ewmh support window, neither window should have _NET_WM_STATE_FOCUSED set');
+fresh_workspace;
+ok(!is_net_wm_state_focused($windowA), 'when focus moves to the ewmh support window, no window should have _NET_WM_STATE_FOCUSED set');
done_testing;