Bugfix: Recognize clicks as client clicks (opposed to border_clicks) when clients send them for their parent window

See comment, happened for example with xfontsel. You normally got
to see the resize bar (when having >1 column, of course).
This commit is contained in:
Michael Stapelberg 2009-08-04 22:47:42 +02:00
parent 4c373c2128
commit af3972aa9f
2 changed files with 14 additions and 0 deletions

View File

@ -354,6 +354,18 @@ int handle_button_press(void *ignored, xcb_connection_t *conn, xcb_button_press_
LOG("event->event_x = %d, client->rect.width = %d\n", event->event_x, client->rect.width); LOG("event->event_x = %d, client->rect.width = %d\n", event->event_x, client->rect.width);
/* Some clients (xfontsel for example) seem to pass clicks on their
* window to the parent window, thus we receive an event here which in
* reality is a border_click. Check for the position and fix state. */
if (border_click &&
event->event_x >= client->child_rect.x &&
event->event_x <= (client->child_rect.x + client->child_rect.width) &&
event->event_y >= client->child_rect.y &&
event->event_y <= (client->child_rect.y + client->child_rect.height)) {
LOG("Fixing border_click = false because of click in child\n");
border_click = false;
}
if (!border_click) { if (!border_click) {
LOG("client. done.\n"); LOG("client. done.\n");
xcb_allow_events(conn, XCB_ALLOW_REPLAY_POINTER, event->time); xcb_allow_events(conn, XCB_ALLOW_REPLAY_POINTER, event->time);

View File

@ -43,6 +43,8 @@ int resize_graphical_handler(xcb_connection_t *conn, Workspace *ws, int first, i
return 1; return 1;
} }
LOG("event->event_x = %d, event->root_x = %d\n", event->event_x, event->root_x);
LOG("Screen dimensions: (%d, %d) %d x %d\n", screen->rect.x, screen->rect.y, screen->rect.width, screen->rect.height); LOG("Screen dimensions: (%d, %d) %d x %d\n", screen->rect.x, screen->rect.y, screen->rect.width, screen->rect.height);
/* FIXME: horizontal resizing causes empty spaces to exist */ /* FIXME: horizontal resizing causes empty spaces to exist */