mah mah mah... fixed soem initial placement probs related to being too keen

on changing borders all the time.. shoudl be more efficent and faster now too


SVN revision: 5722
This commit is contained in:
Carsten Haitzler 2001-11-20 07:01:53 +00:00
parent d90ac55831
commit 84fae7ac6d
3 changed files with 44 additions and 43 deletions

View File

@ -200,9 +200,6 @@ e_configure_request(Ecore_Event * 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.h = e->h;
*/
b->current.requested.w = e->w + pl + pr; b->current.requested.w = e->w + pl + pr;
b->current.requested.h = e->h + pt + pb; b->current.requested.h = e->h + pt + pb;
} }
@ -271,6 +268,7 @@ e_property(Ecore_Event * ev)
if (b) if (b)
{ {
e_icccm_handle_property_change(e->atom, b); e_icccm_handle_property_change(e->atom, b);
e_border_apply_border(b);
} }
} }
current_ev = NULL; current_ev = NULL;
@ -462,23 +460,6 @@ e_focus_in(Ecore_Event * ev)
b->click_grab = NULL; b->click_grab = NULL;
} }
} }
/* FUCKED UP:
* look at this debug output:
* f in 800003
* to: Fukeneh!
* ungrab ctf buttons
* f out 400003
* from: F..... Oath!
* grab dem buttonz!
* f in 400003
* to: F..... Oath!
* ungrab ctf buttons
*
* first the focus automatically reverts to Fukeneh (the window)
* now i click on F...... Oath - but i get aofocus out event from
* F..... Oath - it had no focus... but i get a focus out.. i should
* be getting a focus out for fukeneh!
*/
} }
current_ev = NULL; current_ev = NULL;
@ -590,9 +571,7 @@ e_mouse_down(Ecore_Event * ev)
{ {
Evas evas; Evas evas;
int x, y; int x, y;
evas = b->evas.l; evas = b->evas.l;
ecore_window_get_root_relative_location(evas_get_window(evas), ecore_window_get_root_relative_location(evas_get_window(evas),
&x, &y); &x, &y);
@ -702,6 +681,7 @@ e_mouse_move(Ecore_Event * ev)
mouse_x = e->rx; mouse_x = e->rx;
mouse_y = e->ry; mouse_y = e->ry;
b = e_border_find_by_window(e->win); b = e_border_find_by_window(e->win);
/* D("motion... %3.8f\n", ecore_get_time());*/
if (b) if (b)
{ {
if (e->win == b->win.main) e_cb_border_mouse_move(b, ev); if (e->win == b->win.main) e_cb_border_mouse_move(b, ev);
@ -1133,10 +1113,14 @@ e_cb_border_mouse_down(E_Border *b, Ecore_Event *e)
x, y, border_mouse_x, border_mouse_y); x, y, border_mouse_x, border_mouse_y);
if (!e_action_start(class, act, bt, NULL, mods, E_OBJECT(b), NULL, if (!e_action_start(class, act, bt, NULL, mods, E_OBJECT(b), NULL,
x, y, border_mouse_x, border_mouse_y)) x, y, border_mouse_x, border_mouse_y))
ecore_pointer_ungrab(((Ecore_Event_Mouse_Down *)(e->event))->time); {
ecore_pointer_ungrab(((Ecore_Event_Mouse_Down *)(e->event))->time);
}
else else
ecore_pointer_grab(((Ecore_Event_Mouse_Down *)(e->event))->win, {
((Ecore_Event_Mouse_Down *)(e->event))->time); ecore_pointer_grab(((Ecore_Event_Mouse_Down *)(e->event))->win,
((Ecore_Event_Mouse_Down *)(e->event))->time);
}
} }
D_RETURN; D_RETURN;
@ -1295,17 +1279,20 @@ e_border_apply_border(E_Border *b)
if ((!b->client.titlebar) && (!b->client.border)) style = "borderless"; if ((!b->client.titlebar) && (!b->client.border)) style = "borderless";
if (b->border_style) style = b->border_style; if (b->border_style) style = b->border_style;
if (b->current.selected) prop_selected = 1; if (b->current.selected) prop_selected = 1;
if (b->current.shaded == b->client.h) prop_shaded = 1; if ((b->current.shaded > 0) &&
if (b->client.sticky) prop_sticky = 1; (b->current.shaded == b->client.h)) prop_shaded = 1;
if (b->client.sticky) prop_sticky = 1;
sprintf(border, "selected-%i.sticky-%i.shaded-%i.bits.db", sprintf(border, "selected-%i.sticky-%i.shaded-%i.bits.db",
prop_selected, prop_sticky, prop_shaded); prop_selected, prop_sticky, prop_shaded);
borders = e_config_get("borders"); borders = e_config_get("borders");
sprintf(buf, "%s%s/%s", borders, style, border); sprintf(buf, "%s%s/%s", borders, style, border);
/* if it's not changed - abort and dont do anything */ /* if it's not changed - abort and dont do anything */
if ((b->border_file) && (!strcmp(buf, b->border_file))) D_RETURN; if ((b->border_file) && (!strcmp(buf, b->border_file))) D_RETURN;
IF_FREE(b->border_file); IF_FREE(b->border_file);
e_strdup(b->border_file, buf); e_strdup(b->border_file, buf);
@ -2180,18 +2167,8 @@ e_border_update(E_Border *b)
size_changed = 1; size_changed = 1;
if ((size_changed) && (b->current.has_shape)) if ((size_changed) && (b->current.has_shape))
shape_changed = 1; shape_changed = 1;
if (b->bits.new)
{
ecore_window_gravity_set(b->win.container, StaticGravity);
border_changed = 1;
}
if ((border_changed) && (b->current.has_shape))
shape_changed = 1;
if (b->current.visible != b->previous.visible)
visibility_changed = 1;
if (b->current.selected != b->previous.selected) if (b->current.selected != b->previous.selected)
state_changed = 1; state_changed = 1;
if (state_changed) if (state_changed)
{ {
e_border_apply_border(b); e_border_apply_border(b);
@ -2202,6 +2179,16 @@ e_border_update(E_Border *b)
size_changed = 1; size_changed = 1;
} }
} }
if (b->bits.new)
{
ecore_window_gravity_set(b->win.container, StaticGravity);
border_changed = 1;
}
if ((border_changed) && (b->current.has_shape))
shape_changed = 1;
if (b->current.visible != b->previous.visible)
visibility_changed = 1;
if ((location_changed) && (!size_changed)) if ((location_changed) && (!size_changed))
{ {
int pl, pr, pt, pb; int pl, pr, pt, pb;

View File

@ -353,7 +353,6 @@ e_icccm_get_mwm_hints(Window win, E_Border *b)
if (mwmhints->decorations & MWM_DECOR_BORDER) b->client.border = 1; if (mwmhints->decorations & MWM_DECOR_BORDER) b->client.border = 1;
if (mwmhints->decorations & MWM_DECOR_RESIZEH) b->client.handles = 1; if (mwmhints->decorations & MWM_DECOR_RESIZEH) b->client.handles = 1;
if (mwmhints->decorations & MWM_DECOR_TITLE) b->client.titlebar = 1; if (mwmhints->decorations & MWM_DECOR_TITLE) b->client.titlebar = 1;
e_border_apply_border(b);
} }
FREE(mwmhints); FREE(mwmhints);
} }

View File

@ -50,10 +50,13 @@ e_view_write_icon_xy_timeout(int val, void *data)
E_View *v; E_View *v;
Evas_List l; Evas_List l;
E_Icon *ic; E_Icon *ic;
double t_in;
D_ENTER; D_ENTER;
v = data; v = data;
/* FIXME: this is a problem if we have 1000's of icons */
t_in = ecore_get_time();
for (l = v->icons; l; l = l->next) for (l = v->icons; l; l = l->next)
{ {
ic = l->data; ic = l->data;
@ -72,6 +75,14 @@ e_view_write_icon_xy_timeout(int val, void *data)
"/pos/y", buf, "/pos/y", buf,
ic->geom.y); ic->geom.y);
} }
if ((ecore_get_time() - t_in) > 0.10)
{
char name[PATH_MAX];
sprintf(name, "icon_xy_record.%s", v->dir);
ecore_add_event_timer(name, 0.01, e_view_write_icon_xy_timeout, 0, v);
D_RETURN;
}
} }
D_RETURN; D_RETURN;
@ -758,6 +769,7 @@ e_view_geometry_record(E_View *v)
{ {
int left, top; int left, top;
D("Record geom for view\n");
ecore_window_get_frame_size(v->win.base, &left, NULL, ecore_window_get_frame_size(v->win.base, &left, NULL,
&top, NULL); &top, NULL);
efsd_set_metadata_int(e_fs_get_connection(), efsd_set_metadata_int(e_fs_get_connection(),
@ -841,6 +853,7 @@ e_configure(Ecore_Event * ev)
D("wm generated %i %i, %ix%i\n", e->x, e->y, e->w, e->h); D("wm generated %i %i, %ix%i\n", e->x, e->y, e->w, e->h);
if ((e->x != v->location.x) || (e->y != v->location.y)) if ((e->x != v->location.x) || (e->y != v->location.y))
{ {
D("new spot!\n");
v->location.x = e->x; v->location.x = e->x;
v->location.y = e->y; v->location.y = e->y;
e_view_queue_geometry_record(v); e_view_queue_geometry_record(v);
@ -1320,8 +1333,9 @@ e_view_handle_fs_restart(void *data)
"/view/w", v->dir, EFSD_INT); "/view/w", v->dir, EFSD_INT);
v->geom_get.h = efsd_get_metadata(e_fs_get_connection(), v->geom_get.h = efsd_get_metadata(e_fs_get_connection(),
"/view/h", v->dir, EFSD_INT); "/view/h", v->dir, EFSD_INT);
v->getbg = efsd_get_metadata(e_fs_get_connection(), "/view/background", v->dir, EFSD_STRING); v->getbg = efsd_get_metadata(e_fs_get_connection(),
} "/view/background", v->dir, EFSD_STRING);
}
{ {
EfsdOptions *ops; EfsdOptions *ops;
@ -1758,8 +1772,9 @@ e_view_set_dir(E_View *v, char *dir)
"/view/w", v->dir, EFSD_INT); "/view/w", v->dir, EFSD_INT);
v->geom_get.h = efsd_get_metadata(e_fs_get_connection(), v->geom_get.h = efsd_get_metadata(e_fs_get_connection(),
"/view/h", v->dir, EFSD_INT); "/view/h", v->dir, EFSD_INT);
v->getbg = efsd_get_metadata(e_fs_get_connection(),
"/view/background", v->dir, EFSD_STRING);
v->geom_get.busy = 1; v->geom_get.busy = 1;
v->getbg = efsd_get_metadata(e_fs_get_connection(), "/view/background", v->dir, EFSD_STRING);
{ {
EfsdOptions *ops; EfsdOptions *ops;