diff options
| author | Dana Jansens <danakj@orodu.net> | 2008-01-19 23:59:40 -0500 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2008-01-19 23:59:40 -0500 |
| commit | 3ae58f457bcdfa90b26dad4c9d192f045874ddae (patch) | |
| tree | 23d603a47cfedc8e51cf36bf3480f83118b94710 /openbox/moveresize.c | |
| parent | 2b8b5da04b14af1639143cc332874c7e1a03a8bb (diff) | |
| parent | 4b41ac8343efa21a959d81a4db8aea32e5960f10 (diff) | |
Merge branch 'backport'
Diffstat (limited to 'openbox/moveresize.c')
| -rw-r--r-- | openbox/moveresize.c | 53 |
1 files changed, 51 insertions, 2 deletions
diff --git a/openbox/moveresize.c b/openbox/moveresize.c index bb17d4a0..675cbe9c 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -101,17 +101,66 @@ static void popup_coords(ObClient *c, const gchar *format, gint a, gint b) gchar *text; text = g_strdup_printf(format, a, b); - if (config_resize_popup_pos == 1) /* == "Top" */ + if (config_resize_popup_pos == OB_RESIZE_POS_TOP) popup_position(popup, SouthGravity, c->frame->area.x + c->frame->area.width/2, c->frame->area.y - ob_rr_theme->fbwidth); - else /* == "Center" */ + else if (config_resize_popup_pos == OB_RESIZE_POS_CENTER) popup_position(popup, CenterGravity, c->frame->area.x + c->frame->size.left + c->area.width / 2, c->frame->area.y + c->frame->size.top + c->area.height / 2); + else /* Fixed */ { + Rect *area = screen_physical_area_active(); + gint gravity, x, y; + + x = config_resize_popup_fixed.x.pos; + if (config_resize_popup_fixed.x.center) + x = area->x + area->width/2; + else if (config_resize_popup_fixed.x.opposite) + x = RECT_RIGHT(*area) - x; + else + x = area->x + x; + + y = config_resize_popup_fixed.y.pos; + if (config_resize_popup_fixed.y.center) + y = area->y + area->height/2; + else if (config_resize_popup_fixed.y.opposite) + y = RECT_RIGHT(*area) - y; + else + y = area->y + y; + + if (config_resize_popup_fixed.x.center) { + if (config_resize_popup_fixed.y.center) + gravity = CenterGravity; + else if (config_resize_popup_fixed.y.opposite) + gravity = SouthGravity; + else + gravity = NorthGravity; + } + else if (config_resize_popup_fixed.x.opposite) { + if (config_resize_popup_fixed.y.center) + gravity = EastGravity; + else if (config_resize_popup_fixed.y.opposite) + gravity = SouthEastGravity; + else + gravity = NorthEastGravity; + } + else { + if (config_resize_popup_fixed.y.center) + gravity = WestGravity; + else if (config_resize_popup_fixed.y.opposite) + gravity = SouthWestGravity; + else + gravity = NorthWestGravity; + } + + popup_position(popup, gravity, x, y); + + g_free(area); + } popup_show(popup, text); g_free(text); } |
