if (fi.xfocus.window == e->xfocus.window)
return;
}
- }
+ } else if (window == focus_backup && focus_client != NULL)
+ /* Something's focused but we got a focus event for the backup
+ window. this means that something unfocused before we received
+ the new FocusIn. Just ignore it. */
+ return;
break;
case EnterNotify:
case LeaveNotify:
}
client = g_hash_table_lookup(client_map, (gpointer)window);
- g_message("EVENT: 0x%lx -> 0x%lx", window, client);
/* deal with it in the kernel */
if (client)
switch (e->type) {
case FocusIn:
- client_set_focused(client, TRUE);
+ if (focus_client != client)
+ focus_set_client(client);
+
+ /* focus state can affect the stacking layer */
+ client_calc_layer(client);
+
+ engine_frame_adjust_focus(client->frame);
break;
case FocusOut:
- client_set_focused(client, FALSE);
+ if (focus_client == client)
+ focus_set_client(NULL);
+
+ /* focus state can affect the stacking layer */
+ client_calc_layer(client);
+
+ engine_frame_adjust_focus(client->frame);
break;
case ConfigureRequest:
g_message("ConfigureRequest for window %lx", client->window);