From: Michael Stapelberg Date: Sat, 27 Mar 2010 16:51:28 +0000 (+0100) Subject: Revert "Bugfix: Ignore enter_notify when warping pointer (makes "goto" work correctly)" X-Git-Tag: 3.e~6^2~3 X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3;a=commitdiff_plain;h=a6d22f005dd29a3391c52425ec316bfaf0177c73 Revert "Bugfix: Ignore enter_notify when warping pointer (makes "goto" work correctly)" This reverts commit 7d6e80b5ef8656bf35a8dc7471d36ad64ef279fb. Instead fix it by setting focus correctly before causig the warp. --- diff --git a/include/handlers.h b/include/handlers.h index 7d0662e1..c7cbb322 100644 --- a/include/handlers.h +++ b/include/handlers.h @@ -13,14 +13,6 @@ #include -/** - * Adds the sequence number of an event to the ignored events. - * Useful to ignore for example the enter notify caused by a pointer warp of - * i3. - * - */ -void add_ignore_event(const int sequence); - /** * There was a key press. We compare this key code with our bindings table and * pass the bound action to parse_command(). diff --git a/src/client.c b/src/client.c index ba3babe0..9c136ca6 100644 --- a/src/client.c +++ b/src/client.c @@ -29,7 +29,6 @@ #include "workspace.h" #include "config.h" #include "log.h" -#include "handlers.h" /* * Removes the given client from the container, either because it will be inserted into another @@ -63,12 +62,7 @@ void client_remove_from_container(xcb_connection_t *conn, Client *client, Contai void client_warp_pointer_into(xcb_connection_t *conn, Client *client) { int mid_x = client->rect.width / 2, mid_y = client->rect.height / 2; - xcb_void_cookie_t cookie; - cookie = xcb_warp_pointer(conn, XCB_NONE, client->child, 0, 0, 0, 0, mid_x, mid_y); - /* We need to add this event twice because we get one enter_notify for - * the child and one for the frame */ - add_ignore_event(cookie.sequence); - add_ignore_event(cookie.sequence); + xcb_warp_pointer(conn, XCB_NONE, client->child, 0, 0, 0, 0, mid_x, mid_y); } /* diff --git a/src/commands.c b/src/commands.c index c0cb8782..b2649bee 100644 --- a/src/commands.c +++ b/src/commands.c @@ -73,8 +73,8 @@ static void jump_to_mark(xcb_connection_t *conn, const char *mark) { if (current->mark == NULL || strcmp(current->mark, mark) != 0) continue; - workspace_show(conn, current->workspace->num + 1); set_focus(conn, current, true); + workspace_show(conn, current->workspace->num + 1); return; } diff --git a/src/handlers.c b/src/handlers.c index 5eddf244..624c3430 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -46,13 +46,7 @@ changing workspaces */ static SLIST_HEAD(ignore_head, Ignore_Event) ignore_events; -/* - * Adds the sequence number of an event to the ignored events. - * Useful to ignore for example the enter notify caused by a pointer warp of - * i3. - * - */ -void add_ignore_event(const int sequence) { +static void add_ignore_event(const int sequence) { struct Ignore_Event *event = smalloc(sizeof(struct Ignore_Event)); event->sequence = sequence; diff --git a/src/workspace.c b/src/workspace.c index 2798687d..c950df8f 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -29,7 +29,6 @@ #include "log.h" #include "ewmh.h" #include "ipc.h" -#include "handlers.h" /* * Returns a pointer to the workspace with the given number (starting at 0), @@ -140,10 +139,8 @@ void workspace_show(xcb_connection_t *conn, int workspace) { need_warp = true; else { Rect *dims = &(c_ws->output->rect); - xcb_void_cookie_t cookie; - cookie = xcb_warp_pointer(conn, XCB_NONE, root, 0, 0, 0, 0, + xcb_warp_pointer(conn, XCB_NONE, root, 0, 0, 0, 0, dims->x + (dims->width / 2), dims->y + (dims->height / 2)); - add_ignore_event(cookie.sequence); } /* Re-decorate the old client, it’s not focused anymore */