X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=625584906187834e7a65094dcc6e3c921d1e570f;hb=1c9a69e1df14f9dc571d739b2acfd9c09b5b7fd7;hp=a5d983c3b64ddda26ceb0b70a10a7a01a2ca64a9;hpb=0e6161b0d4953b81273200fd31bd9c14fac4981b;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index a5d983c3..62558490 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) 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" @@ -141,10 +142,10 @@ void event_startup(gboolean reconfig) const KeyCode num_lock = XKeysymToKeycode(ob_display, XK_Num_Lock); const KeyCode scroll_lock = XKeysymToKeycode(ob_display, XK_Scroll_Lock); - + for (cnt = 0; cnt < size; ++cnt) { if (! modmap->modifiermap[cnt]) continue; - + if (num_lock == modmap->modifiermap[cnt]) NumLockMask = mask_table[cnt / modmap->max_keypermod]; if (scroll_lock == modmap->modifiermap[cnt]) @@ -251,9 +252,9 @@ static void event_set_lasttime(XEvent *e) } #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) @@ -317,7 +318,7 @@ static gboolean event_ignore(XEvent *e, ObClient *client) 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", @@ -336,7 +337,7 @@ static gboolean event_ignore(XEvent *e, ObClient *client) #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); @@ -495,7 +496,7 @@ static void event_process(const XEvent *ec, gpointer data) /* unhandled configure requests must be used to configure the window directly */ XWindowChanges xwc; - + xwc.x = e->xconfigurerequest.x; xwc.y = e->xconfigurerequest.y; xwc.width = e->xconfigurerequest.width; @@ -531,7 +532,7 @@ static void event_process(const XEvent *ec, gpointer data) 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); @@ -840,7 +841,7 @@ static void event_handle_client(ObClient *client, XEvent *e) if (e->xconfigurerequest.value_mask & CWY) y = newy; } - + switch (client->gravity) { case NorthEastGravity: case EastGravity: @@ -1038,7 +1039,7 @@ static void event_handle_client(ObClient *client, XEvent *e) if (e->xclient.data.l[0] & 1 << 9) y = newy; } - + client_configure(client, OB_CORNER_TOPLEFT, x, y, w, h, FALSE, TRUE);