]> Dogcows Code - chaz/openbox/blobdiff - openbox/event.c
Clients Menus and Slits are all 'ObWindow's now.
[chaz/openbox] / openbox / event.c
index 9a351f73ceec24a0f4af0cb11c0ef1d078f8aad0..766be8fd9a5c58370fbd13f2e618aa677e06a423 100644 (file)
@@ -24,6 +24,7 @@
 
 static void event_process(XEvent *e);
 static void event_handle_root(XEvent *e);
+static void event_handle_slit(Slit *s, XEvent *e);
 static void event_handle_slitapp(SlitApp *app, XEvent *e);
 static void event_handle_client(Client *c, XEvent *e);
 static void event_handle_menu(Menu *menu, XEvent *e);
@@ -376,13 +377,15 @@ static void event_process(XEvent *e)
 {
     Window window;
     Client *client = NULL;
+    Slit *slit = NULL;
     SlitApp *slitapp = NULL;
     Menu *menu = NULL;
 
     window = event_get_window(e);
     if (!(client = g_hash_table_lookup(client_map, &window)))
         if (!(slitapp = g_hash_table_lookup(slit_app_map, &window)))
-            menu = g_hash_table_lookup(menu_map, &window);
+            if (!(slit = g_hash_table_lookup(slit_map, &window)))
+                menu = g_hash_table_lookup(menu_map, &window);
 
     event_set_lasttime(e);
     event_hack_mods(e);
@@ -397,6 +400,8 @@ static void event_process(XEvent *e)
        event_handle_client(client, e);
     else if (slitapp)
        event_handle_slitapp(slitapp, e);
+    else if (slit)
+       event_handle_slit(slit, e);
     else if (window == ob_root)
        event_handle_root(e);
     else if (e->type == MapRequest)
@@ -908,9 +913,26 @@ static void event_handle_menu(Menu *menu, XEvent *e)
     }
 }
 
+static void event_handle_slit(Slit *s, XEvent *e)
+{
+    switch (e->type) {
+    case ButtonPress:
+        stacking_raise(SLIT_AS_WINDOW(s));
+    case EnterNotify:
+        slit_hide(s, FALSE);
+        break;
+    case LeaveNotify:
+        slit_hide(s, TRUE);
+        break;
+    }
+}
+
 static void event_handle_slitapp(SlitApp *app, XEvent *e)
 {
     switch (e->type) {
+    case MotionNotify:
+        slit_app_drag(app, &e->xmotion);
+        break;
     case UnmapNotify:
        if (app->ignore_unmaps) {
            app->ignore_unmaps--;
This page took 0.021323 seconds and 4 git commands to generate.