diff options
author | Bastien Nocera <hadess@hadess.net> | 2011-09-05 14:42:01 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2011-09-05 14:43:37 +0100 |
commit | 5a4eee111fb6af3fdd215394feee721e59a8e1cb (patch) | |
tree | a0e6bc2b5b285f19cf9f7e9c9a91f1a698dc0698 | |
parent | b568b23638af1384f068e7c03805d1ce9ef16500 (diff) | |
download | totem-5a4eee111fb6af3fdd215394feee721e59a8e1cb.tar.gz |
scrsaver: Don't send out X11 events if not focused
Should stop OpenOffice menus popping up.
https://bugzilla.gnome.org/show_bug.cgi?id=654250
-rw-r--r-- | lib/totem-scrsaver.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/totem-scrsaver.c b/lib/totem-scrsaver.c index e3e580e3a..0572610be 100644 --- a/lib/totem-scrsaver.c +++ b/lib/totem-scrsaver.c @@ -273,6 +273,13 @@ fake_event (TotemScrsaver *scr) { if (scr->priv->disabled) { + /* If the video window isn't focused, don't send out the + * events. Note that it probably breaks when popups are used + * but we can't do much about that... */ + if (scr->priv->window != NULL && + gtk_window_has_toplevel_focus (scr->priv->window) == FALSE) + return; + XLockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ())); XTestFakeKeyEvent (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), *scr->priv->keycode, True, CurrentTime); |