Bug 108005

Summary: calling compScreenUpdate() from a block handler breaks other extensions (VNC)
Product: xorg Reporter: Pierre Ossman <ossman>
Component: Server/Ext/CompositeAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium Keywords: patch
Version: unspecified   
Hardware: Other   
OS: All   
i915 platform: i915 features:
Description Flags
patch to use WorkQueue instead of BlockHandler
patch to use WorkQueue instead of BlockHandler none

Description Pierre Ossman 2018-09-20 14:31:23 UTC
Created attachment 141659 [details] [review]
patch to use WorkQueue instead of BlockHandler

So Composite currently (ab)uses the BlockHandler mechanism to do automatic updates whenever the backing copy of a window has been damaged.

This is a bad idea because it prevents other extensions from reacting to those draw operations properly, because their BlockHandler might have executed before Composite.

This can be seen in real world scenarios. xfce4-terminal creates windows that get automatically composited. When such a window updates VNC fails to send those update to the VNC client because it runs before Composite.

Attached is a patch that changes Composite to use the WorkQueue instead.
Comment 1 Pierre Ossman 2018-09-20 14:33:22 UTC
Created attachment 141660 [details] [review]
patch to use WorkQueue instead of BlockHandler
Comment 2 Alan Coopersmith 2018-09-28 20:16:11 UTC
Thanks for the patch, but we're handling patch submissions in gitlab now,
via merge requests to https://gitlab.freedesktop.org/xorg/xserver/ .
(We've moved bug tracking to gitlab as well for most X.Org projects, but are
 still working on it for the Xserver itself.)
Comment 3 Pierre Ossman 2018-10-03 08:32:13 UTC
Added here:

Comment 4 Adam Jackson 2018-10-05 19:03:44 UTC
commit 1bd5d0a53c5ff4169c5a6704c1c4b276f998b938
Author: Pierre Ossman <ossman@cendio.se>
Date:   Wed Oct 3 10:28:52 2018 +0200

    Switch automatic composite update to WorkQueue
    It is currently (ab)using the screen BlockHandler callback to do
    this. But this can cause problems with other extension as their
    block handlers might have executed before Composite's. And the
    operations Composite does might result in them wanting to change
    Practically this caused problems for TigerVNC's VNC extension which
    failed to send out updates for Composite's screen updates.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.