From 2f3aaf8e3fc55909d3a597c43da9da36840c4f77 Mon Sep 17 00:00:00 2001 From: Scott Moreau Date: Sat, 16 Oct 2010 02:09:10 -0600 Subject: [PATCH] Proposed fix for X damage protocol changes. --- src/wallpaper.cpp | 22 ++++++++++++++++++---- src/wallpaper.h | 2 ++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/wallpaper.cpp b/src/wallpaper.cpp index a5c555e..3ac79a8 100644 --- a/src/wallpaper.cpp +++ b/src/wallpaper.cpp @@ -96,6 +96,8 @@ WallpaperScreen::createFakeDesktopWindow () CWBackPixel | CWBorderPixel | CWColormap, &attr); + damage = XDamageCreate (dpy, screen->root (), XDamageReportRawRectangles); + XSetWMProperties (dpy, fakeDesktop, NULL, NULL, programArgv, programArgc, &xsh, &xwmh, NULL); @@ -112,9 +114,6 @@ WallpaperScreen::createFakeDesktopWindow () XFixesSetWindowShapeRegion (dpy, fakeDesktop, ShapeInput, 0, 0, region); XFixesDestroyRegion (dpy, region); - - XMapWindow (dpy, fakeDesktop); - XLowerWindow (dpy, fakeDesktop); } void @@ -367,6 +366,17 @@ WallpaperScreen::getBackgroundForViewport (WallpaperBackgrounds &bg) void WallpaperScreen::handleEvent (XEvent *event) { + if (event->type == cScreen->damageEvent () + XDamageNotify) + { + XDamageNotifyEvent *de = (XDamageNotifyEvent*) event; + + if (screen->root () == de->drawable) + { + XMapWindow (screen->dpy (), fakeDesktop); + XLowerWindow (screen->dpy (), fakeDesktop); + } + } + screen->handleEvent (event); if (!screen->desktopWindowCount () && fakeDesktop == None && backgroundsPrimary.size()) @@ -620,7 +630,8 @@ WallpaperScreen::WallpaperScreen (CompScreen *screen) : cScreen (CompositeScreen::get (screen)), gScreen (GLScreen::get (screen)), backgroundsPrimary (), - backgroundsSecondary () + backgroundsSecondary (), + damage (None) { ScreenInterface::setHandler (screen, true); CompositeScreenInterface::setHandler (cScreen, true); @@ -672,6 +683,9 @@ WallpaperScreen::~WallpaperScreen () if (fakeDesktop != None) destroyFakeDesktopWindow (); + + if (damage) + XDamageDestroy (screen->dpy (), damage); } WallpaperWindow::WallpaperWindow (CompWindow *window) : diff --git a/src/wallpaper.h b/src/wallpaper.h index 3d00aa1..496f692 100644 --- a/src/wallpaper.h +++ b/src/wallpaper.h @@ -74,6 +74,8 @@ class WallpaperScreen : WallpaperBackgrounds backgroundsPrimary, backgroundsSecondary; + Damage damage; + void createFakeDesktopWindow (); void destroyFakeDesktopWindow (); -- 1.7.3.1