forked from enlightenment/enlightenment
fix configure request bug... (actually size info getting bug)
SVN revision: 4436
This commit is contained in:
parent
a76afe3961
commit
436d208d15
|
@ -568,12 +568,12 @@ e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int
|
||||||
{
|
{
|
||||||
if (y > (b->current.h / 2))
|
if (y > (b->current.h / 2))
|
||||||
{
|
{
|
||||||
b->mode.resize = 3;
|
b->mode.resize = 4;
|
||||||
SET_BORDER_GRAVITY(b, NorthWestGravity);
|
SET_BORDER_GRAVITY(b, NorthWestGravity);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
b->mode.resize = 1;
|
b->mode.resize = 2;
|
||||||
SET_BORDER_GRAVITY(b, SouthWestGravity);
|
SET_BORDER_GRAVITY(b, SouthWestGravity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -581,12 +581,12 @@ e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int
|
||||||
{
|
{
|
||||||
if (y > (b->current.h / 2))
|
if (y > (b->current.h / 2))
|
||||||
{
|
{
|
||||||
b->mode.resize = 2;
|
b->mode.resize = 3;
|
||||||
SET_BORDER_GRAVITY(b, NorthEastGravity);
|
SET_BORDER_GRAVITY(b, NorthEastGravity);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
b->mode.resize = 0;
|
b->mode.resize = 1;
|
||||||
SET_BORDER_GRAVITY(b, SouthEastGravity);
|
SET_BORDER_GRAVITY(b, SouthEastGravity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -631,26 +631,26 @@ e_act_resize_go (void *o, E_Action *a, void *data, int x, int y, int rx, int
|
||||||
if (!b) b = e_border_current_focused();
|
if (!b) b = e_border_current_focused();
|
||||||
if (!b) return;
|
if (!b) return;
|
||||||
if (b->current.shaded != 0) return;
|
if (b->current.shaded != 0) return;
|
||||||
if (b->mode.resize == 0)
|
if (b->mode.resize == 1)
|
||||||
{
|
{
|
||||||
b->current.requested.w -= dx;
|
b->current.requested.w -= dx;
|
||||||
b->current.requested.h -= dy;
|
b->current.requested.h -= dy;
|
||||||
b->current.requested.x += dx;
|
b->current.requested.x += dx;
|
||||||
b->current.requested.y += dy;
|
b->current.requested.y += dy;
|
||||||
}
|
}
|
||||||
else if (b->mode.resize == 1)
|
else if (b->mode.resize == 2)
|
||||||
{
|
{
|
||||||
b->current.requested.w += dx;
|
b->current.requested.w += dx;
|
||||||
b->current.requested.h -= dy;
|
b->current.requested.h -= dy;
|
||||||
b->current.requested.y += dy;
|
b->current.requested.y += dy;
|
||||||
}
|
}
|
||||||
else if (b->mode.resize == 2)
|
else if (b->mode.resize == 3)
|
||||||
{
|
{
|
||||||
b->current.requested.w -= dx;
|
b->current.requested.w -= dx;
|
||||||
b->current.requested.h += dy;
|
b->current.requested.h += dy;
|
||||||
b->current.requested.x += dx;
|
b->current.requested.x += dx;
|
||||||
}
|
}
|
||||||
else if (b->mode.resize == 3)
|
else if (b->mode.resize == 4)
|
||||||
{
|
{
|
||||||
b->current.requested.w += dx;
|
b->current.requested.w += dx;
|
||||||
b->current.requested.h += dy;
|
b->current.requested.h += dy;
|
||||||
|
@ -679,12 +679,12 @@ e_act_resize_h_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
|
||||||
/* 4 | 5 */
|
/* 4 | 5 */
|
||||||
if (x > (b->current.w / 2))
|
if (x > (b->current.w / 2))
|
||||||
{
|
{
|
||||||
b->mode.resize = 5;
|
b->mode.resize = 6;
|
||||||
SET_BORDER_GRAVITY(b, NorthWestGravity);
|
SET_BORDER_GRAVITY(b, NorthWestGravity);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
b->mode.resize = 4;
|
b->mode.resize = 5;
|
||||||
SET_BORDER_GRAVITY(b, NorthEastGravity);
|
SET_BORDER_GRAVITY(b, NorthEastGravity);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -729,12 +729,12 @@ e_act_resize_h_go (void *o, E_Action *a, void *data, int x, int y, int rx, in
|
||||||
if (!b) b = e_border_current_focused();
|
if (!b) b = e_border_current_focused();
|
||||||
if (!b) return;
|
if (!b) return;
|
||||||
if (b->current.shaded != 0) return;
|
if (b->current.shaded != 0) return;
|
||||||
if (b->mode.resize == 4)
|
if (b->mode.resize == 5)
|
||||||
{
|
{
|
||||||
b->current.requested.w -= dx;
|
b->current.requested.w -= dx;
|
||||||
b->current.requested.x += dx;
|
b->current.requested.x += dx;
|
||||||
}
|
}
|
||||||
else if (b->mode.resize == 5)
|
else if (b->mode.resize == 6)
|
||||||
{
|
{
|
||||||
b->current.requested.w += dx;
|
b->current.requested.w += dx;
|
||||||
}
|
}
|
||||||
|
@ -765,12 +765,12 @@ e_act_resize_v_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
|
||||||
/* 7 */
|
/* 7 */
|
||||||
if (y > (b->current.h / 2))
|
if (y > (b->current.h / 2))
|
||||||
{
|
{
|
||||||
b->mode.resize = 7;
|
b->mode.resize = 8;
|
||||||
SET_BORDER_GRAVITY(b, NorthWestGravity);
|
SET_BORDER_GRAVITY(b, NorthWestGravity);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
b->mode.resize = 6;
|
b->mode.resize = 7;
|
||||||
SET_BORDER_GRAVITY(b, SouthWestGravity);
|
SET_BORDER_GRAVITY(b, SouthWestGravity);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -815,12 +815,12 @@ e_act_resize_v_go (void *o, E_Action *a, void *data, int x, int y, int rx, in
|
||||||
if (!b) b = e_border_current_focused();
|
if (!b) b = e_border_current_focused();
|
||||||
if (!b) return;
|
if (!b) return;
|
||||||
if (b->current.shaded != 0) return;
|
if (b->current.shaded != 0) return;
|
||||||
if (b->mode.resize == 6)
|
if (b->mode.resize == 7)
|
||||||
{
|
{
|
||||||
b->current.requested.h -= dy;
|
b->current.requested.h -= dy;
|
||||||
b->current.requested.y += dy;
|
b->current.requested.y += dy;
|
||||||
}
|
}
|
||||||
else if (b->mode.resize == 7)
|
else if (b->mode.resize == 8)
|
||||||
{
|
{
|
||||||
b->current.requested.h += dy;
|
b->current.requested.h += dy;
|
||||||
}
|
}
|
||||||
|
|
49
src/border.c
49
src/border.c
|
@ -122,11 +122,7 @@ e_configure_request(Eevent * ev)
|
||||||
b->current.requested.x = e->x;
|
b->current.requested.x = e->x;
|
||||||
if (e->mask & EV_VALUE_Y)
|
if (e->mask & EV_VALUE_Y)
|
||||||
b->current.requested.y = e->y;
|
b->current.requested.y = e->y;
|
||||||
if (e->mask & EV_VALUE_W)
|
if ((e->mask & EV_VALUE_W) || (e->mask & EV_VALUE_H))
|
||||||
{
|
|
||||||
b->current.requested.w = e->w + pl + pr;
|
|
||||||
}
|
|
||||||
if (e->mask & EV_VALUE_H)
|
|
||||||
{
|
{
|
||||||
if (b->current.shaded == b->client.h)
|
if (b->current.shaded == b->client.h)
|
||||||
{
|
{
|
||||||
|
@ -140,11 +136,12 @@ e_configure_request(Eevent * ev)
|
||||||
if (b->current.shaded < 1)
|
if (b->current.shaded < 1)
|
||||||
b->current.shaded = 1;
|
b->current.shaded = 1;
|
||||||
}
|
}
|
||||||
b->client.w = e->w;
|
/* b->client.w = e->w;
|
||||||
b->client.h = e->h;
|
b->client.h = e->h;
|
||||||
|
*/
|
||||||
|
b->current.requested.w = e->w + pl + pr;
|
||||||
b->current.requested.h = e->h + pt + pb;
|
b->current.requested.h = e->h + pt + pb;
|
||||||
}
|
}
|
||||||
if ((e->mask & EV_VALUE_SIBLING) && (e->mask & EV_VALUE_STACKING))
|
if ((e->mask & EV_VALUE_SIBLING) && (e->mask & EV_VALUE_STACKING))
|
||||||
{
|
{
|
||||||
E_Border *b_rel;
|
E_Border *b_rel;
|
||||||
|
@ -182,7 +179,7 @@ e_configure_request(Eevent * ev)
|
||||||
{
|
{
|
||||||
if ((e->mask & EV_VALUE_X) && (e->mask & EV_VALUE_W))
|
if ((e->mask & EV_VALUE_X) && (e->mask & EV_VALUE_W))
|
||||||
e_window_move_resize(e->win, e->x, e->y, e->w, e->h);
|
e_window_move_resize(e->win, e->x, e->y, e->w, e->h);
|
||||||
else if ((e->mask & EV_VALUE_W))
|
else if ((e->mask & EV_VALUE_W) || (e->mask & EV_VALUE_H))
|
||||||
e_window_resize(e->win, e->w, e->h);
|
e_window_resize(e->win, e->w, e->h);
|
||||||
else if ((e->mask & EV_VALUE_X))
|
else if ((e->mask & EV_VALUE_X))
|
||||||
e_window_move(e->win, e->x, e->y);
|
e_window_move(e->win, e->x, e->y);
|
||||||
|
@ -1155,6 +1152,32 @@ e_border_adopt(Window win, int use_client_pos)
|
||||||
b->current.requested.visible = 1;
|
b->current.requested.visible = 1;
|
||||||
/* get hints */
|
/* get hints */
|
||||||
e_icccm_get_size_info(win, b);
|
e_icccm_get_size_info(win, b);
|
||||||
|
{
|
||||||
|
int x, y, w, h;
|
||||||
|
int pl, pr, pt, pb;
|
||||||
|
|
||||||
|
x = 0; y = 0; w = 0; h = 0;
|
||||||
|
e_window_get_geometry(win, &x, &y, &w, &h);
|
||||||
|
pl = pr = pt = pb = 0;
|
||||||
|
if (b->bits.t) ebits_get_insets(b->bits.t, &pl, &pr, &pt, &pb);
|
||||||
|
if (!b->placed)
|
||||||
|
{
|
||||||
|
/* get x,y location of client */
|
||||||
|
x = rand()%640;
|
||||||
|
y = rand()%480;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = b->current.x + pl;
|
||||||
|
y = b->current.y + pt;
|
||||||
|
}
|
||||||
|
b->current.requested.x = x - pl;
|
||||||
|
b->current.requested.y = y - pt;
|
||||||
|
b->current.requested.w = w + pl + pr;
|
||||||
|
b->current.requested.h = h + pt + pb;
|
||||||
|
b->changed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
e_icccm_get_mwm_hints(win, b);
|
e_icccm_get_mwm_hints(win, b);
|
||||||
e_icccm_get_layer(win, b);
|
e_icccm_get_layer(win, b);
|
||||||
e_icccm_get_title(win, b);
|
e_icccm_get_title(win, b);
|
||||||
|
@ -1721,19 +1744,19 @@ e_border_adjust_limits(E_Border *b)
|
||||||
|
|
||||||
if (b->current.shaded == 0)
|
if (b->current.shaded == 0)
|
||||||
{
|
{
|
||||||
if ((b->mode.resize == 3) || (b->mode.resize == 5) || (b->mode.resize == 7))
|
if ((b->mode.resize == 4) || (b->mode.resize == 6) || (b->mode.resize == 8))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
else if ((b->mode.resize == 0) || (b->mode.resize == 4))
|
else if ((b->mode.resize == 1) || (b->mode.resize == 5))
|
||||||
{
|
{
|
||||||
b->current.x += (b->current.requested.w - b->current.w);
|
b->current.x += (b->current.requested.w - b->current.w);
|
||||||
b->current.y += (b->current.requested.h - b->current.h);
|
b->current.y += (b->current.requested.h - b->current.h);
|
||||||
}
|
}
|
||||||
else if ((b->mode.resize == 1) || (b->mode.resize == 6))
|
else if ((b->mode.resize == 2) || (b->mode.resize == 7))
|
||||||
{
|
{
|
||||||
b->current.y += (b->current.requested.h - b->current.h);
|
b->current.y += (b->current.requested.h - b->current.h);
|
||||||
}
|
}
|
||||||
else if ((b->mode.resize == 2))
|
else if ((b->mode.resize == 3))
|
||||||
{
|
{
|
||||||
b->current.x += (b->current.requested.w - b->current.w);
|
b->current.x += (b->current.requested.w - b->current.w);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,8 @@ void
|
||||||
e_config_init(void)
|
e_config_init(void)
|
||||||
{
|
{
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
|
||||||
|
#if 1 /* for now don't do this. i think a cp -r will be needed later anyway */
|
||||||
if (!e_file_is_dir(e_config_user_dir())) e_file_mkdir(e_config_user_dir());
|
if (!e_file_is_dir(e_config_user_dir())) e_file_mkdir(e_config_user_dir());
|
||||||
sprintf(buf, "%sappearance", e_config_user_dir());
|
sprintf(buf, "%sappearance", e_config_user_dir());
|
||||||
if (!e_file_is_dir(buf)) e_file_mkdir(buf);
|
if (!e_file_is_dir(buf)) e_file_mkdir(buf);
|
||||||
|
@ -97,6 +98,7 @@ e_config_init(void)
|
||||||
sprintf(buf, "%sappearance/borders/borderless.bits.db", e_config_user_dir());
|
sprintf(buf, "%sappearance/borders/borderless.bits.db", e_config_user_dir());
|
||||||
if (!e_file_exists(buf))
|
if (!e_file_exists(buf))
|
||||||
e_file_cp(PACKAGE_DATA_DIR"/data/config/appearance/default/borders/borderless.bits.db", buf);
|
e_file_cp(PACKAGE_DATA_DIR"/data/config/appearance/default/borders/borderless.bits.db", buf);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -123,6 +125,10 @@ e_config_user_dir(void)
|
||||||
{
|
{
|
||||||
if (cfg_user_dir[0]) return cfg_user_dir;
|
if (cfg_user_dir[0]) return cfg_user_dir;
|
||||||
if (cfg_root[0]) return cfg_root;
|
if (cfg_root[0]) return cfg_root;
|
||||||
|
#if 1 /* disabled for now - use system ones only */
|
||||||
sprintf(cfg_user_dir, "%s/.e/", e_file_home());
|
sprintf(cfg_user_dir, "%s/.e/", e_file_home());
|
||||||
|
#else
|
||||||
|
sprintf(cfg_user_dir, PACKAGE_DATA_DIR"/data/config/");
|
||||||
|
#endif
|
||||||
return cfg_user_dir;
|
return cfg_user_dir;
|
||||||
}
|
}
|
||||||
|
|
76
src/icccm.c
76
src/icccm.c
|
@ -137,15 +137,11 @@ e_icccm_release(Window win)
|
||||||
void
|
void
|
||||||
e_icccm_get_size_info(Window win, E_Border *b)
|
e_icccm_get_size_info(Window win, E_Border *b)
|
||||||
{
|
{
|
||||||
int x, y, w, h;
|
|
||||||
int base_w, base_h, min_w, min_h, max_w, max_h, grav, step_w, step_h;
|
int base_w, base_h, min_w, min_h, max_w, max_h, grav, step_w, step_h;
|
||||||
double aspect_min, aspect_max;
|
double aspect_min, aspect_max;
|
||||||
int mask;
|
int mask;
|
||||||
XSizeHints hint;
|
XSizeHints hint;
|
||||||
|
|
||||||
x = 0; y = 0; w = 0; h = 0;
|
|
||||||
e_window_get_geometry(win, &x, &y, &w, &h);
|
|
||||||
|
|
||||||
grav = NorthWestGravity;
|
grav = NorthWestGravity;
|
||||||
mask = 0;
|
mask = 0;
|
||||||
min_w = 0;
|
min_w = 0;
|
||||||
|
@ -160,28 +156,6 @@ e_icccm_get_size_info(Window win, E_Border *b)
|
||||||
base_h = 0;
|
base_h = 0;
|
||||||
if (e_window_get_wm_size_hints(win, &hint, &mask))
|
if (e_window_get_wm_size_hints(win, &hint, &mask))
|
||||||
{
|
{
|
||||||
if (!b->placed)
|
|
||||||
{
|
|
||||||
if (hint.flags & PWinGravity) grav = hint.win_gravity;
|
|
||||||
if ((hint.flags & USPosition) || ((hint.flags & PPosition)))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* get x,y location of client */
|
|
||||||
x = rand()%640;
|
|
||||||
y = rand()%480;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int pl, pr, pt, pb;
|
|
||||||
|
|
||||||
pl = pr = pt = pb = 0;
|
|
||||||
if (b->bits.t) ebits_get_insets(b->bits.t, &pl, &pr, &pt, &pb);
|
|
||||||
x = b->current.x + pl;
|
|
||||||
y = b->current.y + pt;
|
|
||||||
}
|
|
||||||
if (hint.flags & PMinSize)
|
if (hint.flags & PMinSize)
|
||||||
{
|
{
|
||||||
min_w = hint.min_width;
|
min_w = hint.min_width;
|
||||||
|
@ -221,45 +195,17 @@ e_icccm_get_size_info(Window win, E_Border *b)
|
||||||
aspect_max = ((double)hint.max_aspect.x) / ((double)hint.max_aspect.y);
|
aspect_max = ((double)hint.max_aspect.x) / ((double)hint.max_aspect.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
b->client.min.w = min_w;
|
||||||
{
|
b->client.min.h = min_h;
|
||||||
if (!b->placed)
|
b->client.max.w = max_w;
|
||||||
{
|
b->client.max.h = max_h;
|
||||||
/* get x,y location of client */
|
b->client.base.w = base_w;
|
||||||
x = rand()%640;
|
b->client.base.h = base_h;
|
||||||
y = rand()%480;
|
b->client.step.w = step_w;
|
||||||
}
|
b->client.step.h = step_h;
|
||||||
else
|
b->client.min.aspect = aspect_min;
|
||||||
{
|
b->client.max.aspect = aspect_max;
|
||||||
int pl, pr, pt, pb;
|
b->changed = 1;
|
||||||
|
|
||||||
pl = pr = pt = pb = 0;
|
|
||||||
if (b->bits.t) ebits_get_insets(b->bits.t, &pl, &pr, &pt, &pb);
|
|
||||||
x = b->current.x + pl;
|
|
||||||
y = b->current.y + pt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{
|
|
||||||
int pl, pr, pt, pb;
|
|
||||||
|
|
||||||
pl = pr = pt = pb = 0;
|
|
||||||
if (b->bits.t) ebits_get_insets(b->bits.t, &pl, &pr, &pt, &pb);
|
|
||||||
b->current.requested.x = x - pl;
|
|
||||||
b->current.requested.y = y - pt;
|
|
||||||
b->current.requested.w = w + pl + pr;
|
|
||||||
b->current.requested.h = h + pt + pb;
|
|
||||||
b->client.min.w = min_w;
|
|
||||||
b->client.min.h = min_h;
|
|
||||||
b->client.max.w = max_w;
|
|
||||||
b->client.max.h = max_h;
|
|
||||||
b->client.base.w = base_w;
|
|
||||||
b->client.base.h = base_h;
|
|
||||||
b->client.step.w = step_w;
|
|
||||||
b->client.step.h = step_h;
|
|
||||||
b->client.min.aspect = aspect_min;
|
|
||||||
b->client.max.aspect = aspect_max;
|
|
||||||
b->changed = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -179,7 +179,6 @@ e_file_list_dir(char *dir)
|
||||||
list = NULL;
|
list = NULL;
|
||||||
while ((dp = readdir(dirp)))
|
while ((dp = readdir(dirp)))
|
||||||
{
|
{
|
||||||
printf("%s\n", dp->d_name);
|
|
||||||
if ((strcmp(dp->d_name, ".")) &&
|
if ((strcmp(dp->d_name, ".")) &&
|
||||||
(strcmp(dp->d_name, "..")))
|
(strcmp(dp->d_name, "..")))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue