]> Dogcows Code - chaz/openbox/blobdiff - openbox/slit.c
Clients Menus and Slits are all 'ObWindow's now.
[chaz/openbox] / openbox / slit.c
index 3956e0ec9be061db550e7607c954a964a4297f79..311cd6ac5cd9376e85ca3829045a37c8fe28470a 100644 (file)
@@ -1,38 +1,13 @@
 #include "slit.h"
 #include "screen.h"
 #include "grab.h"
-#include "timer.h"
 #include "openbox.h"
 #include "render/theme.h"
-#include "render/render.h"
 
 #define SLIT_EVENT_MASK (ButtonPressMask | ButtonReleaseMask | \
                          EnterWindowMask | LeaveWindowMask)
 #define SLITAPP_EVENT_MASK (StructureNotifyMask)
 
-struct Slit {
-    Window frame;
-
-    /* user-requested position stuff */
-    SlitPosition pos;
-    int gravity;
-    int user_x, user_y;
-
-    /* actual position (when not auto-hidden) */
-    int x, y;
-    int w, h;
-
-    gboolean horz;
-    gboolean hide;
-    gboolean hidden;
-
-    Appearance *a_frame;
-
-    Timer *hide_timer;
-
-    GList *slit_apps;
-};
-
 GHashTable *slit_map = NULL;
 GHashTable *slit_app_map = NULL;
 
@@ -53,12 +28,14 @@ void slit_startup()
 
     nslits = 1;
     slit = g_new0(struct Slit, nslits);
+    slit->obwin.type = Window_Slit;
 
     for (i = 0; i < nslits; ++i) {
         slit[i].horz = FALSE;
         slit[i].hide = FALSE;
         slit[i].hidden = TRUE;
         slit[i].pos = SlitPos_TopRight;
+        slit[i].layer = Layer_Top;
 
         attrib.event_mask = SLIT_EVENT_MASK;
         attrib.override_redirect = True;
@@ -71,6 +48,8 @@ void slit_startup()
         XSetWindowBorderWidth(ob_display, slit[i].frame, theme_bwidth);
 
         g_hash_table_insert(slit_map, &slit[i].frame, &slit[i]);
+        stacking_add(&slit[i]);
+        stacking_raise(SLIT_AS_WINDOW(&slit[i]));
     }
 }
 
@@ -82,6 +61,7 @@ void slit_shutdown()
         XDestroyWindow(ob_display, slit[i].frame);
         appearance_free(slit[i].a_frame);
         g_hash_table_remove(slit_map, &slit[i].frame);
+        stacking_remove(&slit[i]);
     }
     g_hash_table_destroy(slit_app_map);
     g_hash_table_destroy(slit_map);
This page took 0.026712 seconds and 4 git commands to generate.