make rendering much faster
[dana/dcompmgr.git] / screen.c
index 8c0ea58..b800817 100644 (file)
--- a/screen.c
+++ b/screen.c
@@ -1,5 +1,6 @@
 #include "screen.h"
 #include "display.h"
+#include "plugin.h"
 #include "list.h"
 #include "time.h"
 #include "window.h"
@@ -45,9 +46,7 @@ screen_new(struct d_display *dpy, int num, xcb_screen_t *xcb)
     sc->winhash = g_hash_table_new((GHashFunc)xcb_window_hash,
                                    (GEqualFunc)xcb_window_equal);
     sc->stacking = list_new();
-    sc->plugin_data = g_hash_table_new_full((GHashFunc)g_str_hash,
-                                            (GEqualFunc)g_str_equal,
-                                            g_free, NULL);
+    sc->plugin_data = list_new();
 
     return sc;
 }
@@ -64,7 +63,7 @@ screen_unref(d_screen_t *sc)
     if (sc && --sc->ref == 0) {
         g_hash_table_unref(sc->winhash);
         list_unref(sc->stacking);
-        g_hash_table_unref(sc->plugin_data);
+        list_unref(sc->plugin_data);
         free(sc);
     }
 }
@@ -311,8 +310,8 @@ static void
 screen_set_next_repaint(d_screen_t *sc)
 {
     gettimeofday(&sc->next_repaint, NULL);
-    /* add time for the refresh rate (60 hz) */
-    time_add(&sc->next_repaint, 1000000/60);
+    /* add time for the refresh rate (30 hz) */
+    time_add(&sc->next_repaint, 1000000/30);
     sc->need_repaint = FALSE;
 }
 
@@ -323,26 +322,26 @@ screen_setup_default_functions(d_screen_t *sc)
     sc->window_show = window_show;
     sc->window_hide = window_hide;
     sc->window_become_zombie = window_become_zombie;
-    sc->window_reconfigure = window_reconfigure;
+    sc->window_move = window_move;
+    sc->window_resize = window_resize;
 }
 
 void
-screen_add_plugin_data(d_screen_t *sc, const char *key, void *data)
+screen_add_plugin_data(d_screen_t *sc, int id, void *data)
 {
-    char *skey = g_strdup(key);
-    g_hash_table_replace(sc->plugin_data, skey, data);
+    plugin_data_add(sc->plugin_data, id, data);
 }
 
 void*
-screen_find_plugin_data(d_screen_t *sc, const char *key)
+screen_find_plugin_data(d_screen_t *sc, int id)
 {
-    return g_hash_table_lookup(sc->plugin_data, key);
+    return plugin_data_find(sc->plugin_data, id);
 }
 
 void
-screen_remove_plugin_data(d_screen_t *sc, const char *key)
+screen_remove_plugin_data(d_screen_t *sc, int id)
 {
-    g_hash_table_remove(sc->plugin_data, key);
+    plugin_data_remove(sc->plugin_data, id);
 }
 
 void screen_refresh(d_screen_t *sc)