X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fopenbox.c;h=0f9fb1793825342bbb2adf6821239d563ce0cfd6;hb=d45af3cb45f35ba639efac15675ed10b3515a7f0;hp=792dae2ef78c4950a039f1cc1ad7e6463336b002;hpb=73575c10ce3ede1637e4f959b56e1f7d5f110b91;p=chaz%2Fopenbox diff --git a/openbox/openbox.c b/openbox/openbox.c index 792dae2e..0f9fb179 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -80,9 +80,6 @@ #include #endif -#include -#include - RrInstance *ob_rr_inst; RrImageCache *ob_rr_icons; RrTheme *ob_rr_theme; @@ -101,7 +98,6 @@ static gboolean reconfigure = FALSE; static gboolean restart = FALSE; static gchar *restart_path = NULL; static Cursor cursors[OB_NUM_CURSORS]; -static KeyCode *keys[OB_NUM_KEYS]; static gint exitcode = 0; static guint remote_control = 0; static gboolean being_replaced = FALSE; @@ -166,6 +162,8 @@ gint main(gint argc, gchar **argv) obt_main_loop_signal_add(ob_main_loop, SIGHUP, signal_handler, NULL,NULL); obt_main_loop_signal_add(ob_main_loop, SIGPIPE, signal_handler, NULL,NULL); obt_main_loop_signal_add(ob_main_loop, SIGCHLD, signal_handler, NULL,NULL); + obt_main_loop_signal_add(ob_main_loop, SIGTTIN, signal_handler, NULL,NULL); + obt_main_loop_signal_add(ob_main_loop, SIGTTOU, signal_handler, NULL,NULL); ob_screen = DefaultScreen(obt_display); @@ -215,16 +213,6 @@ gint main(gint argc, gchar **argv) if (reconfigure) obt_keyboard_reload(); - /* get the keycodes for keys we use */ - keys[OB_KEY_RETURN] = obt_keyboard_keysym_to_keycode(XK_Return); - keys[OB_KEY_ESCAPE] = obt_keyboard_keysym_to_keycode(XK_Escape); - keys[OB_KEY_LEFT] = obt_keyboard_keysym_to_keycode(XK_Left); - keys[OB_KEY_RIGHT] = obt_keyboard_keysym_to_keycode(XK_Right); - keys[OB_KEY_UP] = obt_keyboard_keysym_to_keycode(XK_Up); - keys[OB_KEY_DOWN] = obt_keyboard_keysym_to_keycode(XK_Down); - keys[OB_KEY_TAB] = obt_keyboard_keysym_to_keycode(XK_Tab); - keys[OB_KEY_SPACE] = obt_keyboard_keysym_to_keycode(XK_space); - { ObtXmlInst *i; @@ -401,16 +389,6 @@ gint main(gint argc, gchar **argv) event_shutdown(reconfigure); config_shutdown(); actions_shutdown(reconfigure); - - /* Free the key codes for built in keys */ - g_free(keys[OB_KEY_RETURN]); - g_free(keys[OB_KEY_ESCAPE]); - g_free(keys[OB_KEY_LEFT]); - g_free(keys[OB_KEY_RIGHT]); - g_free(keys[OB_KEY_UP]); - g_free(keys[OB_KEY_DOWN]); - g_free(keys[OB_KEY_TAB]); - g_free(keys[OB_KEY_SPACE]); } while (reconfigure); } @@ -500,6 +478,10 @@ static void signal_handler(gint signal, gpointer data) /* reap children */ while (waitpid(-1, NULL, WNOHANG) > 0); break; + case SIGTTIN: + case SIGTTOU: + ob_debug("Caught signal %d. Ignoring.", signal); + break; default: ob_debug("Caught signal %d. Exiting.", signal); /* TERM and INT return a 0 code */ @@ -727,16 +709,6 @@ Cursor ob_cursor(ObCursor cursor) return cursors[cursor]; } -gboolean ob_keycode_match(KeyCode code, ObKey key) -{ - KeyCode *k; - - g_assert(key < OB_NUM_KEYS); - for (k = keys[key]; *k; ++k) - if (*k == code) return TRUE; - return FALSE; -} - ObState ob_state(void) { return state;