diff options
| author | Mikael Magnusson <mikachu@gmail.com> | 2014-10-06 19:52:14 +0200 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@gmail.com> | 2014-10-06 22:05:26 +0200 |
| commit | 1b3afcff1fea0d1334b50dff378a6667e264b557 (patch) | |
| tree | 28cf965ff507f6fbaf853ddb26c35c757df40740 /openbox/place.c | |
| parent | c5c5b7b455334ec2987b0f04e18d817f6d3767d0 (diff) | |
Move common gravity application to screen.c
Diffstat (limited to 'openbox/place.c')
| -rw-r--r-- | openbox/place.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/openbox/place.c b/openbox/place.c index 1dc16c4f..aa3ff636 100644 --- a/openbox/place.c +++ b/openbox/place.c @@ -295,28 +295,8 @@ static gboolean place_per_app_setting_position(ObClient *client, Rect *screen, ob_debug("placing by per-app settings"); - if (settings->position.x.center) - *x = screen->width / 2 - client->area.width / 2; - else { - *x = settings->position.x.pos; - if (settings->position.x.denom) - *x = (*x * screen->width) / settings->position.x.denom; - if (settings->position.x.opposite) - *x = screen->width - frame_size.width - *x; - } - - if (settings->position.y.center) - *y = screen->height / 2 - client->area.height / 2; - else { - *y = settings->position.y.pos; - if (settings->position.y.denom) - *y = (*y * screen->height) / settings->position.y.denom; - if (settings->position.y.opposite) - *y = screen->height - frame_size.height - *y; - } - - *x += screen->x; - *y += screen->y; + screen_apply_gravity_point(x, y, frame_size.width, frame_size.height, + &settings->position, screen); return TRUE; } |
