summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-07-23 17:42:08 -0400
committerDana Jansens <danakj@orodu.net>2008-01-20 01:36:53 -0500
commitebce321a72331697287838b864735e7b81e60b33 (patch)
tree7c6d33aedc34f4f489b7d842ef6c508f2425bbe4 /openbox
parent98dda05c4ae1372391a26fca4c5a8b0551bbb4f9 (diff)
look mom, I made an openbox toolkit
Diffstat (limited to 'openbox')
-rw-r--r--openbox/openbox.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/openbox/openbox.c b/openbox/openbox.c
index 48f31f91..c768bdf4 100644
--- a/openbox/openbox.c
+++ b/openbox/openbox.c
@@ -49,6 +49,7 @@
#include "parser/parse.h"
#include "render/render.h"
#include "render/theme.h"
+#include "obt/obt.h"
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
@@ -83,18 +84,18 @@
#include <X11/Xlib.h>
#include <X11/keysym.h>
-
-RrInstance *ob_rr_inst;
-RrTheme *ob_rr_theme;
-ObMainLoop *ob_main_loop;
-Display *ob_display;
-gint ob_screen;
-gboolean ob_replace_wm = FALSE;
-gboolean ob_sm_use = TRUE;
-gchar *ob_sm_id = NULL;
-gchar *ob_sm_save_file = NULL;
-gboolean ob_sm_restore = TRUE;
-gboolean ob_debug_xinerama = FALSE;
+ObtInstance *obt_inst;
+RrInstance *ob_rr_inst;
+RrTheme *ob_rr_theme;
+ObMainLoop *ob_main_loop;
+Display *ob_display;
+gint ob_screen;
+gboolean ob_replace_wm = FALSE;
+gboolean ob_sm_use = TRUE;
+gchar *ob_sm_id = NULL;
+gchar *ob_sm_save_file = NULL;
+gboolean ob_sm_restore = TRUE;
+gboolean ob_debug_xinerama = FALSE;
static ObState state;
static gboolean xsync = FALSE;
@@ -144,12 +145,10 @@ gint main(gint argc, gchar **argv)
session_startup(argc, argv);
}
-
- ob_display = XOpenDisplay(NULL);
- if (ob_display == NULL)
+ obt_inst = obt_instance_new(NULL);
+ if (obt_inst == NULL)
ob_exit_with_error(_("Failed to open the display from the DISPLAY environment variable."));
- if (fcntl(ConnectionNumber(ob_display), F_SETFD, 1) == -1)
- ob_exit_with_error("Failed to set display as close-on-exec");
+ ob_display = obt_display(obt_inst);
if (remote_control) {
prop_startup();
@@ -159,7 +158,7 @@ gint main(gint argc, gchar **argv)
* remote_control = 2 -> restart */
PROP_MSG(RootWindow(ob_display, ob_screen),
ob_control, remote_control, 0, 0, 0);
- XCloseDisplay(ob_display);
+ obt_instance_unref(obt_inst);
exit(EXIT_SUCCESS);
}
@@ -386,7 +385,7 @@ gint main(gint argc, gchar **argv)
session_shutdown(being_replaced);
- XCloseDisplay(ob_display);
+ obt_instance_unref(obt_inst);
parse_paths_shutdown();