summaryrefslogtreecommitdiff
path: root/obt/display.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-07-26 20:03:31 -0400
committerDana Jansens <danakj@orodu.net>2008-01-20 01:36:54 -0500
commit6c8acc079a9cbb40245e5df4b50b3f8b9c17cf83 (patch)
tree70432a7643ac99542aac129b22503e9cacfa667f /obt/display.c
parent5960d27b1c35c58d3c1731c71c44b9c61328a34d (diff)
add prop.[ch] to the libobt, but they are not used yet. add a global obt_display which obt can use, and the application.
Diffstat (limited to 'obt/display.c')
-rw-r--r--obt/display.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/obt/display.c b/obt/display.c
index d9966780..6993addb 100644
--- a/obt/display.c
+++ b/obt/display.c
@@ -17,6 +17,7 @@
*/
#include "obt/display.h"
+#include "obt/prop.h"
#ifdef HAVE_STRING_H
# include <string.h>
@@ -28,6 +29,8 @@
# include <unistd.h>
#endif
+Display* obt_display = NULL;
+
gboolean obt_display_error_occured = FALSE;
gboolean obt_display_extension_xkb = FALSE;
@@ -45,13 +48,13 @@ static gint xerror_handler(Display *d, XErrorEvent *e);
static gboolean xerror_ignore = FALSE;
-Display* obt_display_open(const char *display_name)
+gboolean obt_display_open(const char *display_name)
{
gchar *n;
Display *d = NULL;
n = display_name ? g_strdup(display_name) : NULL;
- d = XOpenDisplay(n);
+ obt_display = d = XOpenDisplay(n);
if (d) {
gint junk;
(void)junk;
@@ -103,15 +106,17 @@ Display* obt_display_open(const char *display_name)
g_message("X Sync extension is not present on the server or is an "
"incompatible version");
#endif
+
+ obt_prop_startup();
}
g_free(n);
- return d;
+ return obt_display != NULL;
}
-void obt_display_close(Display *d)
+void obt_display_close()
{
- if (d) XCloseDisplay(d);
+ if (obt_display) XCloseDisplay(obt_display);
}
static gint xerror_handler(Display *d, XErrorEvent *e)
@@ -135,9 +140,9 @@ static gint xerror_handler(Display *d, XErrorEvent *e)
return 0;
}
-void obt_display_ignore_errors(Display *d, gboolean ignore)
+void obt_display_ignore_errors(gboolean ignore)
{
- XSync(d, FALSE);
+ XSync(obt_display, FALSE);
xerror_ignore = ignore;
if (ignore) obt_display_error_occured = FALSE;
}