]> Dogcows Code - chaz/openbox/blobdiff - openbox/openbox.c
dont use XKeysymToKeycode because valgrind says it is doing bad things, and we have...
[chaz/openbox] / openbox / openbox.c
index db26f0d2582fe836c50e0e44a00374614e9eff14..d3c805496a44ad1688d86a3679d35e44c5a358de 100644 (file)
 #include <X11/Xcursor/Xcursor.h>
 #endif
 
+#include <X11/Xlib.h>
+#include <X11/keysym.h>
+
+
 RrInstance *ob_rr_inst;
 RrTheme    *ob_rr_theme;
 ObMainLoop *ob_main_loop;
@@ -201,32 +205,27 @@ gint main(gint argc, gchar **argv)
     cursors[OB_CURSOR_NORTHWEST] = load_cursor("top_left_corner",
                                                XC_top_left_corner);
 
-    /* create available keycodes */
-    keys[OB_KEY_RETURN] =
-        XKeysymToKeycode(ob_display, XStringToKeysym("Return"));
-    keys[OB_KEY_ESCAPE] =
-        XKeysymToKeycode(ob_display, XStringToKeysym("Escape"));
-    keys[OB_KEY_LEFT] =
-        XKeysymToKeycode(ob_display, XStringToKeysym("Left"));
-    keys[OB_KEY_RIGHT] =
-        XKeysymToKeycode(ob_display, XStringToKeysym("Right"));
-    keys[OB_KEY_UP] =
-        XKeysymToKeycode(ob_display, XStringToKeysym("Up"));
-    keys[OB_KEY_DOWN] =
-        XKeysymToKeycode(ob_display, XStringToKeysym("Down"));
 
     prop_startup(); /* get atoms values for the display */
     extensions_query_all(); /* find which extensions are present */
 
     if (screen_annex(program_name)) { /* it will be ours! */
         do {
+            modkeys_startup(reconfigure);
+
+            /* get the keycodes for keys we use */
+            keys[OB_KEY_RETURN] = modkeys_sym_to_code(XK_Return);
+            keys[OB_KEY_ESCAPE] = modkeys_sym_to_code(XK_Escape);
+            keys[OB_KEY_LEFT] = modkeys_sym_to_code(XK_Left);
+            keys[OB_KEY_RIGHT] = modkeys_sym_to_code(XK_Right);
+            keys[OB_KEY_UP] = modkeys_sym_to_code(XK_Up);
+            keys[OB_KEY_DOWN] = modkeys_sym_to_code(XK_Down);
+
             {
                 ObParseInst *i;
                 xmlDocPtr doc;
                 xmlNodePtr node;
 
-                modkeys_startup(reconfigure);
-
                 /* startup the parsing so everything can register sections
                    of the rc */
                 i = parse_startup();
This page took 0.022083 seconds and 4 git commands to generate.