/* 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);
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)
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) {
/* 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 ||
} 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);
}
{
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();
}
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;
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);
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);
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);
}
}