Disable motion recording as soon as possible

Also, get_pointed_window needs to lower the motion_recorder
window otherwise xcb_query_pointer will return that window as child
attribute.
This commit is contained in:
Bastien Dejean 2013-03-03 21:46:09 +01:00
parent 27204857af
commit ca01046c4e
2 changed files with 4 additions and 0 deletions

2
tree.c
View file

@ -391,6 +391,8 @@ void focus_node(monitor_t *m, desktop_t *d, node_t *n, bool is_mapped)
get_pointed_window(&win);
if (win != n->client->window)
enable_motion_recorder();
else
disable_motion_recorder();
}
if (!is_tiled(n->client)) {

View file

@ -423,11 +423,13 @@ void save_pointer_position(xcb_point_t *pos)
void get_pointed_window(xcb_window_t *win)
{
window_lower(motion_recorder);
xcb_query_pointer_reply_t *qpr = xcb_query_pointer_reply(dpy, xcb_query_pointer(dpy, root), NULL);
if (qpr != NULL) {
*win = qpr->child;
free(qpr);
}
window_raise(motion_recorder);
}
void window_focus(xcb_window_t win)