All pastes #757710 Raw Edit

Something

public text v1 · immutable
·published 2007-11-01 15:31 UTC
rendered paste body
diff --git a/kde/window-decorator/decorator.cpp b/kde/window-decorator/decorator.cpp
diff --git a/kde/window-decorator/window.cpp b/kde/window-decorator/window.cpp
index 5165995..ab361fb 100644
--- a/kde/window-decorator/window.cpp
+++ b/kde/window-decorator/window.cpp
@@ -1038,7 +1038,7 @@ KWD::Window::setMask (const QRegion &reg, int)
 	KWD::trapXError ();
 	XShapeCombineRegion (qt_xdisplay (),
 			     mFrame,
-			     ShapeInput,
+			     ShapeBounding,
 			     0,
 			     0,
 			     r.handle (),
@@ -1157,6 +1157,8 @@ KWD::Window::resizeDecoration (bool force)
 	mPendingMap = 1;
 
 	XReparentWindow (qt_xdisplay (), winId (), mParentId, 0, 0);
+	if (mFrame)
+	XReparentWindow (qt_xdisplay (), mDecor->widget()->winId (), mFrame, 0, 0);
 
 	show ();
 
@@ -1451,6 +1453,16 @@ KWD::Window::handleActiveChange (void)
 void
 KWD::Window::updateFrame (WId frame)
 {
+
+    if (frame && mFrame != frame && mDecor)
+    {
+	XReparentWindow (qt_xdisplay (), mDecor->widget()->winId (), frame, 0, 0);
+	mDecor->widget ()->show ();
+        mDecor->widget ()->repaint ();    
+    }
+    if (mDecor)
+    	resizeDecoration();
+
     mFrame = frame;
 
     KWD::trapXError ();
diff --git a/plugins/decoration.c b/plugins/decoration.c
index f7c0ca1..289d4b3 100644
--- a/plugins/decoration.c
+++ b/plugins/decoration.c
@@ -287,7 +287,7 @@ decorReleaseTexture (CompScreen   *screen,
 		     DecorTexture *texture)
 {
     DECOR_DISPLAY (screen->display);
-
+return;
     texture->refCount--;
     if (texture->refCount)
 	return;
@@ -459,7 +459,7 @@ decorCreateDecoration (CompScreen *screen,
 	free (quad);
 	return NULL;
     }
-
+#if 0
     decoration->texture = decorGetTexture (screen, pixmap);
     if (!decoration->texture)
     {
@@ -467,7 +467,7 @@ decorCreateDecoration (CompScreen *screen,
 	free (quad);
 	return NULL;
     }
-
+#endif
     decoration->minWidth  = minWidth;
     decoration->minHeight = minHeight;
     decoration->quad	  = quad;
@@ -519,12 +519,14 @@ static void
 decorReleaseDecoration (CompScreen *screen,
 			Decoration *decoration)
 {
+    if (!decoration)
+	return;
     decoration->refCount--;
     if (decoration->refCount)
 	return;
 
     decorReleaseTexture (screen, decoration->texture);
-
+if (decoration->quad)
     free (decoration->quad);
     free (decoration);
 }
@@ -568,6 +570,8 @@ static void
 destroyWindowDecoration (CompScreen	  *screen,
 			 WindowDecoration *wd)
 {
+if (!wd)
+	return;
     decorReleaseDecoration (screen, wd->decor);
     free (wd);
 }
@@ -587,7 +591,7 @@ setDecorationMatrices (CompWindow *w)
     wd = dw->wd;
     if (!wd)
 	return;
-
+return;
     for (i = 0; i < wd->nQuad; i++)
     {
 	wd->quad[i].matrix = wd->decor->texture->texture.matrix;
diff --git a/src/display.c b/src/display.c
index 0bbaceb..6f1b4c3 100644
--- a/src/display.c
+++ b/src/display.c
@@ -1638,7 +1638,7 @@ eventLoop (void)
 		    timeToNextRedraw = s->timeLeft;
 	    }
 	}
-
+#if 0
 	if (damageMask)
 	{
 	    time = timeToNextRedraw;
@@ -1827,6 +1827,7 @@ eventLoop (void)
 	    }
 	}
 	else
+#endif
 	{
 	    if (core.timeouts)
 	    {
@@ -2239,7 +2240,7 @@ addDisplay (const char *name)
 	return FALSE;
 
     d->lastPing = 1;
-
+#if 0
     if (!XQueryExtension (dpy,
 			  COMPOSITE_NAME,
 			  &d->compositeOpcode,
@@ -2265,7 +2266,7 @@ addDisplay (const char *name)
 			"No damage extension");
 	return FALSE;
     }
-
+#endif
     if (!XSyncQueryExtension (dpy, &d->syncEvent, &d->syncError))
     {
 	compLogMessage (d, "core", CompLogLevelFatal,
@@ -2383,7 +2384,7 @@ addDisplay (const char *name)
 	    XSelectInput (dpy, currentWmSnOwner,
 			  StructureNotifyMask);
 	}
-
+#if 0
 	sprintf (buf, "_NET_WM_CM_S%d", i);
 	cmSnAtom = XInternAtom (dpy, buf, 0);
 
@@ -2403,7 +2404,7 @@ addDisplay (const char *name)
 		continue;
 	    }
 	}
-
+#endif
 	attr.override_redirect = TRUE;
 	attr.event_mask	       = PropertyChangeMask;
 
@@ -2468,7 +2469,7 @@ addDisplay (const char *name)
 	}
 
 	compCheckForError (dpy);
-
+#if 0
 	XCompositeRedirectSubwindows (dpy, XRootWindow (dpy, i),
 				      CompositeRedirectManual);
 
@@ -2492,7 +2493,7 @@ addDisplay (const char *name)
 
 	    continue;
 	}
-
+#endif
 	XGrabServer (dpy);
 
 	XSelectInput (dpy, XRootWindow (dpy, i),
diff --git a/src/screen.c b/src/screen.c
index 1a066ef..13d0628 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1737,7 +1737,7 @@ addScreen (CompDisplay *display,
     s->workArea.height = s->attrib.height;
 
     s->grabWindow = None;
-
+#if 0
     makeOutputWindow (s);
 
     templ.visualid = XVisualIDFromVisual (s->attrib.visual);
@@ -2178,7 +2178,7 @@ addScreen (CompDisplay *display,
 	if (s->textureEnvCrossbar && s->maxTextureUnits >= 4)
 	    s->canDoSlightlySaturated = TRUE;
     }
-
+#endif
     s->redrawTime = 1000 / defaultRefreshRate;
     s->optimalRedrawTime = s->redrawTime;
 
@@ -2187,7 +2187,7 @@ addScreen (CompDisplay *display,
     detectRefreshRateOfScreen (s);
     detectOutputDevices (s);
     updateOutputDevices (s);
-
+#if 0
     glLightModelfv (GL_LIGHT_MODEL_AMBIENT, globalAmbient);
 
     glEnable (GL_LIGHT0);
@@ -2198,7 +2198,7 @@ addScreen (CompDisplay *display,
     glColorMaterial (GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
 
     glNormal3f (0.0f, 0.0f, -1.0f);
-
+#endif
     s->lighting	      = FALSE;
     s->slowAnimations = FALSE;
 
@@ -2452,7 +2452,7 @@ findTopLevelWindowAtScreen (CompScreen *s,
     if (w->attrib.override_redirect)
     {
 	/* likely a frame window */
-	if (w->attrib.class == InputOnly)
+//	if (w->attrib.class == InputOnly)
 	{
 	    for (w = s->windows; w; w = w->next)
 		if (w->frame == id)
diff --git a/src/window.c b/src/window.c
index 98ad9c8..72ef304 100644
--- a/src/window.c
+++ b/src/window.c
@@ -183,6 +183,7 @@ recalcNormalHints (CompWindow *window)
     int maxSize;
 
     maxSize = window->screen->maxTextureSize;
+    maxSize = 65535;
     maxSize -= window->serverBorderWidth * 2;
 
     window->sizeHints.x      = window->serverX;
@@ -1173,7 +1174,7 @@ updateFrameWindow (CompWindow *w)
 	    w->frame = XCreateWindow (d->display, w->screen->root,
 				      x, y, width, height, 0,
 				      CopyFromParent,
-				      InputOnly,
+				      InputOutput,
 				      CopyFromParent,
 				      CWOverrideRedirect | CWEventMask, &attr);
 
@@ -2525,7 +2526,7 @@ resizeWindow (CompWindow *w,
 
 	pw = width  + borderWidth * 2;
 	ph = height + borderWidth * 2;
-
+#if 0
 	if (w->mapNum && w->redirected)
 	{
 	    pixmap = XCompositeNameWindowPixmap (w->screen->display->display,
@@ -2545,7 +2546,7 @@ resizeWindow (CompWindow *w,
 	{
 	    ph = 0;
 	}
-
+#endif
 	addWindowDamage (w);
 
 	dx      = x - w->attrib.x;
@@ -2575,7 +2576,7 @@ resizeWindow (CompWindow *w,
 
 	w->invisible = WINDOW_INVISIBLE (w);
 
-	updateFrameWindow (w);
+//	updateFrameWindow (w);
     }
     else if (w->attrib.x != x || w->attrib.y != y)
     {
@@ -2586,10 +2587,12 @@ resizeWindow (CompWindow *w,
 
 	moveWindow (w, dx, dy, TRUE, TRUE);
 
+/*	
 	if (w->frame)
 	    XMoveWindow (w->screen->display->display, w->frame,
-			 w->attrib.x - w->input.left,
-			 w->attrib.y - w->input.top);
+			 w->serverX - w->input.left,
+			 w->serverY - w->input.top);
+*/
     }
 
     return TRUE;
@@ -3360,6 +3363,9 @@ configureXWindow (CompWindow	 *w,
 
     XConfigureWindow (w->screen->display->display, w->id, valueMask, xwc);
 
+    if (w->frame)
+	updateFrameWindow(w);
+
     if (w->frame && (valueMask & (CWSibling | CWStackMode)))
 	XConfigureWindow (w->screen->display->display, w->frame,
 			  valueMask & (CWSibling | CWStackMode), xwc);