-static void calc_position(ObMenuFrame *self, GravityPoint *position,
- gint *x, gint *y, gint monitor)
-{
- const Rect *area = screen_physical_area_monitor(monitor);
-
- if (position->x.center)
- *x = area->width / 2 - self->area.width / 2;
- else {
- *x = position->x.pos;
- if (position->x.denom)
- *x = (*x * area->width) / position->x.denom;
- if (position->x.opposite)
- *x = area->width - self->area.width - *x;
- }
-
- if (position->y.center)
- *y = area->height / 2 - self->area.height / 2;
- else {
- *y = position->y.pos;
- if (position->y.denom)
- *y = (*y * area->height) / position->y.denom;
- if (position->y.opposite)
- *y = area->height - self->area.height - *y;
- }
-
- *x += area->x;
- *y += area->y;
-}
-