Makes a complete value for these so it's one variable instead of two.
gboolean config_dock_hide;
guint config_dock_hide_delay;
guint config_dock_show_delay;
-guint config_dock_app_move_button;
-guint config_dock_app_move_modifiers;
+ObMouseButton config_dock_app_move_button;
-guint config_keyboard_reset_keycode;
-guint config_keyboard_reset_state;
+ObKeyboardKey config_keyboard_reset_key;
gint config_mouse_threshold;
gint config_mouse_dclicktime;
if ((n = obt_xml_find_sibling(node->children, "chainQuitKey"))) {
key = obt_xml_node_string(n);
- translate_key(key, &config_keyboard_reset_state,
- &config_keyboard_reset_keycode);
+ translate_key(key, &config_keyboard_reset_key.modifiers,
+ &config_keyboard_reset_key.keycode);
g_free(key);
}
gchar *str = obt_xml_node_string(n);
guint b, s;
if (translate_button(str, &s, &b)) {
- config_dock_app_move_button = b;
- config_dock_app_move_modifiers = s;
+ config_dock_app_move_button.button = b;
+ config_dock_app_move_button.modifiers = s;
} else {
g_message(_("Invalid button \"%s\" specified in config file"), str);
}
config_dock_hide = FALSE;
config_dock_hide_delay = 300;
config_dock_show_delay = 300;
- config_dock_app_move_button = 2; /* middle */
- config_dock_app_move_modifiers = 0;
+ config_dock_app_move_button.button = 2; /* middle */
+ config_dock_app_move_button.modifiers = 0;
obt_xml_register(i, "dock", parse_dock, NULL);
- translate_key("C-g", &config_keyboard_reset_state,
- &config_keyboard_reset_keycode);
+ translate_key("C-g", &config_keyboard_reset_key.modifiers,
+ &config_keyboard_reset_key.keycode);
bind_default_keyboard();
#include "place.h"
#include "client.h"
#include "geom.h"
+#include "keyboard.h"
+#include "mouse.h"
#include "moveresize.h"
#include "obrender/render.h"
#include "obt/xml.h"
/*! The number of milliseconds to wait before showing the dock */
extern guint config_dock_show_delay;
/*! The mouse button to be used to move dock apps */
-extern guint config_dock_app_move_button;
-/*! The modifiers to be used with the button to move dock apps */
-extern guint config_dock_app_move_modifiers;
+extern ObMouseButton config_dock_app_move_button;
/*! The name of the theme */
extern gchar *config_theme;
/*! Amount of time to show the desktop switch dialog */
extern guint config_desktop_popup_time;
-/*! The keycode of the key combo which resets the keybaord chains */
-extern guint config_keyboard_reset_keycode;
-/*! The modifiers of the key combo which resets the keybaord chains */
-extern guint config_keyboard_reset_state;
+/*! The key combo which resets the keybaord chains */
+extern ObKeyboardKey config_keyboard_reset_key;
/*! Number of pixels a drag must go before being considered a drag */
extern gint config_mouse_threshold;
static void dock_app_grab_button(ObDockApp *app, gboolean grab)
{
if (grab) {
- grab_button_full(config_dock_app_move_button,
- config_dock_app_move_modifiers, app->icon_win,
+ grab_button_full(config_dock_app_move_button.button,
+ config_dock_app_move_button.modifiers, app->icon_win,
ButtonPressMask | ButtonReleaseMask |
ButtonMotionMask,
GrabModeAsync, OB_CURSOR_MOVE);
} else {
- ungrab_button(config_dock_app_move_button,
- config_dock_app_move_modifiers, app->icon_win);
+ ungrab_button(config_dock_app_move_button.button,
+ config_dock_app_move_button.modifiers, app->icon_win);
}
}
p = p->next_sibling;
}
if (curpos)
- grab_key(config_keyboard_reset_keycode,
- config_keyboard_reset_state,
+ grab_key(config_keyboard_reset_key.keycode,
+ config_keyboard_reset_key.modifiers,
obt_root(ob_screen), GrabModeAsync);
}
}
mods = obt_keyboard_only_modmasks(e->xkey.state);
- if (e->xkey.keycode == config_keyboard_reset_keycode &&
- mods == config_keyboard_reset_state)
+ if (e->xkey.keycode == config_keyboard_reset_key.keycode &&
+ mods == config_keyboard_reset_key.modifiers)
{
if (chain_timer) g_source_remove(chain_timer);
keyboard_reset_chains(-1);
#include <glib.h>
#include <X11/Xlib.h>
+typedef struct _ObKeyboardKey ObKeyboardKey;
+
struct _ObClient;
struct _ObActionList;
extern KeyBindingTree *keyboard_firstnode;
+struct _ObKeyboardKey {
+ guint keycode;
+ guint modifiers;
+};
+
void keyboard_startup(gboolean reconfig);
void keyboard_shutdown(gboolean reconfig);
#include <X11/Xlib.h>
+typedef struct _ObMouseButton ObMouseButton;
+
struct _ObActionList;
+struct _ObMouseButton {
+ guint button;
+ guint modifiers;
+};
+
void mouse_startup(gboolean reconfig);
void mouse_shutdown(gboolean reconfig);