X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=2c73289ef2ce761a3a63cfafd08dcce1516096c8;hb=fa0ae17adbc8f73b707c33836d37841e81b9303a;hp=a0ce223a231eaa5a14b4170e54d2c27f948f2ef7;hpb=d78ae0546dae17eda6084a1bd33e63637ba802e5;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index a0ce223a..2c73289e 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -417,6 +417,7 @@ static void print_focusevent(XEvent *e) case NotifyGrab: modestr="NotifyGrab"; break; case NotifyUngrab: modestr="NotifyUngrab"; break; case NotifyWhileGrabbed: modestr="NotifyWhileGrabbed"; break; + default: g_assert_not_reached(); } switch (detail) { case NotifyAncestor: detailstr="NotifyAncestor"; break; @@ -427,6 +428,7 @@ static void print_focusevent(XEvent *e) case NotifyPointer: detailstr="NotifyPointer"; break; case NotifyPointerRoot: detailstr="NotifyPointerRoot"; break; case NotifyDetailNone: detailstr="NotifyDetailNone"; break; + default: g_assert_not_reached(); } if (mode == NotifyGrab || mode == NotifyUngrab) @@ -656,7 +658,7 @@ static void event_process(const XEvent *ec, gpointer data) else if (e->type == MappingNotify) { /* keyboard layout changes for modifier mapping changes. reload the modifier map, and rebind all the key bindings as appropriate */ - ob_debug("Kepboard map changed. Reloading keyboard bindings."); + ob_debug("Keyboard map changed. Reloading keyboard bindings."); ob_set_state(OB_STATE_RECONFIGURING); obt_keyboard_reload(); keyboard_rebind(); @@ -1125,7 +1127,6 @@ static void event_handle_client(ObClient *client, XEvent *e) move = TRUE; } - if (e->xconfigurerequest.value_mask & CWStackMode) { ObClient *sibling = NULL; gulong ignore_start; @@ -1345,7 +1346,7 @@ static void event_handle_client(ObClient *client, XEvent *e) } else ob_debug_type(OB_DEBUG_APP_BUGS, "_NET_ACTIVE_WINDOW message for window %s is " - "missing source indication"); + "missing source indication", client->title); client_activate(client, TRUE, TRUE, TRUE, (e->xclient.data.l[0] == 0 || e->xclient.data.l[0] == 2)); @@ -1527,6 +1528,13 @@ static void event_handle_client(ObClient *client, XEvent *e) reconfigure the window if it needs to. emacs will update its normal hints every time it receives a conigurenotify */ client_reconfigure(client, FALSE); + } else if (msgtype == OBT_PROP_ATOM(MOTIF_WM_HINTS)) { + client_get_mwm_hints(client); + /* This can override some mwm hints */ + client_get_type_and_transientness(client); + + /* Apply the changes to the window */ + client_setup_decor_and_functions(client, TRUE); } else if (msgtype == XA_WM_HINTS) { client_update_wmhints(client); } else if (msgtype == XA_WM_TRANSIENT_FOR) { @@ -1577,11 +1585,26 @@ static void event_handle_client(ObClient *client, XEvent *e) default: ; #ifdef SHAPE - if (obt_display_extension_shape && - e->type == obt_display_extension_shape_basep) { - client->shaped = ((XShapeEvent*)e)->shaped; - frame_adjust_shape(client->frame); + int kind; + if (obt_display_extension_shape && + e->type == obt_display_extension_shape_basep) + { + switch (((XShapeEvent*)e)->kind) { + case ShapeBounding: + case ShapeClip: + client->shaped = ((XShapeEvent*)e)->shaped; + kind = ShapeBounding; + break; + case ShapeInput: + client->shaped_input = ((XShapeEvent*)e)->shaped; + kind = ShapeInput; + break; + default: + g_assert_not_reached(); + } + frame_adjust_shape_kind(client->frame, kind); + } } #endif } @@ -2022,7 +2045,7 @@ void event_cancel_all_key_grabs(void) XSync(obt_display, FALSE); } -gboolean event_time_after(Time t1, Time t2) +gboolean event_time_after(guint32 t1, guint32 t2) { g_assert(t1 != CurrentTime); g_assert(t2 != CurrentTime); @@ -2035,8 +2058,10 @@ gboolean event_time_after(Time t1, Time t2) - http://tronche.com/gui/x/xlib/input/pointer-grabbing.html */ - /* TIME_HALF is half of the number space of a Time type variable */ -#define TIME_HALF (Time)(1 << (sizeof(Time)*8-1)) + /* TIME_HALF is not half of the number space of a Time type variable. + * Rather, it is half the number space of a timestamp value, which is + * always 32 bits. */ +#define TIME_HALF (guint32)(1 << 31) if (t2 >= TIME_HALF) /* t2 is in the second half so t1 might wrap around and be smaller than