From: Dana Jansens Date: Tue, 29 May 2007 20:48:24 +0000 (+0000) Subject: merge r7035-7053 from trunk X-Git-Tag: openbox-3_3_995-RELEASE~40 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=3f7344d2fbfed61a81654d379a28f16749b2d1f3;p=dana%2Fopenbox.git merge r7035-7053 from trunk --- diff --git a/openbox/client.c b/openbox/client.c index 0701d3fa..e1c814ce 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -390,6 +390,8 @@ void client_manage(Window window) "program + user specified" : "BADNESS !?")))), placew, placeh); + /* splash screens are also returned as TRUE for transient, + and so will be forced on screen below */ transient = place_client(self, &placex, &placey, settings); /* make sure the window is visible. */ @@ -403,7 +405,11 @@ void client_manage(Window window) place.c or by the user are allowed partially off-screen and on xinerama divides (ie, it is up to the placement routines to avoid - the xinerama divides) */ + the xinerama divides) + + splash screens get "transient" set to TRUE by + the place_client call + */ transient || (!(self->positioned & USPosition) && client_normal(self) && @@ -414,7 +420,11 @@ void client_manage(Window window) the visible screen area on its monitor. Use basically the same rules for forcing the window on screen in the client_find_onscreen call. - do this after place_client, it chooses the monitor! */ + do this after place_client, it chooses the monitor! + + splash screens get "transient" set to TRUE by + the place_client call + */ if (transient || (!(self->sized & USSize) && client_normal(self) && diff --git a/openbox/client_list_combined_menu.c b/openbox/client_list_combined_menu.c index 52ebce43..cf85fd65 100644 --- a/openbox/client_list_combined_menu.c +++ b/openbox/client_list_combined_menu.c @@ -82,6 +82,8 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data) e->data.normal.icon_width = icon->width; e->data.normal.icon_height = icon->height; e->data.normal.icon_data = icon->data; + e->data.normal.icon_alpha = + c->iconic ? OB_ICONIC_ALPHA : 0xff; } } } diff --git a/openbox/client_list_menu.c b/openbox/client_list_menu.c index 82716c3c..25864684 100644 --- a/openbox/client_list_menu.c +++ b/openbox/client_list_menu.c @@ -84,6 +84,7 @@ static gboolean desk_menu_update(ObMenuFrame *frame, gpointer data) e->data.normal.icon_width = icon->width; e->data.normal.icon_height = icon->height; e->data.normal.icon_data = icon->data; + e->data.normal.icon_alpha = c->iconic ? OB_ICONIC_ALPHA : 0xff; } } } diff --git a/openbox/event.c b/openbox/event.c index 0799f3b3..154b8347 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1101,13 +1101,14 @@ static void event_handle_client(ObClient *client, XEvent *e) desktop. eg. open amarok window on desktop 1, switch to desktop 2, click amarok tray icon. it will move by its decoration size. */ - if (move && !resize && - x != client->area.x && + if (x != client->area.x && x == (client->frame->area.x + client->frame->size.left - (gint)client->border_width) && y != client->area.y && y == (client->frame->area.y + client->frame->size.top - - (gint)client->border_width)) + (gint)client->border_width) && + w == client->area.width && + h == client->area.height) { ob_debug_type(OB_DEBUG_APP_BUGS, "Application %s is trying to move via " diff --git a/openbox/focus_cycle.c b/openbox/focus_cycle.c index bfbc2723..77740767 100644 --- a/openbox/focus_cycle.c +++ b/openbox/focus_cycle.c @@ -346,9 +346,10 @@ static ObClient *focus_find_directional(ObClient *c, ObDirection dir, if (offset > distance) score += 1000000; - if (best_score == -1 || score < best_score) - best_client = cur, - best_score = score; + if (best_score == -1 || score < best_score) { + best_client = cur; + best_score = score; + } } return best_client; diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c index 89c3c82c..8e58c935 100644 --- a/openbox/focus_cycle_popup.c +++ b/openbox/focus_cycle_popup.c @@ -321,6 +321,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c) /* set up the hilite texture for the background */ p->a_bg->texture[0].data.rgba.width = rgbaw; p->a_bg->texture[0].data.rgba.height = rgbah; + p->a_bg->texture[0].data.rgba.alpha = 0xff; p->hilite_rgba = g_new(RrPixel32, rgbaw * rgbah); p->a_bg->texture[0].data.rgba.data = p->hilite_rgba; @@ -405,7 +406,6 @@ 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); @@ -421,33 +421,14 @@ 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; - 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; + p->a_icon->texture[0].data.rgba.alpha = + target->client->iconic ? OB_ICONIC_ALPHA : 0xff; + 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); } } diff --git a/openbox/frame.c b/openbox/frame.c index 9c927bde..e856a10d 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -716,10 +716,6 @@ void frame_adjust_area(ObFrame *self, gboolean moved, self->size.left, self->size.top, self->client->area.width, self->client->area.height); - - /* when the client has StaticGravity, it likes to move around. */ - XMoveWindow(ob_display, self->client->window, - self->size.left, self->size.top); } } @@ -733,6 +729,10 @@ void frame_adjust_area(ObFrame *self, gboolean moved, self->size.top + self->size.bottom)); if ((moved || resized) && !fake) { + /* when the client has StaticGravity, it likes to move around. */ + XMoveWindow(ob_display, self->client->window, + self->size.left, self->size.top); + /* find the new coordinates, done after setting the frame.size, for frame_client_gravity. */ self->area.x = self->client->area.x; diff --git a/openbox/framerender.c b/openbox/framerender.c index b86f4692..2fec1a55 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -344,6 +344,7 @@ static void framerender_icon(ObFrame *self, RrAppearance *a) a->texture[0].type = RR_TEXTURE_RGBA; a->texture[0].data.rgba.width = icon->width; a->texture[0].data.rgba.height = icon->height; + a->texture[0].data.rgba.alpha = 0xff; a->texture[0].data.rgba.data = icon->data; } else a->texture[0].type = RR_TEXTURE_NONE; diff --git a/openbox/menu.h b/openbox/menu.h index 990e946c..6d4bbd47 100644 --- a/openbox/menu.h +++ b/openbox/menu.h @@ -116,6 +116,7 @@ struct _ObNormalMenuEntry { /* Icon shit */ gint icon_width; gint icon_height; + gint icon_alpha; RrPixel32 *icon_data; /* Mask icon */ diff --git a/openbox/menuframe.c b/openbox/menuframe.c index b908ad4f..654cf2ba 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -499,6 +499,8 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) self->entry->data.normal.icon_width; self->a_icon->texture[0].data.rgba.height = self->entry->data.normal.icon_height; + self->a_icon->texture[0].data.rgba.alpha = + self->entry->data.normal.icon_alpha; self->a_icon->texture[0].data.rgba.data = self->entry->data.normal.icon_data; self->a_icon->surface.parent = item_a; diff --git a/openbox/misc.h b/openbox/misc.h index f55feed9..2b5584d7 100644 --- a/openbox/misc.h +++ b/openbox/misc.h @@ -19,6 +19,12 @@ #ifndef __ob__misc_h #define __ob__misc_h +/*! The alpha value to use for icons of iconified windows in various places + like the focus cycle popup and client list menus. + Give iconic windows 7/16 alpha. A little under 50%. + */ +#define OB_ICONIC_ALPHA 0x70 + typedef enum { OB_CURSOR_NONE, diff --git a/openbox/place.c b/openbox/place.c index 99257bf1..e9832ec3 100644 --- a/openbox/place.c +++ b/openbox/place.c @@ -437,7 +437,7 @@ static gboolean place_per_app_setting(ObClient *client, gint *x, gint *y, return TRUE; } -static gboolean place_transient(ObClient *client, gint *x, gint *y) +static gboolean place_transient_splash(ObClient *client, gint *x, gint *y) { if (client->transient_for && client->type == OB_CLIENT_TYPE_DIALOG) { if (client->transient_for != OB_TRAN_GROUP) { @@ -480,7 +480,9 @@ static gboolean place_transient(ObClient *client, gint *x, gint *y) } } - if (client->transient) { + if ((client->transient && client->type == OB_CLIENT_TYPE_DIALOG) + || client->type == OB_CLIENT_TYPE_SPLASH) + { Rect **areas; areas = pick_head(client); @@ -502,7 +504,7 @@ gboolean place_client(ObClient *client, gint *x, gint *y, gboolean ret = FALSE; if (client->positioned) return FALSE; - if (place_transient(client, x, y)) + if (place_transient_splash(client, x, y)) ret = TRUE; else if (!( place_per_app_setting(client, x, y, settings) || diff --git a/openbox/popup.c b/openbox/popup.c index 2768ee2b..f46a3a7f 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -324,6 +324,7 @@ void icon_popup_delay_show(ObIconPopup *self, gulong usec, self->a_icon->texture[0].type = RR_TEXTURE_RGBA; self->a_icon->texture[0].data.rgba.width = icon->width; self->a_icon->texture[0].data.rgba.height = icon->height; + self->a_icon->texture[0].data.rgba.alpha = 0xff; self->a_icon->texture[0].data.rgba.data = icon->data; } else self->a_icon->texture[0].type = RR_TEXTURE_NONE; diff --git a/openbox/screen.c b/openbox/screen.c index 80e7acb8..a265df0a 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -311,13 +311,21 @@ gboolean screen_annex() static void screen_tell_ksplash() { XEvent e; - const char *args[] = { "dcop", "ksplash", "ksplash", - "upAndRunning(QString)", "wm started", NULL }; + char **argv; + + argv = g_new(gchar*, 6); + argv[0] = g_strdup("dcop"); + argv[1] = g_strdup("ksplash"); + argv[2] = g_strdup("ksplash"); + argv[3] = g_strdup("upAndRunning(QString)"); + argv[4] = g_strdup("wm started"); + argv[5] = NULL; /* tell ksplash through the dcop server command line interface */ - g_spawn_async(NULL, args, NULL, + g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, NULL, NULL); + g_strfreev(argv); /* i'm not sure why we do this, kwin does it, but ksplash doesn't seem to hear it anyways. perhaps it is for old ksplash. or new ksplash. or diff --git a/render/image.c b/render/image.c index 3c08444d..4b123040 100644 --- a/render/image.c +++ b/render/image.c @@ -152,7 +152,8 @@ void RrImageDraw(RrPixel32 *target, RrTextureRGBA *rgba, while (num_pixels-- > 0) { guchar alpha, r, g, b, bgr, bgg, bgb; - alpha = *source >> RrDefaultAlphaOffset; + /* apply the rgba's opacity as well */ + alpha = ((*source >> RrDefaultAlphaOffset) * rgba->alpha) >> 8; r = *source >> RrDefaultRedOffset; g = *source >> RrDefaultGreenOffset; b = *source >> RrDefaultBlueOffset; diff --git a/render/render.h b/render/render.h index ac1deb4b..c13894aa 100644 --- a/render/render.h +++ b/render/render.h @@ -146,6 +146,7 @@ struct _RrTextureMask { struct _RrTextureRGBA { gint width; gint height; + gint alpha; RrPixel32 *data; /* cached scaled so we don't have to scale often */ gint cwidth;