[compiz] [PATCH] Extra Notifications

Mike Dransfield mike at blueroot.co.uk
Fri Oct 13 10:32:46 PDT 2006



Mike Dransfield wrote:
> I am working on exposing events to external apps via the dbus plugin
> I found that I really wanted extra Notify Procedures so that I didn't
> have to do too much direct access to xlib (If I understand rightly, 
> plugin
> developers shouldn't have to do too much xlib work inside the plugins)
>
> I added Create, Destroy, Map, Unmap, Minimize and Unminimize
>
> Hopefully this can be included as I know a few other people would like
> more notifications that can be easilly used in plugins.


Attached is a slight correction for the window.c patch
-------------- next part --------------
diff --git a/src/window.c b/src/window.c
index 3346d89..96365a2 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1786,6 +1786,8 @@ addWindow (CompScreen *screen,
 		      w->attrib.x, w->attrib.y,
 		      w->attrib.width, ++w->attrib.height - 1,
 		      w->attrib.border_width);
+
+    (*w->screen->windowCreateNotify) (w);
 }
 
 void
@@ -1819,6 +1821,8 @@ removeWindow (CompWindow *w)
 void
 destroyWindow (CompWindow *w)
 {
+    (*w->screen->windowDestroyNotify) (w);
+
     w->id = 1;
     w->mapNum = 0;
 
@@ -1943,6 +1947,8 @@ mapWindow (CompWindow *w)
 			  w->attrib.width, ++w->attrib.height - 1,
 			  w->attrib.border_width);
     }
+
+    (*w->screen->windowMapNotify) (w);
 }
 
 void
@@ -1984,6 +1990,8 @@ unmapWindow (CompWindow *w)
 	updateWorkareaForScreen (w->screen);
 
     updateClientListForScreen (w->screen);
+
+    (*w->screen->windowUnmapNotify) (w);
 }
 
 static int
@@ -2355,6 +2363,26 @@ focusWindow (CompWindow *w)
 }
 
 void
+windowCreateNotify (CompWindow *w)
+{
+}
+
+void
+windowDestroyNotify (CompWindow *w)
+{
+}
+
+void
+windowMapNotify (CompWindow *w)
+{
+}
+
+void
+windowUnmapNotify (CompWindow *w)
+{
+}
+
+void
 windowResizeNotify (CompWindow *w)
 {
 }
@@ -2382,6 +2410,16 @@ windowUngrabNotify (CompWindow *w)
 }
 
 void
+windowMinimizeNotify (CompWindow *w)
+{
+}
+
+void
+windowUnminimizeNotify (CompWindow *w)
+{
+}
+
+void
 windowStateChangeNotify (CompWindow *w)
 {
 }
@@ -3774,6 +3812,7 @@ minimizeWindow (CompWindow *w)
 	forEachWindowOnScreen (w->screen, minimizeTransients, (void *) w);
 
 	hideWindow (w);
+	(*w->screen->windowMinimizeNotify) (w);
     }
 }
 
@@ -3798,6 +3837,8 @@ unminimizeWindow (CompWindow *w)
 	showWindow (w);
 
 	forEachWindowOnScreen (w->screen, unminimizeTransients, (void *) w);
+
+	(*w->screen->windowUnminimizeNotify) (w);
     }
 }
 


More information about the compiz mailing list