]> Dogcows Code - chaz/openbox/blob - openbox/window.c
only sopt moveresize when shutting down
[chaz/openbox] / openbox / window.c
1 #include "window.h"
2 #include "menuframe.h"
3 #include "config.h"
4 #include "dock.h"
5 #include "client.h"
6 #include "frame.h"
7
8 GHashTable *window_map;
9
10 void window_startup(gboolean reconfig)
11 {
12 if (reconfig) return;
13
14 window_map = g_hash_table_new(g_int_hash, g_int_equal);
15 }
16
17 void window_shutdown(gboolean reconfig)
18 {
19 if (reconfig) return;
20
21 g_hash_table_destroy(window_map);
22 }
23
24 Window window_top(ObWindow *self)
25 {
26 switch (self->type) {
27 case Window_Menu:
28 return ((ObMenuFrame*)self)->window;
29 case Window_Dock:
30 return ((ObDock*)self)->frame;
31 case Window_DockApp:
32 /* not to be used for stacking */
33 g_assert_not_reached();
34 break;
35 case Window_Client:
36 return ((ObClient*)self)->frame->window;
37 case Window_Internal:
38 return ((InternalWindow*)self)->win;
39 }
40 g_assert_not_reached();
41 return None;
42 }
43
44 Window window_layer(ObWindow *self)
45 {
46 switch (self->type) {
47 case Window_Menu:
48 return OB_STACKING_LAYER_INTERNAL;
49 case Window_Dock:
50 return config_dock_layer;
51 case Window_DockApp:
52 /* not to be used for stacking */
53 g_assert_not_reached();
54 break;
55 case Window_Client:
56 return ((ObClient*)self)->layer;
57 case Window_Internal:
58 return OB_STACKING_LAYER_INTERNAL;
59 }
60 g_assert_not_reached();
61 return None;
62 }
This page took 0.041731 seconds and 4 git commands to generate.