After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791615 - No events received if ButtonPressMask is set in XSelectInput for Qt Window
No events received if ButtonPressMask is set in XSelectInput for Qt Window
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
unspecified
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-14 14:21 UTC by VaL Doroshchuk
Modified: 2018-02-05 10:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Do not subscribe to ButtonPress events for foreign windows (830 bytes, patch)
2018-02-02 08:54 UTC, VaL Doroshchuk
committed Details | Review

Description VaL Doroshchuk 2017-12-14 14:21:32 UTC
Hi,
If you take an example "GstVideoOverlay and Qt" from 
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/GstVideoOverlay.html

and use vaapisink instead of xvimagesink
GstElement *sink = gst_element_factory_make ("vaapisink", NULL);

Nothing will be rendered/showed up.

It is related to gst_vaapisink_x11_pre_start_event_thread()

  static const int x11_event_mask = (KeyPressMask | KeyReleaseMask |
      ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
      ExposureMask | StructureNotifyMask);

If ButtonPressMask is set for "foreign" (like in Qt example) window, no events will be received in gst_vaapisink_x11_handle_events()

Is it really needed to request ButtonPress events for not internal windows?
Comment 1 VaL Doroshchuk 2017-12-19 15:46:40 UTC
It is an issue due to:
> Only one client at a time can select a ButtonPress event, which is associated with the event mask ButtonPressMask.

And QWindow does subscribe to receive a ButtonPress event, and this avoids receiving _any_ events by vaapisink.
Comment 2 Víctor Manuel Jáquez Leal 2018-01-27 19:32:10 UTC
Hi,

Sorry for the late reply. 

Can you post a patch to fix this issue? Seems correct your intuition. Can you give it a try?
Comment 3 VaL Doroshchuk 2018-02-02 08:54:46 UTC
Created attachment 367794 [details] [review]
Do not subscribe to ButtonPress events for foreign windows
Comment 4 Víctor Manuel Jáquez Leal 2018-02-05 10:38:20 UTC
committed in master

* 76dbc3e9 vaapisink: don't mask button events for foreign windows