summaryrefslogtreecommitdiff
path: root/openbox/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbox/window.c')
-rw-r--r--openbox/window.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/openbox/window.c b/openbox/window.c
new file mode 100644
index 00000000..90de822f
--- /dev/null
+++ b/openbox/window.c
@@ -0,0 +1,33 @@
+#include "window.h"
+#include "menu.h"
+#include "slit.h"
+#include "client.h"
+#include "frame.h"
+
+Window window_top(ObWindow *self)
+{
+ switch (self->type) {
+ case Window_Menu:
+ return ((Menu*)self)->frame;
+ case Window_Slit:
+ return ((Slit*)self)->frame;
+ case Window_Client:
+ return ((Client*)self)->frame->window;
+ }
+ g_assert_not_reached();
+ return None;
+}
+
+Window window_layer(ObWindow *self)
+{
+ switch (self->type) {
+ case Window_Menu:
+ return Layer_Internal;
+ case Window_Slit:
+ return ((Slit*)self)->layer;
+ case Window_Client:
+ return ((Client*)self)->layer;
+ }
+ g_assert_not_reached();
+ return None;
+}