Don’t rely on libxcb-wm any longer, as it got removed in libxcb 0.3.4

See http://cgit.freedesktop.org/xcb/util/commit/?id=4c9a707f472e49bc3005354db265a0214071d46b
This commit is contained in:
Michael Stapelberg
2009-04-19 20:44:34 +02:00
parent 22e0ea5141
commit 982e453251
7 changed files with 114 additions and 25 deletions

View File

@ -15,7 +15,7 @@
#include <time.h>
#include <xcb/xcb.h>
#include <xcb/xcb_wm.h>
#include <xcb/xcb_atom.h>
#include <xcb/xcb_icccm.h>
#include <X11/XKBlib.h>
@ -149,10 +149,10 @@ int handle_enter_notify(void *ignored, xcb_connection_t *conn, xcb_enter_notify_
return 1;
/* This was either a focus for a clients parent (= titlebar)… */
Client *client = table_get(byParent, event->event);
Client *client = table_get(&by_parent, event->event);
/* …or the client itself */
if (client == NULL)
client = table_get(byChild, event->event);
client = table_get(&by_child, event->event);
/* Check for stack windows */
if (client == NULL) {
@ -279,10 +279,10 @@ static bool button_press_bar(xcb_connection_t *conn, xcb_button_press_event_t *e
int handle_button_press(void *ignored, xcb_connection_t *conn, xcb_button_press_event_t *event) {
LOG("button press!\n");
/* This was either a focus for a clients parent (= titlebar)… */
Client *client = table_get(byChild, event->event);
Client *client = table_get(&by_child, event->event);
bool border_click = false;
if (client == NULL) {
client = table_get(byParent, event->event);
client = table_get(&by_parent, event->event);
border_click = true;
}
if (client == NULL) {
@ -534,7 +534,7 @@ int handle_configure_request(void *prophs, xcb_connection_t *conn, xcb_configure
LOG("event->window = %08x\n", event->window);
LOG("application wants to be at %dx%d with %dx%d\n", event->x, event->y, event->width, event->height);
Client *client = table_get(byChild, event->window);
Client *client = table_get(&by_child, event->window);
if (client == NULL) {
LOG("This client is not mapped, so we don't care and just tell the client that he will get its size\n");
Rect rect = {event->x, event->y, event->width, event->height};
@ -582,7 +582,7 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
add_ignore_event(event->sequence);
Client *client = table_get(byChild, event->window);
Client *client = table_get(&by_child, 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) {
@ -598,7 +598,7 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
return 0;
}
client = table_remove(byChild, event->window);
client = table_remove(&by_child, event->window);
if (client->name != NULL)
free(client->name);
@ -630,7 +630,7 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
xcb_reparent_window(conn, client->child, root, 0, 0);
xcb_destroy_window(conn, client->frame);
xcb_flush(conn);
table_remove(byParent, client->frame);
table_remove(&by_parent, client->frame);
if (client->container != NULL) {
cleanup_table(conn, client->container->workspace);
@ -673,7 +673,7 @@ int handle_windowname_change(void *data, xcb_connection_t *conn, uint8_t state,
LOG("_NET_WM_NAME not specified, not changing\n");
return 1;
}
Client *client = table_get(byChild, window);
Client *client = table_get(&by_child, window);
if (client == NULL)
return 1;
@ -736,7 +736,7 @@ int handle_windowname_change_legacy(void *data, xcb_connection_t *conn, uint8_t
LOG("prop == NULL\n");
return 1;
}
Client *client = table_get(byChild, window);
Client *client = table_get(&by_child, window);
if (client == NULL)
return 1;
@ -793,7 +793,7 @@ int handle_expose_event(void *data, xcb_connection_t *conn, xcb_expose_event_t *
return 1;
LOG("window = %08x\n", event->window);
Client *client = table_get(byParent, event->window);
Client *client = table_get(&by_parent, 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. */
@ -861,7 +861,7 @@ int handle_client_message(void *data, xcb_connection_t *conn, xcb_client_message
LOG("fullscreen\n");
Client *client = table_get(byChild, event->window);
Client *client = table_get(&by_child, event->window);
if (client == NULL)
return 0;
@ -899,7 +899,7 @@ int handle_window_type(void *data, xcb_connection_t *conn, uint8_t state, xcb_wi
int handle_normal_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window,
xcb_atom_t name, xcb_get_property_reply_t *reply) {
LOG("handle_normal_hints\n");
Client *client = table_get(byChild, window);
Client *client = table_get(&by_child, window);
if (client == NULL) {
LOG("No such client\n");
return 1;