diff -up ./gst-plugins-base-0.10.30/sys/xvimage/xvimagesink.c.event ./gst-plugins-base-0.10.30/sys/xvimage/xvimagesink.c
--- ./gst-plugins-base-0.10.30/sys/xvimage/xvimagesink.c.event	2010-11-10 09:36:16.030119738 +0100
+++ ./gst-plugins-base-0.10.30/sys/xvimage/xvimagesink.c	2010-11-12 12:08:28.549178211 +0100
@@ -142,6 +142,10 @@ MotifWmHints, MwmHints;
 
 #define MWM_HINTS_DECORATIONS   (1L << 1)
 
+#define EXPOSE_MASKS   ExposureMask | StructureNotifyMask | VisibilityChangeMask
+#define NAVIGATE_MASKS PointerMotionMask | KeyPressMask | KeyReleaseMask
+#define BUTTON_MASKS   ButtonPressMask | ButtonReleaseMask
+
 static void gst_xvimagesink_reset (GstXvImageSink * xvimagesink);
 
 static GstBufferClass *xvimage_buffer_parent_class = NULL;
@@ -987,9 +991,8 @@ gst_xvimagesink_xwindow_new (GstXvImageS
   if (xvimagesink->handle_events) {
     Atom wm_delete;
 
-    XSelectInput (xvimagesink->xcontext->disp, xwindow->win, ExposureMask |
-        StructureNotifyMask | PointerMotionMask | KeyPressMask |
-        KeyReleaseMask | ButtonPressMask | ButtonReleaseMask);
+    XSelectInput (xvimagesink->xcontext->disp, xwindow->win,
+    	EXPOSE_MASKS | NAVIGATE_MASKS | BUTTON_MASKS);
 
     /* Tell the window manager we'd like delete client messages instead of
      * being killed */
@@ -1274,7 +1277,7 @@ gst_xvimagesink_handle_xevents (GstXvIma
 
   /* Handle Expose */
   while (XCheckWindowEvent (xvimagesink->xcontext->disp,
-          xvimagesink->xwindow->win, ExposureMask | StructureNotifyMask, &e)) {
+          xvimagesink->xwindow->win, EXPOSE_MASKS, &e)) {
     switch (e.type) {
       case Expose:
         exposed = TRUE;
@@ -2781,6 +2784,7 @@ gst_xvimagesink_set_xwindow_id (GstXOver
     }
   } else {
     XWindowAttributes attr;
+    long event_mask = 0;
 
     xwindow = g_new0 (GstXWindow, 1);
     xwindow->win = xwindow_id;
@@ -2798,11 +2802,11 @@ gst_xvimagesink_set_xwindow_id (GstXOver
       xvimagesink->render_rect.w = attr.width;
       xvimagesink->render_rect.h = attr.height;
     }
-    if (xvimagesink->handle_events) {
-      XSelectInput (xvimagesink->xcontext->disp, xwindow->win, ExposureMask |
-          StructureNotifyMask | PointerMotionMask | KeyPressMask |
-          KeyReleaseMask);
-    }
+    if (xvimagesink->handle_expose)
+    	event_mask |= EXPOSE_MASKS;
+    if (xvimagesink->handle_events)
+    	event_mask |= NAVIGATE_MASKS /*| BUTTON_MASKS*/;
+    XSelectInput (xvimagesink->xcontext->disp, xwindow->win, event_mask);
 
     xwindow->gc = XCreateGC (xvimagesink->xcontext->disp,
         xwindow->win, 0, NULL);
@@ -2828,6 +2832,7 @@ static void
 gst_xvimagesink_set_event_handling (GstXOverlay * overlay,
     gboolean handle_events)
 {
+  long event_mask = 0;
   GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
 
   xvimagesink->handle_events = handle_events;
@@ -2841,19 +2846,13 @@ gst_xvimagesink_set_event_handling (GstX
 
   g_mutex_lock (xvimagesink->x_lock);
 
-  if (handle_events) {
-    if (xvimagesink->xwindow->internal) {
-      XSelectInput (xvimagesink->xcontext->disp, xvimagesink->xwindow->win,
-          ExposureMask | StructureNotifyMask | PointerMotionMask |
-          KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask);
-    } else {
-      XSelectInput (xvimagesink->xcontext->disp, xvimagesink->xwindow->win,
-          ExposureMask | StructureNotifyMask | PointerMotionMask |
-          KeyPressMask | KeyReleaseMask);
-    }
-  } else {
-    XSelectInput (xvimagesink->xcontext->disp, xvimagesink->xwindow->win, 0);
-  }
+  if (xvimagesink->handle_expose)
+	  event_mask |= EXPOSE_MASKS;
+  if (xvimagesink->handle_events)
+	  event_mask |= NAVIGATE_MASKS;
+  if (xvimagesink->xwindow->internal)
+	  event_mask |= BUTTON_MASKS;
+  XSelectInput (xvimagesink->xcontext->disp, xvimagesink->xwindow->win, event_mask);
 
   g_mutex_unlock (xvimagesink->x_lock);
 
