[vlc-devel] commit: Qt4: make video widget not eat mouse click events ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Aug 16 19:44:07 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Aug 16 20:43:21 2009 +0300| [bd057d1bbcde511df0a1fc2c3128ab252ff20095] | committer: Rémi Denis-Courmont 

Qt4: make video widget not eat mouse click events

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bd057d1bbcde511df0a1fc2c3128ab252ff20095
---

 modules/gui/qt4/components/interface_widgets.cpp |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 6f2c390..cb0f20f 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -150,6 +150,17 @@ WId VideoWidget::request( int *pi_x, int *pi_y,
     reparentable->setLayout( innerLayout );
     layout->addWidget( reparentable );
 
+#ifdef Q_WS_X11
+    /* HACK: Only one X11 client can subscribe to mouse click events.
+     * VLC currently handles those in the video display.
+     * Force Qt4 to unsubscribe from them. */
+    Display *dpy = QX11Info::display();
+    Window w = stable->winId();
+    XWindowAttributes attr;
+
+    XGetWindowAttributes( dpy, w, &attr );
+    XSelectInput( dpy, w, attr.your_event_mask & ~ButtonPressMask );
+#endif
     videoSync();
 #ifndef NDEBUG
     msg_Dbg( p_intf, "embedded video ready (handle %p)",




More information about the vlc-devel mailing list