Bugfix: Redecorate the last focused window of the container we are switching into

This commit is contained in:
Michael Stapelberg 2009-03-11 00:56:39 +01:00
parent ec290cbfa9
commit 9c0d5b6e5e
1 changed files with 14 additions and 3 deletions

View File

@ -171,9 +171,9 @@ char *convert_utf8_to_ucs2(char *input, int *real_strlen) {
/* Convert our text */ /* Convert our text */
int rc = iconv(conversion_descriptor, (void*)&input, &input_size, &output, &output_size); int rc = iconv(conversion_descriptor, (void*)&input, &input_size, &output, &output_size);
if (rc == (size_t)-1) { if (rc == (size_t)-1) {
fprintf(stderr, "Converting to UCS-2 failed\n"); perror("Converting to UCS-2 failed");
perror("erron\n"); *real_strlen = 0;
exit(1); return NULL;
} }
*real_strlen = ((buffer_size - output_size) / 2) - 1; *real_strlen = ((buffer_size - output_size) / 2) - 1;
@ -231,6 +231,17 @@ void set_focus(xcb_connection_t *conn, Client *client) {
xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, client->child, XCB_CURRENT_TIME); xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, client->child, XCB_CURRENT_TIME);
//xcb_warp_pointer(conn, XCB_NONE, client->child, 0, 0, 0, 0, 10, 10); //xcb_warp_pointer(conn, XCB_NONE, client->child, 0, 0, 0, 0, 10, 10);
/* Get the client which was last focused in this particular container, it may be a different
one than old_client */
Client *last_container_client;
SLIST_FOREACH(last_container_client, &(c_ws->focus_stack), focus_clients)
if (last_container_client->container == client->container) {
/* But if it is the same one as old_client, we save us the unnecessary redecorate */
if (last_container_client != old_client)
redecorate_window(conn, last_container_client);
break;
}
/* If were in stacking mode, this renders the container to update changes in the title /* If were in stacking mode, this renders the container to update changes in the title
bars and to raise the focused client */ bars and to raise the focused client */
if ((old_client != NULL) && (old_client != client) && !old_client->dock) if ((old_client != NULL) && (old_client != client) && !old_client->dock)