Revert "Bugfix: Ignore enter_notify when warping pointer (makes "goto" work correctly)"
This reverts commit 7d6e80b5ef
.
Instead fix it by setting focus correctly before causig the warp.
This commit is contained in:
parent
78d4d18477
commit
a6d22f005d
|
@ -13,14 +13,6 @@
|
||||||
|
|
||||||
#include <xcb/randr.h>
|
#include <xcb/randr.h>
|
||||||
|
|
||||||
/**
|
|
||||||
* 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
|
* There was a key press. We compare this key code with our bindings table and
|
||||||
* pass the bound action to parse_command().
|
* pass the bound action to parse_command().
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "handlers.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Removes the given client from the container, either because it will be inserted into another
|
* 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) {
|
void client_warp_pointer_into(xcb_connection_t *conn, Client *client) {
|
||||||
int mid_x = client->rect.width / 2,
|
int mid_x = client->rect.width / 2,
|
||||||
mid_y = client->rect.height / 2;
|
mid_y = client->rect.height / 2;
|
||||||
xcb_void_cookie_t cookie;
|
xcb_warp_pointer(conn, XCB_NONE, client->child, 0, 0, 0, 0, mid_x, mid_y);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -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)
|
if (current->mark == NULL || strcmp(current->mark, mark) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
workspace_show(conn, current->workspace->num + 1);
|
|
||||||
set_focus(conn, current, true);
|
set_focus(conn, current, true);
|
||||||
|
workspace_show(conn, current->workspace->num + 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,13 +46,7 @@
|
||||||
changing workspaces */
|
changing workspaces */
|
||||||
static SLIST_HEAD(ignore_head, Ignore_Event) ignore_events;
|
static SLIST_HEAD(ignore_head, Ignore_Event) ignore_events;
|
||||||
|
|
||||||
/*
|
static void add_ignore_event(const int sequence) {
|
||||||
* 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) {
|
|
||||||
struct Ignore_Event *event = smalloc(sizeof(struct Ignore_Event));
|
struct Ignore_Event *event = smalloc(sizeof(struct Ignore_Event));
|
||||||
|
|
||||||
event->sequence = sequence;
|
event->sequence = sequence;
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "ewmh.h"
|
#include "ewmh.h"
|
||||||
#include "ipc.h"
|
#include "ipc.h"
|
||||||
#include "handlers.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns a pointer to the workspace with the given number (starting at 0),
|
* 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;
|
need_warp = true;
|
||||||
else {
|
else {
|
||||||
Rect *dims = &(c_ws->output->rect);
|
Rect *dims = &(c_ws->output->rect);
|
||||||
xcb_void_cookie_t cookie;
|
xcb_warp_pointer(conn, XCB_NONE, root, 0, 0, 0, 0,
|
||||||
cookie = xcb_warp_pointer(conn, XCB_NONE, root, 0, 0, 0, 0,
|
|
||||||
dims->x + (dims->width / 2), dims->y + (dims->height / 2));
|
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 */
|
/* Re-decorate the old client, it’s not focused anymore */
|
||||||
|
|
Loading…
Reference in New Issue