From: Michael Stapelberg Date: Tue, 4 Aug 2009 20:47:42 +0000 (+0200) Subject: Bugfix: Recognize clicks as client clicks (opposed to border_clicks) when clients... X-Git-Tag: 3.c~31 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=af3972aa9fd691a9723bb816a954704d50794ad6;p=i3%2Fi3 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). --- diff --git a/src/handlers.c b/src/handlers.c index a667628c..ee47141a 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -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); + /* 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) { LOG("client. done.\n"); xcb_allow_events(conn, XCB_ALLOW_REPLAY_POINTER, event->time); diff --git a/src/resize.c b/src/resize.c index 52b064b4..09a8d083 100644 --- a/src/resize.c +++ b/src/resize.c @@ -43,6 +43,8 @@ int resize_graphical_handler(xcb_connection_t *conn, Workspace *ws, int first, i 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); /* FIXME: horizontal resizing causes empty spaces to exist */