Use "conn" for xcb_connection and "event" for xcb_event_* variables everywhere
This commit is contained in:
@ -392,12 +392,12 @@ int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_n
|
||||
* so we better clean up before.
|
||||
*
|
||||
*/
|
||||
int handle_unmap_notify_event(void *data, xcb_connection_t *c, xcb_unmap_notify_event_t *e) {
|
||||
xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(c)).data->root;
|
||||
int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_notify_event_t *event) {
|
||||
xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root;
|
||||
|
||||
ignore_notify_event = e->sequence;
|
||||
ignore_notify_event = event->sequence;
|
||||
|
||||
Client *client = table_get(byChild, e->window);
|
||||
Client *client = table_get(byChild, event->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) {
|
||||
@ -405,9 +405,9 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *c, xcb_unmap_notify_
|
||||
client->awaiting_useless_unmap = false;
|
||||
return 1;
|
||||
}
|
||||
client = table_remove(byChild, e->window);
|
||||
client = table_remove(byChild, event->window);
|
||||
|
||||
printf("UnmapNotify for 0x%08x (received from 0x%08x): ", e->window, e->event);
|
||||
printf("UnmapNotify for 0x%08x (received from 0x%08x): ", event->window, event->event);
|
||||
if (client == NULL) {
|
||||
printf("not a managed window. Ignoring.\n");
|
||||
return 0;
|
||||
@ -437,7 +437,7 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *c, xcb_unmap_notify_
|
||||
if (con->currently_focused == NULL && con->mode == MODE_STACK) {
|
||||
struct Stack_Window *stack_win = &(con->stack_win);
|
||||
stack_win->height = 0;
|
||||
xcb_unmap_window(c, stack_win->window);
|
||||
xcb_unmap_window(conn, stack_win->window);
|
||||
}
|
||||
|
||||
/* Remove the client from the list of clients */
|
||||
@ -445,20 +445,20 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *c, xcb_unmap_notify_
|
||||
|
||||
/* Actually set focus, if there is a window which should get it */
|
||||
if (to_focus != NULL)
|
||||
set_focus(c, to_focus);
|
||||
set_focus(conn, to_focus);
|
||||
}
|
||||
|
||||
printf("child of 0x%08x.\n", client->frame);
|
||||
xcb_reparent_window(c, client->child, root, 0, 0);
|
||||
xcb_destroy_window(c, client->frame);
|
||||
xcb_flush(c);
|
||||
xcb_reparent_window(conn, client->child, root, 0, 0);
|
||||
xcb_destroy_window(conn, client->frame);
|
||||
xcb_flush(conn);
|
||||
table_remove(byParent, client->frame);
|
||||
|
||||
cleanup_table(c, client->container->workspace);
|
||||
cleanup_table(conn, client->container->workspace);
|
||||
|
||||
free(client);
|
||||
|
||||
render_layout(c);
|
||||
render_layout(conn);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -491,20 +491,20 @@ int handle_windowname_change(void *data, xcb_connection_t *conn, uint8_t state,
|
||||
* Expose event means we should redraw our windows (= title bar)
|
||||
*
|
||||
*/
|
||||
int handle_expose_event(void *data, xcb_connection_t *conn, xcb_expose_event_t *e) {
|
||||
int handle_expose_event(void *data, xcb_connection_t *conn, xcb_expose_event_t *event) {
|
||||
printf("got expose_event\n");
|
||||
/* e->count is the number of minimum remaining expose events for this window, so we
|
||||
/* event->count is the number of minimum remaining expose events for this window, so we
|
||||
skip all events but the last one */
|
||||
if (e->count != 0)
|
||||
if (event->count != 0)
|
||||
return 1;
|
||||
|
||||
Client *client = table_get(byParent, e->window);
|
||||
Client *client = table_get(byParent, event->window);
|
||||
if (client == NULL) {
|
||||
/* There was no client in the table, so this is probably an expose event for
|
||||
one of our stack_windows. */
|
||||
struct Stack_Window *stack_win;
|
||||
SLIST_FOREACH(stack_win, &stack_wins, stack_windows)
|
||||
if (stack_win->window == e->window) {
|
||||
if (stack_win->window == event->window) {
|
||||
render_container(conn, stack_win->container);
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user