From 9d7d09655478f2f07122d809193b90f296734bb9 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 28 May 2007 04:14:30 +0000 Subject: [PATCH] merge r6977-6988 from trunk --- openbox/client.c | 19 +++++++++++++++---- openbox/event.c | 20 ++++++++++++++++++-- openbox/focus_cycle_popup.c | 24 +++++++++++++++++++++++- 3 files changed, 56 insertions(+), 7 deletions(-) diff --git a/openbox/client.c b/openbox/client.c index 37d27ab5..a8015978 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -441,7 +441,6 @@ void client_manage(Window window) /* do this after the window is placed, so the premax/prefullscreen numbers won't be all wacko!! - also, this moves the window to the position where it has been placed */ client_apply_startup_state(self); @@ -2376,9 +2375,21 @@ ObClient *client_search_focus_tree_full(ObClient *self) gboolean client_has_parent(ObClient *self) { - return (self->transient_for && - (self->transient_for != OB_TRAN_GROUP || - (self->group && self->group->members->next))); + if (self->transient_for) { + if (self->transient_for != OB_TRAN_GROUP) { + if (client_normal(self->transient_for)) + return TRUE; + } + else if (self->group) { + GSList *it; + + for (it = self->group->members; it; it = g_slist_next(it)) { + if (it->data != self && client_normal(it->data)) + return TRUE; + } + } + } + return FALSE; } static ObStackingLayer calc_layer(ObClient *self) diff --git a/openbox/event.c b/openbox/event.c index f3ed676e..ff2d560d 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1431,6 +1431,7 @@ static void event_handle_client(ObClient *client, XEvent *e) client_update_normal_hints(client); /* normal hints can make a window non-resizable */ client_setup_decor_and_functions(client); + client_reconfigure(client); } else if (msgtype == XA_WM_HINTS) { client_update_wmhints(client); } else if (msgtype == XA_WM_TRANSIENT_FOR) { @@ -1439,6 +1440,7 @@ static void event_handle_client(ObClient *client, XEvent *e) /* type may have changed, so update the layer */ client_calc_layer(client); client_setup_decor_and_functions(client); + client_reconfigure(client); } else if (msgtype == prop_atoms.net_wm_name || msgtype == prop_atoms.wm_name || msgtype == prop_atoms.net_wm_icon_name || @@ -1447,10 +1449,14 @@ static void event_handle_client(ObClient *client, XEvent *e) } else if (msgtype == prop_atoms.wm_protocols) { client_update_protocols(client); client_setup_decor_and_functions(client); + client_reconfigure(client); } else if (msgtype == prop_atoms.net_wm_strut) { client_update_strut(client); } + else if (msgtype == prop_atoms.net_wm_strut_partial) { + client_update_strut(client); + } else if (msgtype == prop_atoms.net_wm_icon) { client_update_icons(client); } @@ -1679,8 +1685,11 @@ static gboolean event_handle_menu(XEvent *ev) { if ((e = menu_entry_frame_under(ev->xbutton.x_root, ev->xbutton.y_root))) + { + menu_frame_select(e->frame, e, TRUE); menu_entry_frame_execute(e, ev->xbutton.state, ev->xbutton.time); + } else menu_frame_hide_all(); } @@ -1689,7 +1698,10 @@ static gboolean event_handle_menu(XEvent *ev) if ((e = g_hash_table_lookup(menu_frame_map, &ev->xcrossing.window))) { if (e->ignore_enters) --e->ignore_enters; - else + else if (!(f = find_active_menu()) || + f == e->frame || + f->parent == e->frame || + f->child == e->frame) menu_frame_select(e->frame, e, FALSE); } break; @@ -1708,7 +1720,11 @@ static gboolean event_handle_menu(XEvent *ev) case MotionNotify: if ((e = menu_entry_frame_under(ev->xmotion.x_root, ev->xmotion.y_root))) - menu_frame_select(e->frame, e, FALSE); + if (!(f = find_active_menu()) || + f == e->frame || + f->parent == e->frame || + f->child == e->frame) + menu_frame_select(e->frame, e, FALSE); break; case KeyPress: ret = event_handle_menu_keyboard(ev); diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c index e282465e..89c3c82c 100644 --- a/openbox/focus_cycle_popup.c +++ b/openbox/focus_cycle_popup.c @@ -405,6 +405,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c) const gint row = i / icons_per_row; /* starting from 0 */ const gint col = i % icons_per_row; /* starting from 0 */ gint innerx, innery; + RrPixel32 *icon_data; /* find the dimensions of the icon inside it */ innerx = icons_center_x + l + (col * ICON_SIZE); @@ -420,12 +421,33 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c) icon = client_icon(target->client, innerw, innerh); p->a_icon->texture[0].data.rgba.width = icon->width; p->a_icon->texture[0].data.rgba.height = icon->height; - p->a_icon->texture[0].data.rgba.data = icon->data; + if (target->client->iconic) { + /* fade iconic windows */ + gint i; + RrPixel32 *d, *s; + + icon_data = g_new(RrPixel32, icon->width * icon->height); + + s = icon->data; + d = icon_data; + for (i = 0; i < icon->width * icon->height; ++i, ++d, ++s) { + /* 7/16 opacity */ + gint a = ((*s >> RrDefaultAlphaOffset) & 0xff); + *d = *s - (a << RrDefaultAlphaOffset) + + (((a>>1) - (a>>4)) << RrDefaultAlphaOffset); + } + + } else + icon_data = icon->data; + p->a_icon->texture[0].data.rgba.data = icon_data; /* draw the icon */ p->a_icon->surface.parentx = innerx; p->a_icon->surface.parenty = innery; RrPaint(p->a_icon, target->win, innerw, innerh); + + if (target->client->iconic) + g_free(icon_data); } } -- 2.34.1