summaryrefslogtreecommitdiff
path: root/hw/xquartz
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2016-02-12 16:36:59 +0000
committerAdam Jackson <ajax@redhat.com>2016-02-22 13:26:31 -0500
commite957a2e5dd288f515f3e93724823542c20333f6a (patch)
tree0f0e885f72fe0dcf9a13531adf6fcdd28a121a1f /hw/xquartz
parentdbe8d03c42f01332b3dc41fe9290aed142f1436f (diff)
dix: Add hybrid full-size/empty-clip mode to SetRootClip
216bdbc735 removed the SetRootClip call in the XWayland output-hotplug handler when running rootless (e.g. as a part of Weston/Mutter), since the root window has no storage, so generating exposures will result in writes to invalid memory. Unfortunately, preventing the segfault also breaks sprite confinement. SetRootClip updates winSize and borderSize for the root window, which when combined with RRScreenSizeChanged calling ScreenRestructured, generates a new sprite-confinment area to update it to the whole screen. Removing this call results in the window geometry being reported correctly, but winSize/borderSize never changing from their values at startup, i.e. out of sync with the root window geometry / screen information in the connection info / XRandR. This patch introduces a hybrid mode, where we update winSize and borderSize for the root window, enabling sprite confinement to work correctly, but keep the clip emptied so exposures are never generated. Signed-off-by: Daniel Stone <daniels@collabora.com> Tested-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'hw/xquartz')
-rw-r--r--hw/xquartz/darwinEvents.c2
-rw-r--r--hw/xquartz/quartz.c4
-rw-r--r--hw/xquartz/quartz.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 557729768..7f34e0c68 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -275,7 +275,7 @@ DarwinEventHandler(int screenNum, InternalEvent *ie, DeviceIntPtr dev)
break;
case kXquartzSetRootClip:
- QuartzSetRootClip((Bool)e->data[0]);
+ QuartzSetRootClip(e->data[0]);
break;
case kXquartzQuit:
diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index d3ec133f6..c8b6f966d 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -485,7 +485,7 @@ QuartzHide(void)
* Enable or disable rendering to the X screen.
*/
void
-QuartzSetRootClip(BOOL enable)
+QuartzSetRootClip(int mode)
{
int i;
@@ -494,7 +494,7 @@ QuartzSetRootClip(BOOL enable)
for (i = 0; i < screenInfo.numScreens; i++) {
if (screenInfo.screens[i]) {
- SetRootClip(screenInfo.screens[i], enable);
+ SetRootClip(screenInfo.screens[i], mode);
}
}
}
diff --git a/hw/xquartz/quartz.h b/hw/xquartz/quartz.h
index 47c44162f..ddbf2e780 100644
--- a/hw/xquartz/quartz.h
+++ b/hw/xquartz/quartz.h
@@ -149,7 +149,7 @@ QuartzShow(void);
void
QuartzHide(void);
void
-QuartzSetRootClip(BOOL enable);
+QuartzSetRootClip(int mode);
void
QuartzSpaceChanged(uint32_t space_id);