]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Recognize clicks as client clicks (opposed to border_clicks) when clients...
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 4 Aug 2009 20:47:42 +0000 (22:47 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 4 Aug 2009 20:47:42 +0000 (22:47 +0200)
See comment, happened for example with xfontsel. You normally got
to see the resize bar (when having >1 column, of course).

src/handlers.c
src/resize.c

index a667628c423a694fda1643e7a232af1f505466be..ee47141acd97806dbba41bad299085e589f5fbbc 100644 (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);
 
+        /* 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);
index 52b064b4fd0887421041716154a92fdbecc247a2..09a8d083ac0605466bd19ead5f23927018e7b8aa 100644 (file)
@@ -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 */