RECT_SET(self->area, self->session->x, self->session->y,
self->session->w, self->session->h);
self->positioned = TRUE;
- XResizeWindow(ob_display, self->window,
- self->session->w, self->session->h);
+ if (self->session->w > 0 && self->session->h > 0)
+ XResizeWindow(ob_display, self->window,
+ self->session->w, self->session->h);
self->desktop = (self->session->desktop == DESKTOP_ALL ?
self->session->desktop :
{
if (self->iconic) return FALSE;
else if (!(self->desktop == screen_desktop ||
- self->desktop == DESKTOP_ALL)) return FALSE;
+ self->desktop == DESKTOP_ALL)) return FALSE;
else if (client_normal(self) && screen_showing_desktop) return FALSE;
return TRUE;
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;
h = self->area.height;
if (max) {
- if (savearea)
- self->pre_max_area = self->area;
+ if (savearea) {
+ if ((dir == 0 || dir == 1) && !self->max_horz) { /* horz */
+ RECT_SET(self->pre_max_area,
+ self->area.x, self->pre_max_area.y,
+ self->area.width, self->pre_max_area.height);
+ }
+ if ((dir == 0 || dir == 2) && !self->max_vert) { /* vert */
+ RECT_SET(self->pre_max_area,
+ self->pre_max_area.x, self->area.y,
+ self->pre_max_area.width, self->area.height);
+ }
+ }
} else {
Rect *a;
if (!self->frame->visible)
return FALSE;
- if (!((self->can_focus || self->focus_notify) &&
- (self->desktop == screen_desktop ||
- self->desktop == DESKTOP_ALL) &&
- !self->iconic))
+ if (!(self->can_focus || self->focus_notify))
return FALSE;
/* do a check to see if the window has already been unmapped or destroyed
/* 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;
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;
for (it = stacking_list; it != NULL; it = it->next) {
if (WINDOW_IS_CLIENT(it->data)) {
ObClient *c = WINDOW_AS_CLIENT(it->data);
- if (c->desktop == screen_desktop &&
+ if (c->frame->visible &&
RECT_CONTAINS(c->frame->area, x, y)) {
ret = c;
break;