- if (client->transient_for && client->type == OB_CLIENT_TYPE_DIALOG) {
- if (client->transient_for != OB_TRAN_GROUP) {
- ObClient *c = client;
- ObClient *p = client->transient_for;
-
- if (client_normal(p)) {
- *x = (p->frame->area.width - c->frame->area.width) / 2 +
- p->frame->area.x;
- *y = (p->frame->area.height - c->frame->area.height) / 2 +
- p->frame->area.y;
- return TRUE;
- }
- } else {
- GSList *it;
- gboolean first = TRUE;
- gint l, r, t, b;
- for (it = client->group->members; it; it = g_slist_next(it)) {
- ObClient *m = it->data;
- if (!(m == client || m->transient_for) && client_normal(m)) {
- if (first) {
- l = RECT_LEFT(m->frame->area);
- t = RECT_TOP(m->frame->area);
- r = RECT_RIGHT(m->frame->area);
- b = RECT_BOTTOM(m->frame->area);
- first = FALSE;
- } else {
- l = MIN(l, RECT_LEFT(m->frame->area));
- t = MIN(t, RECT_TOP(m->frame->area));
- r = MAX(r, RECT_RIGHT(m->frame->area));
- b = MAX(b, RECT_BOTTOM(m->frame->area));
- }
+ if (!settings || !settings->size_given)
+ return;
+
+ ob_debug("sizing by per-app settings");
+
+ g_assert(settings->width_num > 0);
+ g_assert(settings->width_denom >= 0);
+ g_assert(settings->height_num > 0);
+ g_assert(settings->height_denom >= 0);
+
+ if (!settings->width_denom)
+ *w = settings->width_num;
+ else {
+ *w = screen->width * settings->width_num / settings->width_denom;
+ *w = MIN(*w, screen->width);
+ }
+
+ if (!settings->height_denom)
+ *h = settings->height_num;
+ else {
+ *h = screen->height * settings->height_num / settings->height_denom;
+ *h = MIN(*h, screen->height);
+ }
+}
+
+static gboolean place_transient_splash(ObClient *client, Rect *area,
+ gint *x, gint *y, Size frame_size)
+{
+ if (client->type == OB_CLIENT_TYPE_DIALOG) {
+ GSList *it;
+ gboolean first = TRUE;
+ gint l, r, t, b;
+
+ ob_debug("placing dialog");
+
+ for (it = client->parents; it; it = g_slist_next(it)) {
+ ObClient *m = it->data;
+ if (!m->iconic) {
+ if (first) {
+ l = RECT_LEFT(m->frame->area);
+ t = RECT_TOP(m->frame->area);
+ r = RECT_RIGHT(m->frame->area);
+ b = RECT_BOTTOM(m->frame->area);
+ first = FALSE;
+ } else {
+ l = MIN(l, RECT_LEFT(m->frame->area));
+ t = MIN(t, RECT_TOP(m->frame->area));
+ r = MAX(r, RECT_RIGHT(m->frame->area));
+ b = MAX(b, RECT_BOTTOM(m->frame->area));