renaming
[dana/dcompmgr.git] / screen.c
index 15827ff..e2fdaaf 100644 (file)
--- a/screen.c
+++ b/screen.c
@@ -79,10 +79,10 @@ screen_register(struct d_display *dpy, int num, d_screen_t *sc)
 }
 
 static guint
-window_hash(xcb_window_t *w) { return *w; }
+xcb_window_hash(xcb_window_t *w) { return *w; }
 
 static gboolean
-window_compare(xcb_window_t *w1, xcb_window_t *w2) { return *w1 == *w2; }
+xcb_window_compare(xcb_window_t *w1, xcb_window_t *w2) { return *w1 == *w2; }
 
 static gboolean
 screen_init(d_screen_t *sc)
@@ -126,8 +126,8 @@ screen_init(d_screen_t *sc)
     xcb_change_window_attributes(sc->dpy->conn, sc->super.root,
                                  XCB_CW_EVENT_MASK, &mask);
 
-    sc->winhash = g_hash_table_new((GHashFunc)window_hash,
-                                   (GCompareFunc)window_compare);
+    sc->winhash = g_hash_table_new((GHashFunc)xcb_window_hash,
+                                   (GCompareFunc)xcb_window_compare);
     sc->stacking = list_new();
 
     return TRUE;
@@ -158,6 +158,7 @@ screen_remove_window(d_screen_t *sc, struct d_window *w)
     printf("screen removed window 0x%x\n", w->id);
 
     g_hash_table_remove(sc->winhash, &w->id);
+    w->become_zombie(w);
     window_unref(w);
 }
 
@@ -203,3 +204,15 @@ screen_timestamp(d_screen_t *sc)
     printf("created timestamp %lu\n", (unsigned long) time);
     return time;
 }
+
+void
+screen_stacking_add(d_screen_t *sc, struct d_window *w)
+{
+    list_prepend(sc->stacking, w);
+}
+
+void
+screen_stacking_remove(d_screen_t *sc, struct d_window *w)
+{
+    list_remove(sc->stacking, w);
+}