extensions.c focus.c frame.c grab.c menu.c menu_render.c \
openbox.c framerender.c parse.c plugin.c prop.c screen.c \
stacking.c dispatch.c event.c group.c timer.c xerror.c \
- moveresize.c
+ moveresize.c startup.c
noinst_HEADERS=action.h client.h config.h dispatch.h event.h extensions.h \
focus.h frame.h framerender.h geom.h gettext.h grab.h group.h \
menu.h openbox.h parse.h parse.tab.h plugin.h prop.h screen.h \
- stacking.h timer.h xerror.h moveresize.h
+ stacking.h timer.h xerror.h moveresize.h startup.h
# kill the implicit .c.y rule
%.c: %.y
#include "client.h"
+#include "startup.h"
#include "screen.h"
#include "moveresize.h"
#include "prop.h"
GList *client_list = NULL;
GHashTable *client_map = NULL;
-static Window *client_startup_stack_order = NULL;
-static guint client_startup_stack_size = 0;
-
static void client_get_all(Client *self);
static void client_toggle_border(Client *self, gboolean show);
static void client_get_area(Client *self);
client_map = g_hash_table_new((GHashFunc)map_hash,
(GEqualFunc)map_key_comp);
- /* save the stacking order on startup! */
- PROP_GETA32(ob_root, net_client_list_stacking, window,
- (guint32**)&client_startup_stack_order,
- &client_startup_stack_size);
-
client_set_list();
}
Window w, *children;
XWMHints *wmhints;
XWindowAttributes attrib;
+ Client *active;
XQueryTree(ob_display, ob_root, &w, &w, &children, &nchild);
why with stacking_lower? Why, because then windows who aren't in the
stacking list are on the top where you can see them instead of buried
at the bottom! */
- for (i = client_startup_stack_size; i > 0; --i) {
+ for (i = startup_stack_size; i > 0; --i) {
Client *c;
- w = client_startup_stack_order[i-1];
+ w = startup_stack_order[i-1];
c = g_hash_table_lookup(client_map, &w);
if (c) stacking_lower(c);
}
- g_free(client_startup_stack_order);
- client_startup_stack_order = NULL;
- client_startup_stack_size = 0;
+ g_free(startup_stack_order);
+ startup_stack_order = NULL;
+ startup_stack_size = 0;
- if (config_focus_new)
- focus_fallback(Fallback_NoFocus);
+ active = g_hash_table_lookup(client_map, &startup_active);
+ if (!active || !client_focus(active))
+ if (config_focus_new)
+ focus_fallback(Fallback_NoFocus);
}
void client_manage(Window window)
--- /dev/null
+#include "prop.h"
+#include "screen.h"
+#include "client.h"
+#include "focus.h"
+#include "config.h"
+#include "openbox.h"
+
+guint32 *startup_stack_order = NULL;
+guint startup_stack_size = 0;
+guint32 startup_active = None;
+guint32 startup_desktop = 0;
+
+void startup_save()
+{
+ /* save the stacking order on startup! */
+ PROP_GETA32(ob_root, net_client_list_stacking, window,
+ (guint32**)&startup_stack_order, &startup_stack_size);
+ PROP_GET32(ob_root, net_active_window, window, &startup_active);
+ PROP_GET32(ob_root, net_current_desktop, cardinal, &startup_desktop);
+}