"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. */
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) &&
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) &&
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;
}
}
}
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;
}
}
}
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 "
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;
/* 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;
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;
- 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);
}
}
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);
}
}
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;
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;
/* Icon shit */
gint icon_width;
gint icon_height;
+ gint icon_alpha;
RrPixel32 *icon_data;
/* Mask icon */
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;
#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,
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) {
}
}
- if (client->transient) {
+ if ((client->transient && client->type == OB_CLIENT_TYPE_DIALOG)
+ || client->type == OB_CLIENT_TYPE_SPLASH)
+ {
Rect **areas;
areas = pick_head(client);
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) ||
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;
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
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;
struct _RrTextureRGBA {
gint width;
gint height;
+ gint alpha;
RrPixel32 *data;
/* cached scaled so we don't have to scale often */
gint cwidth;