Bugfix: Correctly handle unmap, don’t apply attribute XCB_EVENT_MASK_BUTTON_PRESS
Those two fix problems seen with mplayer
This commit is contained in:
@ -299,32 +299,29 @@ int handle_map_notify_event(void *prophs, xcb_connection_t *conn, xcb_map_notify
|
||||
*
|
||||
*/
|
||||
int handle_unmap_notify_event(void *data, xcb_connection_t *c, xcb_unmap_notify_event_t *e) {
|
||||
Client *client = table_remove(byChild, e->event);
|
||||
xcb_window_t root;
|
||||
xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(c)).data->root;
|
||||
|
||||
Client *client = table_get(byChild, e->window);
|
||||
/* First, we need to check if the client is awaiting an unmap-request which
|
||||
was generated by us reparenting the window. In that case, we just ignore it. */
|
||||
if (client != NULL && client->awaiting_useless_unmap) {
|
||||
printf("Dropping this unmap request, it was generated by reparenting\n");
|
||||
client->awaiting_useless_unmap = false;
|
||||
return 1;
|
||||
}
|
||||
client = table_remove(byChild, e->window);
|
||||
|
||||
printf("UnmapNotify for 0x%08x (received from 0x%08x): ", e->window, e->event);
|
||||
if(!client)
|
||||
{
|
||||
if(client == NULL) {
|
||||
printf("not a managed window. Ignoring.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rows, cols;
|
||||
Client *con_client;
|
||||
/* TODO: clear this up */
|
||||
for (cols = 0; cols < c_ws->cols; cols++)
|
||||
for (rows = 0; rows < c_ws->rows; rows++)
|
||||
CIRCLEQ_FOREACH(con_client, &(CUR_TABLE[cols][rows]->clients), clients)
|
||||
if (con_client == client) {
|
||||
printf("removing from container\n");
|
||||
if (client->container->currently_focused == client)
|
||||
client->container->currently_focused = NULL;
|
||||
CIRCLEQ_REMOVE(&(CUR_TABLE[cols][rows]->clients), con_client, clients);
|
||||
break;
|
||||
}
|
||||
|
||||
if (client->container->currently_focused == client)
|
||||
client->container->currently_focused = NULL;
|
||||
CIRCLEQ_REMOVE(&(client->container->clients), client, clients);
|
||||
|
||||
|
||||
root = xcb_setup_roots_iterator(xcb_get_setup(c)).data->root;
|
||||
printf("child of 0x%08x.\n", client->frame);
|
||||
xcb_reparent_window(c, client->child, root, 0, 0);
|
||||
xcb_destroy_window(c, client->frame);
|
||||
|
Reference in New Issue
Block a user