void Workspace::damageNotifyEvent( const XDamageNotifyEvent *event ) { Client *client = find( event->drawable ); // ### should never happen if ( !client ) return; XserverRegion parts; if ( !client->isPainted() ) { // If the window has been painted for the first time, mark the whole // window as damaged. parts = client->createRegion( WindowAndBorder ); XDamageSubtract( dpy, client->damageHandle(), None, None ); client->setPainted( true ); } else { // Create a new empty region parts = XFixesCreateRegion( dpy, 0, 0 ); // Copy the damage region to parts, subtracting it from the widgets damage XDamageSubtract( dpy, client->damageHandle(), None, parts ); // Offset parts with the widgets position XFixesTranslateRegion( dpy, parts, client->x(), client->y() ); } // Add the damaged region to the total damage for the workspace // (destroys parts) addDamage( parts ); }
static XserverRegion client_border_size (Wm *w, Client *c, int x, int y) { XserverRegion border; border = XFixesCreateRegionFromWindow (w->dpy, c->frame, WindowRegionBounding ); /* translate this */ XFixesTranslateRegion (w->dpy, border, x, y); return border; }
EAPI void ecore_x_region_translate(Ecore_X_Region region, int dx, int dy) { #ifdef ECORE_XFIXES LOGFN(__FILE__, __LINE__, __FUNCTION__); XFixesTranslateRegion(_ecore_x_disp, region, dx, dy); #endif /* ifdef ECORE_XFIXES */ } /* ecore_x_region_translate */