On Wed, 24 Apr 2019 at 06:29, Zhiyi Zhang zzhang@codeweavers.com wrote:
On 4/24/19 12:51 AM, Henri Verbeet wrote:
What is the actual issue with VisibilityNotify?
The problem here is that to implement occlusion detection correctly 100%, we need something like VisibilityNotify events[3] on Linux. But for VisibilityNotify events to work reliably, we need to disable compositing. Modern window managers are compositing managers for those fancy visual effects, so they are using compositor by default, thus making VisibilityNotify events unreliable and even GTK stopped using them[4]. For some window managers, we could disable compositing when entering a full-screen app to get VisibilityNotify events working. But for GNOME Shell 3, I didn't find a method to disable its composition. And what's more, disabling compositing on DWM is per monitor while current Linux window managers are per screen. So if you disable compositing, you lose all the fancy effects on other monitors as well on Linux.
To test window manager compositing and VisibilityNotify events. You can see this commit[5] for commands to disable compositor. Then use `xev` to open a test window and try moving another window over it and see if VisibilityNotify events show up.
Ok, so the issue is that we're not getting VisibilityNotify when the user is running a compositor. (For reference, VisibilityNotify events do work here on fvwm, but I can also confirm that running e.g. xcompmgr or compton effectively disables them.)
In any case, it looks like Vincent has provided a workable alternative suggestion in a parallel private thread. Ideally that discussion would have happened here on the public mailing list, but oh well.