{
if (self->iconic)
return FALSE;
- if (client_normal(self) && screen_showing_desktop)
+ if (client_normal(self) && screen_showing_desktop())
return FALSE;
if (self->desktop == screen_desktop || self->desktop == DESKTOP_ALL)
return TRUE;
/* adjust the height to match the width for the aspect ratios.
for this, min size is not substituted for base size ever. */
- *w -= self->base_size.width;
- *h -= self->base_size.height;
+ if (self->base_size.width >= 0 && self->base_size.height >= 0) {
+ *w -= self->base_size.width;
+ *h -= self->base_size.height;
+ }
if (minratio)
if (*h * minratio > *w) {
}
}
- *w += self->base_size.width;
- *h += self->base_size.height;
+ if (self->base_size.width >= 0 && self->base_size.height >= 0) {
+ *w += self->base_size.width;
+ *h += self->base_size.height;
+ }
}
/* these override the above states! if you cant move you can't move! */
static void client_present(ObClient *self, gboolean here, gboolean raise,
gboolean unshade)
{
- if (client_normal(self) && screen_showing_desktop)
+ if (client_normal(self) && screen_showing_desktop())
screen_show_desktop(FALSE, self);
if (self->iconic)
client_iconify(self, FALSE, here, FALSE);
frame_frame_gravity(self->frame, x, y);
}
-gboolean client_find_resize_directional(
- ObClient *self,
- ObDirection side,
- ObClientDirectionalResizeType resize_type,
- gint *x, gint *y, gint *w, gint *h)
+void client_find_resize_directional(ObClient *self,
+ ObDirection side,
+ ObClientDirectionalResizeType resize_type,
+ gint *x, gint *y, gint *w, gint *h)
{
gint head;
gint e, e_start, e_size, delta;
gboolean near;
ObDirection dir;
- gboolean changed = FALSE;
-
gboolean grow;
switch (resize_type) {
case CLIENT_RESIZE_GROW:
if (grow == near) --e;
delta = e - RECT_RIGHT(self->frame->area);
*w += delta;
- changed = delta ? TRUE : changed;
break;
case OB_DIRECTION_WEST:
if (grow == near) ++e;
delta = RECT_LEFT(self->frame->area) - e;
*x -= delta;
*w += delta;
- changed = delta ? TRUE : changed;
break;
case OB_DIRECTION_NORTH:
if (grow == near) ++e;
delta = RECT_TOP(self->frame->area) - e;
*y -= delta;
*h += delta;
- changed = delta ? TRUE : changed;
break;
case OB_DIRECTION_SOUTH:
if (grow == near) --e;
delta = e - RECT_BOTTOM(self->frame->area);
*h += delta;
- changed = delta ? TRUE : changed;
break;
default:
g_assert_not_reached();
frame_frame_gravity(self->frame, x, y);
*w -= self->frame->size.left + self->frame->size.right;
*h -= self->frame->size.top + self->frame->size.bottom;
- return changed;
}
ObClient* client_under_pointer(void)