csd - fix size hint handling and sizing to not be broken

gtk and efl can use csd. we kind of were copying gtk's but we got it
wrong... in efl. and in etoo as a result. this fixes it to use
min/bas/max size as covering the whole window including the insets.

@fix
This commit is contained in:
Carsten Haitzler 2020-01-17 22:06:14 +00:00
parent 13d721cea6
commit 1e2d589b14
2 changed files with 33 additions and 16 deletions

View File

@ -5381,17 +5381,24 @@ e_client_signal_resize_end(E_Client *ec, const char *dir EINA_UNUSED, const char
E_API void
e_client_resize_limit(const E_Client *ec, int *w, int *h)
{
int dw, dh;
int l = 0, r = 0, t = 0, b = 0;
int dw = 0, dh = 0;
E_OBJECT_CHECK(ec);
E_OBJECT_TYPE_CHECK(ec, E_CLIENT_TYPE);
if (ec->frame)
e_comp_object_frame_geometry_get(ec->frame, &l, &r, &t, &b);
if ((ec->frame) && e_comp_object_frame_allowed(ec->frame))
{
e_comp_object_frame_wh_unadjust(ec->frame, ec->w, ec->h, &dw, &dh);
e_comp_object_frame_wh_unadjust(ec->frame, *w, *h, w, h);
}
else
dw = ec->w, dh = ec->h;
{
*w -= l + r;
*h -= t + b;
dw = ec->w;
dh = ec->h;
}
dw = abs(*w - dw);
dh = abs(*h - dh);
if (*h < 1) *h = 1;
@ -5504,9 +5511,16 @@ e_client_resize_limit(const E_Client *ec, int *w, int *h)
if (*h < 1) *h = 1;
if (*w < 1) *w = 1;
if (ec->frame)
e_comp_object_frame_wh_adjust(ec->frame, *w, *h, w, h);
if ((ec->frame) && e_comp_object_frame_allowed(ec->frame))
{
if (ec->frame)
e_comp_object_frame_wh_adjust(ec->frame, *w, *h, w, h);
}
else
{
*w += l + r;
*h += t + b;
}
}
////////////////////////////////////////////

View File

@ -56,24 +56,27 @@ e_moveresize_replace(Eina_Bool enable)
E_API void
e_moveresize_client_extents(const E_Client *ec, int *w, int *h)
{
int l, r, t, b, bw, bh;
e_comp_object_frame_geometry_get(ec->frame, &l, &r, &t, &b);
bw = ec->icccm.base_w;
bh = ec->icccm.base_h;
if (e_comp_object_frame_allowed(ec->frame))
*w = ec->client.w, *h = ec->client.h;
else
*w = ec->w, *h = ec->h;
if ((ec->icccm.base_w >= 0) &&
(ec->icccm.base_h >= 0))
{
if (ec->icccm.step_w > 0)
*w = (*w - ec->icccm.base_w) / ec->icccm.step_w;
if (ec->icccm.step_h > 0)
*h = (*h - ec->icccm.base_h) / ec->icccm.step_h;
*w = ec->w;
*h = ec->h;
bw -= -l + -r;
bh -= -t + -b;
}
else
if ((bw >= 0) &&
(bh >= 0))
{
if (ec->icccm.step_w > 0)
*w = (*w - ec->icccm.min_w) / ec->icccm.step_w;
*w = (*w - bw) / ec->icccm.step_w;
if (ec->icccm.step_h > 0)
*h = (*h - ec->icccm.min_h) / ec->icccm.step_h;
*h = (*h - bh) / ec->icccm.step_h;
}
}