/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
-event.c for the Openbox window manager
-Copyright (c) 2003 Ben Jansens
+ event.c for the Openbox window manager
+ Copyright (c) 2004 Mikael Magnusson
+ Copyright (c) 2003 Ben Jansens
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-See the COPYING file for a copy of the GNU General Public License.
+ See the COPYING file for a copy of the GNU General Public License.
*/
#include "event.h"
#ifdef HAVE_SIGNAL_H
# include <signal.h>
#endif
+#ifdef XKB
+# include <X11/XKBlib.h>
+#endif
#ifdef USE_SM
#include <X11/ICE/ICElib.h>
#endif
client_remove_destructor(focus_delay_client_dest);
+ client_remove_destructor(event_client_dest);
XFreeModifiermap(modmap);
}
}
#define STRIP_MODS(s) \
- s &= ~(LockMask | NumLockMask | ScrollLockMask), \
- /* kill off the Button1Mask etc, only want the modifiers */ \
- s &= (ControlMask | ShiftMask | Mod1Mask | \
+ s &= ~(LockMask | NumLockMask | ScrollLockMask), \
+ /* kill off the Button1Mask etc, only want the modifiers */ \
+ s &= (ControlMask | ShiftMask | Mod1Mask | \
Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask) \
static void event_hack_mods(XEvent *e)
{
+#ifdef XKB
+ XkbStateRec xkb_state;
+#endif
KeyCode *kp;
gint i, k;
STRIP_MODS(e->xkey.state);
/* remove from the state the mask of the modifier being released, if
it is a modifier key being released (this is a little ugly..) */
+#ifdef XKB
+ if (XkbGetState(ob_display, XkbUseCoreKbd, &xkb_state) == Success) {
+ e->xkey.state = xkb_state.compat_state;
+ break;
+ }
+#endif
kp = modmap->modifiermap;
for (i = 0; i < mask_table_size; ++i) {
for (k = 0; k < modmap->max_keypermod; ++k) {
want will be of type NotifyAncestor. This situation does not occur
for FocusOut, so it is safely ignored there.
*/
- if (INVALID_FOCUSIN(e) ||
+ if (INVALID_FOCUSIN(e) ||
client == NULL) {
#ifdef DEBUG_FOCUS
ob_debug("FocusIn on %lx mode %d detail %d IGNORED\n",
#endif
break;
case FocusOut:
- if (INVALID_FOCUSOUT(e)) {
+ if (INVALID_FOCUSOUT(e)) {
#ifdef DEBUG_FOCUS
ob_debug("FocusOut on %lx mode %d detail %d IGNORED\n",
e->xfocus.window, e->xfocus.mode, e->xfocus.detail);
menu_can_hide = FALSE;
ob_main_loop_timeout_add(ob_main_loop,
- G_USEC_PER_SEC / 4,
+ config_menu_hide_delay * 1000,
menu_hide_delay_func,
NULL, NULL);
break;
default:
;
-#ifdef VIDMODE
- if (extensions_vidmode && e->type == extensions_vidmode_event_basep) {
- ob_debug("VIDMODE EVENT\n");
- }
-#endif
}
}
if (config_focus_follow && config_focus_delay)
ob_main_loop_timeout_remove_data(ob_main_loop,
focus_delay_func,
- client);
+ client, TRUE);
break;
default:
break;
if (e->xconfigurerequest.value_mask & CWY)
y = newy;
}
-
+
switch (client->gravity) {
case NorthEastGravity:
case EastGravity:
if (e->xclient.data.l[0] & 1 << 9)
y = newy;
}
-
+
client_configure(client, OB_CORNER_TOPLEFT,
x, y, w, h, FALSE, TRUE);
{
switch (e->type) {
case ButtonPress:
- stacking_raise(DOCK_AS_WINDOW(s));
+ if (e->xbutton.button == 1)
+ stacking_raise(DOCK_AS_WINDOW(s), FALSE);
+ else if (e->xbutton.button == 2)
+ stacking_lower(DOCK_AS_WINDOW(s), FALSE);
break;
case EnterNotify:
dock_hide(FALSE);
static void focus_delay_client_dest(ObClient *client, gpointer data)
{
- ob_main_loop_timeout_remove_data(ob_main_loop, focus_delay_func, client);
+ ob_main_loop_timeout_remove_data(ob_main_loop, focus_delay_func, client, TRUE);
}
static void event_client_dest(ObClient *client, gpointer data)