diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | matchbox/core/mb-wm-main-context.c | 28 | ||||
-rw-r--r-- | matchbox/core/mb-wm-main-context.h | 1 | ||||
-rw-r--r-- | matchbox/core/mb-wm-types.h | 4 |
4 files changed, 40 insertions, 0 deletions
@@ -1,5 +1,12 @@ 2008-06-05 Tomas Frydrych <tf@o-hand.com> + * matchbox/core/mb-wm-main-context.c: + * matchbox/core/mb-wm-main-context.h: + * matchbox/core/mb-wm-types.h: + Added hook for ClientMessage events. + +2008-06-05 Tomas Frydrych <tf@o-hand.com> + * /matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c: (mb_wm_comp_mgr_clutter_restack_real): Do a parent check when restacking to avoid triggering clutter diff --git a/matchbox/core/mb-wm-main-context.c b/matchbox/core/mb-wm-main-context.c index 6841ee4..f74d249 100644 --- a/matchbox/core/mb-wm-main-context.c +++ b/matchbox/core/mb-wm-main-context.c @@ -224,6 +224,9 @@ mb_wm_main_context_handle_x_event (XEvent *xev, switch (xev->type) { case ClientMessage: + /* + * TODO -- perhaps this should not be special-cased. + */ if (xev->xany.window == wm->root_win->xwindow || ((XClientMessageEvent *)xev)->message_type == wm->atoms[MBWM_ATOM_NET_ACTIVE_WINDOW] || @@ -233,6 +236,24 @@ mb_wm_main_context_handle_x_event (XEvent *xev, mb_wm_root_window_handle_message (wm->root_win, (XClientMessageEvent *)xev); } + + iter = ctx->event_funcs.client_message; + + while (iter) + { + Window msg_xwin = XE_ITER_GET_XWIN(iter); + MBWMList * next = iter->next; + + if (msg_xwin == None || msg_xwin == xwin) + { + if (!(MBWindowManagerClientMessageFunc)XE_ITER_GET_FUNC(iter) + ((XClientMessageEvent*)&xev->xclient, + XE_ITER_GET_DATA(iter))) + break; + } + + iter = next; + } break; case Expose: break; @@ -654,6 +675,10 @@ mb_wm_main_context_x_event_handler_add (MBWMMainContext *ctx, ctx->event_funcs.motion_notify = mb_wm_util_list_append (ctx->event_funcs.motion_notify, func_info); break; + case ClientMessage: + ctx->event_funcs.client_message = + mb_wm_util_list_append (ctx->event_funcs.client_message, func_info); + break; default: break; @@ -716,6 +741,9 @@ mb_wm_main_context_x_event_handler_remove (MBWMMainContext *ctx, case MotionNotify: l_start = &ctx->event_funcs.motion_notify; break; + case ClientMessage: + l_start = &ctx->event_funcs.client_message; + break; default: break; diff --git a/matchbox/core/mb-wm-main-context.h b/matchbox/core/mb-wm-main-context.h index 9cffc0d..d93574c 100644 --- a/matchbox/core/mb-wm-main-context.h +++ b/matchbox/core/mb-wm-main-context.h @@ -45,6 +45,7 @@ typedef struct MBWMEventFuncs MBWMList *button_press; MBWMList *button_release; MBWMList *motion_notify; + MBWMList *client_message; #if ENABLE_COMPOSITE MBWMList *damage_notify; diff --git a/matchbox/core/mb-wm-types.h b/matchbox/core/mb-wm-types.h index 74bbf7e..b71f683 100644 --- a/matchbox/core/mb-wm-types.h +++ b/matchbox/core/mb-wm-types.h @@ -307,6 +307,10 @@ typedef Bool (*MBWindowManagerMapNotifyFunc) (XMapEvent *xev, void *userdata); +typedef Bool (*MBWindowManagerClientMessageFunc) + (XClientMessageEvent *xev, + void *userdata); + typedef Bool (*MBWindowManagerMapRequestFunc) (XMapRequestEvent *xev, void *userdata); |