diff --git a/src/x11/x.c b/src/x11/x.c index 881b1af..0f38487 100644 --- a/src/x11/x.c +++ b/src/x11/x.c @@ -730,6 +730,7 @@ static void x_win_move(int width, int height) int x, y; screen_info *scr = get_active_screen(); + xctx.cur_screen = scr->scr; /* calculate window position */ if (xctx.geometry.mask & XNegative) { x = (scr->dim.x + (scr->dim.w - width)) + xctx.geometry.x; @@ -908,9 +909,17 @@ gboolean x_mainloop_fd_dispatch(GSource *source, GSourceFunc callback, gpointer break; case FocusIn: case FocusOut: - case PropertyNotify: wake_up(); break; + case PropertyNotify: + /* Ignore PropertyNotify, when we're still on the + * same screen. PropertyNotify is only neccessary + * to detect a focus change to another screen + */ + if( settings.f_mode != FOLLOW_NONE + && get_active_screen()->scr != xctx.cur_screen) + wake_up(); + break; default: screen_check_event(ev); break; diff --git a/src/x11/x.h b/src/x11/x.h index 3b08ca4..8ee757a 100644 --- a/src/x11/x.h +++ b/src/x11/x.h @@ -25,6 +25,7 @@ typedef struct _keyboard_shortcut { typedef struct _xctx { Atom utf8; Display *dpy; + int cur_screen; Window win; bool visible; dimension_t geometry;