+static gboolean place_per_app_setting_position(ObClient *client, Rect *screen,
+ gint *x, gint *y,
+ ObAppSettings *settings,
+ Size frame_size)
+{
+ if (!settings || !settings->pos_given)
+ return FALSE;
+
+ ob_debug("placing by per-app settings");
+
+ if (settings->position.x.center)
+ *x = screen->x + screen->width / 2 - client->area.width / 2;
+ else if (settings->position.x.opposite)
+ *x = screen->x + screen->width - frame_size.width -
+ settings->position.x.pos;
+ else
+ *x = screen->x + settings->position.x.pos;
+ if (settings->position.x.denom)
+ *x = (*x * screen->width) / settings->position.x.denom;
+
+ if (settings->position.y.center)
+ *y = screen->y + screen->height / 2 - client->area.height / 2;
+ else if (settings->position.y.opposite)
+ *y = screen->y + screen->height - frame_size.height -
+ settings->position.y.pos;
+ else
+ *y = screen->y + settings->position.y.pos;
+ if (settings->position.y.denom)
+ *y = (*y * screen->height) / settings->position.y.denom;
+
+ return TRUE;
+}
+
+static void place_per_app_setting_size(ObClient *client, Rect *screen,
+ gint *w, gint *h,
+ ObAppSettings *settings)
+{
+ 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)