]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
change the menu plugin interface, no need for the create/destroy functions any more.
[chaz/openbox] / openbox / client.c
index e905a6f97ca9faf8753252d278a42c30b9a0741b..f17e9724fc228afa338b83c6604d875c4f339acb 100644 (file)
@@ -17,7 +17,7 @@
 #include "openbox.h"
 #include "group.h"
 #include "config.h"
-#include "menu.h"
+#include "menuframe.h"
 #include "keyboard.h"
 #include "mouse.h"
 #include "render/render.h"
@@ -272,6 +272,8 @@ void client_manage(Window window)
         (self->type == OB_CLIENT_TYPE_NORMAL ||
          self->type == OB_CLIENT_TYPE_DIALOG))
     {        
+        activate = TRUE;
+#if 0
         if (self->desktop != screen_desktop) {
             /* activate the window */
             activate = TRUE;
@@ -301,13 +303,14 @@ void client_manage(Window window)
                 activate = TRUE;
             }
         }
+#endif
     }
 
     dispatch_client(Event_Client_New, self, 0, 0);
 
     /* make sure the window is visible */
     if (ob_state() == OB_STATE_RUNNING)
-        client_move_onscreen(self, TRUE);
+        client_move_onscreen(self, client_normal(self));
 
     client_showhide(self);
 
@@ -347,13 +350,6 @@ void client_unmanage_all()
        client_unmanage(client_list->data);
 }
 
-/* called by client_unmanage() to close any menus referencing this client */
-void client_close_menus(gpointer key, gpointer value, gpointer self)
-{
-    if (((ObMenu *)value)->client == (ObClient *)self)
-        menu_hide((ObMenu *)value);
-}
-
 void client_unmanage(ObClient *self)
 {
     guint j;
@@ -410,9 +406,9 @@ void client_unmanage(ObClient *self)
     if (moveresize_client == self)
         moveresize_end(TRUE);
 
-    /* close any windows that are attached to this window */
-    g_hash_table_foreach(menu_hash, client_close_menus, self);
-
+    /* menus can be associated with a client, so close any that are since
+       we are disappearing now */
+    menu_frame_hide_all_client(self);
     
     if (focus_client == self) {
         XEvent e;
This page took 0.029144 seconds and 4 git commands to generate.