X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=2c13ceda2617088903d5829987d0f4355e90f299;hb=4d50b21835d7dd00ecc40efd64c5573d7e048500;hp=c0e6f96c39578a2ebb9d43eec136d20a3d219111;hpb=335e8acbfc5d2824f1fd2cb67a5add8e1ed40b06;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index c0e6f96c..2c13ceda 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1,19 +1,20 @@ /* -*- 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) 2006 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" @@ -50,6 +51,9 @@ See the COPYING file for a copy of the GNU General Public License. #ifdef HAVE_SIGNAL_H # include #endif +#ifdef XKB +# include +#endif #ifdef USE_SM #include @@ -171,6 +175,7 @@ void event_shutdown(gboolean reconfig) #endif client_remove_destructor(focus_delay_client_dest); + client_remove_destructor(event_client_dest); XFreeModifiermap(modmap); } @@ -258,6 +263,9 @@ static void event_set_lasttime(XEvent *e) static void event_hack_mods(XEvent *e) { +#ifdef XKB + XkbStateRec xkb_state; +#endif KeyCode *kp; gint i, k; @@ -273,6 +281,12 @@ static void event_hack_mods(XEvent *e) 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) { @@ -587,11 +601,6 @@ static void event_handle_root(XEvent *e) break; default: ; -#ifdef VIDMODE - if (extensions_vidmode && e->type == extensions_vidmode_event_basep) { - ob_debug("VIDMODE EVENT\n"); - } -#endif } } @@ -715,7 +724,7 @@ static void event_handle_client(ObClient *client, XEvent *e) 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; @@ -1133,7 +1142,10 @@ static void event_handle_dock(ObDock *s, XEvent *e) { 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); @@ -1275,7 +1287,7 @@ static gboolean focus_delay_func(gpointer data) 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)