[PATCH] Add hybrid full-size/empty-clip mode to SetRootClip

Olivier Fourdan ofourdan at redhat.com
Mon Feb 8 16:00:04 UTC 2016

Hi Daniel,

----- Original Message -----
> [Accidentally sent the unannotated version - sorry.]
> [...]
> Unfortunately this totally breaks output hotplug, regressing the fix
> from 216bdbc735. The effect is that if you hotplug an output and move an
> XWayland window on to it, it can never receive pointer input, even
> though the screen / root window size / RandR information are all updated.
> Calling SetRootClip updates the root window's borderSize, so that
> RRScreenSizeNotify (through ScreenRestructured) can rebuild the sprite
> bounding box against the updated root window borderSize. With the
> SetRootClip call removed, the bounding box always remains the same as it
> was when the server was started.

Sorry I didn't spot that while testing the original patch, but I can definitely reproduce with gnome wayland, indeed.

> It seems like we need a third mode to SetRootClip, diverging in the
> middle ('Use REGION_BREAK to ...') branch: update winSize and
> borderSize, but keep borderClip and clipList empty. I can't see how to
> do this without a DIX change, since calling SetRootClip(TRUE) followed
> by SetRootClip(FALSE) would have this desired effect, but generate a
> bunch of exposures in between, which would generate invalid writes.
> How about this (apply with git am --scissors)? It quite dumbly tries to
> preserve API: Bool is really int, so we take the existing TRUE/FALSE
> modes as the first two enum parameters, then introduce a new one.
> Tested by starting with a single output, manually checking
> screenInfo.screens[0]->root->{winSize,borderSize,borderClip,clipList}
> with gdb, hotplugging an output, verifying the regions again and also
> checking xev receives events on that output, unplugging it and verifying
> regions again.

The patch fixes the issue with the input events of course, but I just had a segfault in Xwayland trying this patch:

 (EE) Caught signal 11 (Segmentation fault). Server aborting
 Fatal server error:
 (EE) Segmentation fault at address 0x100000001
 (EE) 10: ? (?+0x29) [0x29]
 (EE) 9: /usr/bin/Xwayland (_start+0x29) [0x423299]
 (EE) 8: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7fdd80e7f580]
 (EE) 7: /usr/bin/Xwayland (dix_main+0x3b3) [0x544ef3]
 (EE) 6: /usr/bin/Xwayland (Dispatch+0x31e) [0x54109e]
 (EE) 5: /usr/bin/Xwayland (ProcRRGetMonitors+0x9b) [0x4ca18b]
 (EE) 4: /usr/bin/Xwayland (RRMonitorMakeList+0x269) [0x4c9ba9]
 (EE) 3: /usr/bin/Xwayland (RRMonitorSetFromServer+0x118) [0x4c9198]
 (EE) 2: /usr/bin/Xwayland (MakeAtom+0x30) [0x530710]
 (EE) 1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7fdd80e93b1f]
 (EE) 0: /usr/bin/Xwayland (OsSigHandler+0x29) [0x5792d9]
 (EE) Backtrace:

This occurred while disabling the secondary output in g-c-c in gnome-wayland session (Xwayland crashing incidentally takes the entire gnome session with it).

Maybe the segfault is unrelated to that patch, I need to check further.


More information about the xorg-devel mailing list