*/
#include "grab.h"
+#include "modkeys.h"
#include "openbox.h"
#include "event.h"
#include "xerror.h"
static Time ungrab_time()
{
Time t = event_curtime;
- if (!(t == CurrentTime || event_time_after(t, grab_time)))
+ if (grab_time == CurrentTime ||
+ !(t == CurrentTime || event_time_after(t, grab_time)))
/* When the time moves backward on the server, then we can't use
the grab time because that will be in the future. So instead we
have to use CurrentTime.
void grab_startup(gboolean reconfig)
{
guint i = 0;
+ guint num, caps, scroll;
- if (reconfig) return;
+ num = modkeys_key_to_mask(OB_MODKEY_KEY_NUMLOCK);
+ caps = modkeys_key_to_mask(OB_MODKEY_KEY_CAPSLOCK);
+ scroll = modkeys_key_to_mask(OB_MODKEY_KEY_SCROLLLOCK);
mask_list[i++] = 0;
- mask_list[i++] = LockMask;
- mask_list[i++] = NumLockMask;
- mask_list[i++] = LockMask | NumLockMask;
- mask_list[i++] = ScrollLockMask;
- mask_list[i++] = ScrollLockMask | LockMask;
- mask_list[i++] = ScrollLockMask | NumLockMask;
- mask_list[i++] = ScrollLockMask | LockMask | NumLockMask;
+ mask_list[i++] = num;
+ mask_list[i++] = caps;
+ mask_list[i++] = scroll;
+ mask_list[i++] = num | caps;
+ mask_list[i++] = num | scroll;
+ mask_list[i++] = caps | scroll;
+ mask_list[i++] = num | caps | scroll;
g_assert(i == MASK_LIST_SIZE);
}