Bugfix: Check screen for NULL, free client memory correctly (Thanks dirkson)
This commit is contained in:
parent
61b1279f67
commit
675d28dd54
|
@ -578,9 +578,6 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
|
||||||
|
|
||||||
client = table_remove(&by_child, event->window);
|
client = table_remove(&by_child, event->window);
|
||||||
|
|
||||||
if (client->name != NULL)
|
|
||||||
free(client->name);
|
|
||||||
|
|
||||||
/* Clients without a container are either floating or dock windows */
|
/* Clients without a container are either floating or dock windows */
|
||||||
if (client->container != NULL) {
|
if (client->container != NULL) {
|
||||||
Container *con = client->container;
|
Container *con = client->container;
|
||||||
|
@ -644,6 +641,8 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
|
||||||
client->workspace->screen = NULL;
|
client->workspace->screen = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FREE(client->window_class);
|
||||||
|
FREE(client->name);
|
||||||
free(client);
|
free(client);
|
||||||
|
|
||||||
render_layout(conn);
|
render_layout(conn);
|
||||||
|
|
|
@ -188,6 +188,11 @@ void reposition_client(xcb_connection_t *conn, Client *client) {
|
||||||
if (client->workspace->screen == (screen = get_screen_containing(client->rect.x, client->rect.y)))
|
if (client->workspace->screen == (screen = get_screen_containing(client->rect.x, client->rect.y)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (screen == NULL) {
|
||||||
|
LOG("Boundary checking disabled, no screen found for (%d, %d)\n", client->rect.x, client->rect.y);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LOG("Client is on workspace %p with screen %p\n", client->workspace, client->workspace->screen);
|
LOG("Client is on workspace %p with screen %p\n", client->workspace, client->workspace->screen);
|
||||||
LOG("but screen at %d, %d is %p\n", client->rect.x, client->rect.y, screen);
|
LOG("but screen at %d, %d is %p\n", client->rect.x, client->rect.y, screen);
|
||||||
floating_assign_to_workspace(client, &workspaces[screen->current_workspace]);
|
floating_assign_to_workspace(client, &workspaces[screen->current_workspace]);
|
||||||
|
|
Loading…
Reference in New Issue