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))
|
||||
{
|
||||
b->mode.resize = 3;
|
||||
b->mode.resize = 4;
|
||||
SET_BORDER_GRAVITY(b, NorthWestGravity);
|
||||
}
|
||||
else
|
||||
{
|
||||
b->mode.resize = 1;
|
||||
b->mode.resize = 2;
|
||||
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))
|
||||
{
|
||||
b->mode.resize = 2;
|
||||
b->mode.resize = 3;
|
||||
SET_BORDER_GRAVITY(b, NorthEastGravity);
|
||||
}
|
||||
else
|
||||
{
|
||||
b->mode.resize = 0;
|
||||
b->mode.resize = 1;
|
||||
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) 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.h -= dy;
|
||||
b->current.requested.x += dx;
|
||||
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.h -= 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.h += dy;
|
||||
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.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 */
|
||||
if (x > (b->current.w / 2))
|
||||
{
|
||||
b->mode.resize = 5;
|
||||
b->mode.resize = 6;
|
||||
SET_BORDER_GRAVITY(b, NorthWestGravity);
|
||||
}
|
||||
else
|
||||
{
|
||||
b->mode.resize = 4;
|
||||
b->mode.resize = 5;
|
||||
SET_BORDER_GRAVITY(b, NorthEastGravity);
|
||||
}
|
||||
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) 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.x += dx;
|
||||
}
|
||||
else if (b->mode.resize == 5)
|
||||
else if (b->mode.resize == 6)
|
||||
{
|
||||
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 */
|
||||
if (y > (b->current.h / 2))
|
||||
{
|
||||
b->mode.resize = 7;
|
||||
b->mode.resize = 8;
|
||||
SET_BORDER_GRAVITY(b, NorthWestGravity);
|
||||
}
|
||||
else
|
||||
{
|
||||
b->mode.resize = 6;
|
||||
b->mode.resize = 7;
|
||||
SET_BORDER_GRAVITY(b, SouthWestGravity);
|
||||
}
|
||||
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) 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.y += dy;
|
||||
}
|
||||
else if (b->mode.resize == 7)
|
||||
else if (b->mode.resize == 8)
|
||||
{
|
||||
b->current.requested.h += dy;
|
||||
}
|
||||
|
|
47
src/border.c
47
src/border.c
|
@ -122,11 +122,7 @@ e_configure_request(Eevent * ev)
|
|||
b->current.requested.x = e->x;
|
||||
if (e->mask & EV_VALUE_Y)
|
||||
b->current.requested.y = e->y;
|
||||
if (e->mask & EV_VALUE_W)
|
||||
{
|
||||
b->current.requested.w = e->w + pl + pr;
|
||||
}
|
||||
if (e->mask & EV_VALUE_H)
|
||||
if ((e->mask & EV_VALUE_W) || (e->mask & EV_VALUE_H))
|
||||
{
|
||||
if (b->current.shaded == b->client.h)
|
||||
{
|
||||
|
@ -140,9 +136,10 @@ e_configure_request(Eevent * ev)
|
|||
if (b->current.shaded < 1)
|
||||
b->current.shaded = 1;
|
||||
}
|
||||
b->client.w = e->w;
|
||||
/* b->client.w = e->w;
|
||||
b->client.h = e->h;
|
||||
|
||||
*/
|
||||
b->current.requested.w = e->w + pl + pr;
|
||||
b->current.requested.h = e->h + pt + pb;
|
||||
}
|
||||
if ((e->mask & EV_VALUE_SIBLING) && (e->mask & EV_VALUE_STACKING))
|
||||
|
@ -182,7 +179,7 @@ e_configure_request(Eevent * ev)
|
|||
{
|
||||
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);
|
||||
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);
|
||||
else if ((e->mask & EV_VALUE_X))
|
||||
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;
|
||||
/* get hints */
|
||||
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_layer(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->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.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);
|
||||
}
|
||||
else if ((b->mode.resize == 2))
|
||||
else if ((b->mode.resize == 3))
|
||||
{
|
||||
b->current.x += (b->current.requested.w - b->current.w);
|
||||
}
|
||||
|
|
|
@ -67,6 +67,7 @@ e_config_init(void)
|
|||
{
|
||||
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());
|
||||
sprintf(buf, "%sappearance", e_config_user_dir());
|
||||
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());
|
||||
if (!e_file_exists(buf))
|
||||
e_file_cp(PACKAGE_DATA_DIR"/data/config/appearance/default/borders/borderless.bits.db", buf);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -123,6 +125,10 @@ e_config_user_dir(void)
|
|||
{
|
||||
if (cfg_user_dir[0]) return cfg_user_dir;
|
||||
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());
|
||||
#else
|
||||
sprintf(cfg_user_dir, PACKAGE_DATA_DIR"/data/config/");
|
||||
#endif
|
||||
return cfg_user_dir;
|
||||
}
|
||||
|
|
54
src/icccm.c
54
src/icccm.c
|
@ -137,15 +137,11 @@ e_icccm_release(Window win)
|
|||
void
|
||||
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;
|
||||
double aspect_min, aspect_max;
|
||||
int mask;
|
||||
XSizeHints hint;
|
||||
|
||||
x = 0; y = 0; w = 0; h = 0;
|
||||
e_window_get_geometry(win, &x, &y, &w, &h);
|
||||
|
||||
grav = NorthWestGravity;
|
||||
mask = 0;
|
||||
min_w = 0;
|
||||
|
@ -160,28 +156,6 @@ e_icccm_get_size_info(Window win, E_Border *b)
|
|||
base_h = 0;
|
||||
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)
|
||||
{
|
||||
min_w = hint.min_width;
|
||||
|
@ -221,33 +195,6 @@ e_icccm_get_size_info(Window win, E_Border *b)
|
|||
aspect_max = ((double)hint.max_aspect.x) / ((double)hint.max_aspect.y);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!b->placed)
|
||||
{
|
||||
/* 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;
|
||||
}
|
||||
}
|
||||
{
|
||||
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;
|
||||
|
@ -260,7 +207,6 @@ e_icccm_get_size_info(Window win, E_Border *b)
|
|||
b->client.max.aspect = aspect_max;
|
||||
b->changed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
e_icccm_get_mwm_hints(Window win, E_Border *b)
|
||||
|
|
|
@ -179,7 +179,6 @@ e_file_list_dir(char *dir)
|
|||
list = NULL;
|
||||
while ((dp = readdir(dirp)))
|
||||
{
|
||||
printf("%s\n", dp->d_name);
|
||||
if ((strcmp(dp->d_name, ".")) &&
|
||||
(strcmp(dp->d_name, "..")))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue