X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=a17c73daaa43d92100a41c1dffa8d519457639a2;hb=b8ba1cff1fdd5447984e83708865f8ba6c7f223a;hp=375e18aa21c088daae9cc4058e0ef9a223135bbb;hpb=f6ba1f27b9790f56bda1e5831069e2dd7e2c96a2;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 375e18aa..a17c73da 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1953,27 +1953,46 @@ void client_configure_full(ObClient *self, ObCorner anchor, h -= self->base_size.height; if (self->min_ratio) - if (h * self->min_ratio > w) h = (int)(w / self->min_ratio); + if (h * self->min_ratio > w) { + h = (int)(w / self->min_ratio); + + /* you cannot resize to nothing */ + if (h < 1) { + h = 1; + w = (int)(h * self->min_ratio); + } + } if (self->max_ratio) - if (h * self->max_ratio < w) h = (int)(w / self->max_ratio); + if (h * self->max_ratio < w) { + h = (int)(w / self->max_ratio); + + /* you cannot resize to nothing */ + if (h < 1) { + h = 1; + w = (int)(h * self->min_ratio); + } + } w += self->base_size.width; h += self->base_size.height; } + g_assert(w > 0); + g_assert(h > 0); + switch (anchor) { case OB_CORNER_TOPLEFT: - break; + break; case OB_CORNER_TOPRIGHT: - x -= w - self->area.width; - break; + x -= w - self->area.width; + break; case OB_CORNER_BOTTOMLEFT: - y -= h - self->area.height; - break; + y -= h - self->area.height; + break; case OB_CORNER_BOTTOMRIGHT: - x -= w - self->area.width; - y -= h - self->area.height; - break; + x -= w - self->area.width; + y -= h - self->area.height; + break; } moved = x != self->area.x || y != self->area.y; @@ -2674,8 +2693,6 @@ static ObClientIcon* client_icon_recursive(ObClient *self, int w, int h) /* li is the largest image < req */ unsigned long size, smallest = 0xffffffff, largest = 0, si = 0, li = 0; - g_message("icons %d", self->nicons); - if (!self->nicons) { ObClientIcon *parent = NULL; @@ -2718,9 +2735,7 @@ const ObClientIcon* client_icon(ObClient *self, int w, int h) ObClientIcon *ret; static ObClientIcon deficon; - g_message("going for broke"); if (!(ret = client_icon_recursive(self, w, h))) { - g_message("using default"); deficon.width = deficon.height = 48; deficon.data = ob_rr_theme->def_win_icon; ret = &deficon;