More log cleanups

This commit is contained in:
Michael Stapelberg
2009-08-11 15:23:58 +02:00
parent 556f180290
commit 44d9111d65
9 changed files with 18 additions and 67 deletions

View File

@ -48,8 +48,6 @@ static void add_ignore_event(const int sequence) {
event->sequence = sequence;
event->added = time(NULL);
LOG("Adding sequence %d to ignorelist\n", sequence);
SLIST_INSERT_HEAD(&ignore_events, event, ignore_events);
}
@ -71,7 +69,6 @@ static bool event_is_ignored(const int sequence) {
SLIST_FOREACH(event, &ignore_events, ignore_events) {
if (event->sequence == sequence) {
LOG("Ignoring event (sequence %d)\n", sequence);
SLIST_REMOVE(&ignore_events, event, Ignore_Event, ignore_events);
free(event);
return true;
@ -87,7 +84,6 @@ static bool event_is_ignored(const int sequence) {
*
*/
int handle_key_release(void *ignored, xcb_connection_t *conn, xcb_key_release_event_t *event) {
LOG("got key release, just passing\n");
xcb_allow_events(conn, XCB_ALLOW_REPLAY_KEYBOARD, event->time);
xcb_flush(conn);
return 1;
@ -608,13 +604,12 @@ int handle_configure_request(void *prophs, xcb_connection_t *conn, xcb_configure
int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_notify_event_t *event) {
xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root;
LOG("event->x = %d, ->y = %d, ->width = %d, ->height = %d\n", event->x, event->y, event->width, event->height);
/* We ignore this sequence twice because events for child and frame should be ignored */
add_ignore_event(event->sequence);
add_ignore_event(event->sequence);
if (event->event == root) {
LOG("event->x = %d, ->y = %d, ->width = %d, ->height = %d\n", event->x, event->y, event->width, event->height);
LOG("reconfigure of the root window, need to xinerama\n");
/* FIXME: Somehow, this is occuring too often. Therefore, we check for 0/0,
but is there a better way? */
@ -640,7 +635,6 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
/* 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) {
LOG("Dropping this unmap request, it was generated by reparenting\n");
client->awaiting_useless_unmap = false;
return 1;
}
@ -877,10 +871,8 @@ int handle_windowclass_change(void *data, xcb_connection_t *conn, uint8_t state,
client->window_class = new_class;
FREE(old_class);
if (!client->initialized) {
LOG("Client is not yet initialized, not putting it to floating\n");
if (!client->initialized)
return 1;
}
if (strcmp(new_class, "tools") == 0 || strcmp(new_class, "Dialog") == 0) {
LOG("tool/dialog window, should we put it floating?\n");
@ -1007,7 +999,7 @@ int handle_normal_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_w
}
xcb_size_hints_t size_hints;
client_log(client);
CLIENT_LOG(client);
/* If the hints were already in this event, use them, if not, request them */
if (reply != NULL)
@ -1016,7 +1008,8 @@ int handle_normal_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_w
xcb_get_wm_normal_hints_reply(conn, xcb_get_wm_normal_hints_unchecked(conn, client->child), &size_hints, NULL);
if ((size_hints.flags & XCB_SIZE_HINT_P_MIN_SIZE)) {
LOG("Minimum size: %d (width) x %d (height)\n", size_hints.min_width, size_hints.min_height);
// TODO: Minimum size is not yet implemented
//LOG("Minimum size: %d (width) x %d (height)\n", size_hints.min_width, size_hints.min_height);
}
if ((size_hints.flags & XCB_SIZE_HINT_P_RESIZE_INC)) {
@ -1024,9 +1017,6 @@ int handle_normal_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_w
client->width_increment = size_hints.width_inc;
if (size_hints.height_inc > 0)
client->height_increment = size_hints.height_inc;
LOG("Updated client's width_increment to %d px, heigh_increment to %d px\n",
client->width_increment, client->height_increment);
}
/* If no aspect ratio was set or if it was invalid, we ignore the hints */
@ -1132,7 +1122,7 @@ int handle_clientleader_change(void *data, xcb_connection_t *conn, uint8_t state
return 1;
xcb_window_t *leader = xcb_get_property_value(prop);
if (leader == NULL)
if (leader == NULL || *leader == 0)
return 1;
LOG("Client leader changed to %08x\n", *leader);