SVN revision: 15911
This commit is contained in:
Carsten Haitzler 2005-07-27 04:51:42 +00:00
parent 2003f078a7
commit f4f1ad13b4
4 changed files with 130 additions and 77 deletions

2
TODO
View File

@ -8,8 +8,6 @@ Some of the things (in very short form) that need to be done to E17...
BUGS / FIXES BUGS / FIXES
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
* BUG: edge flip resist (timeout) seems to not work right while dragging
windows.
* e_hints.c manually changes flags on a border isnetad of calling * e_hints.c manually changes flags on a border isnetad of calling
e_border_stick() for exampe or the calls in e_border.c - add calls as needed e_border_stick() for exampe or the calls in e_border.c - add calls as needed
to e_border.c. before calling check the lock flags too. to e_border.c. before calling check the lock flags too.

View File

@ -558,11 +558,7 @@ e_border_hide(E_Border *bd, int manage)
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
if (!bd->visible) return; if (!bd->visible) return;
if (bd->moving) if (bd->moving)
{ _e_border_move_end(bd);
bd->moving = 0;
_e_border_move_end(bd);
e_zone_flip_coords_handle(bd->zone, -1, -1);
}
if (bd->fullscreen) if (bd->fullscreen)
e_border_unfullscreen(bd); e_border_unfullscreen(bd);
if (bd->resize_mode != RESIZE_NONE) if (bd->resize_mode != RESIZE_NONE)
@ -1603,6 +1599,7 @@ e_border_act_move_begin(E_Border *bd, Ecore_X_Event_Mouse_Button_Down *ev)
if (!_e_border_move_begin(bd)) if (!_e_border_move_begin(bd))
return; return;
e_zone_flip_win_disable();
bd->moving = 1; bd->moving = 1;
if (ev) if (ev)
{ {
@ -1619,6 +1616,7 @@ e_border_act_move_end(E_Border *bd, Ecore_X_Event_Mouse_Button_Up *ev)
{ {
if (bd->moving) if (bd->moving)
{ {
e_zone_flip_win_restore();
bd->moving = 0; bd->moving = 0;
_e_border_move_end(bd); _e_border_move_end(bd);
e_zone_flip_coords_handle(bd->zone, -1, -1); e_zone_flip_coords_handle(bd->zone, -1, -1);
@ -2882,6 +2880,7 @@ _e_border_cb_window_move_resize_request(void *data, int ev_type, void *ev)
if (!_e_border_move_begin(bd)) if (!_e_border_move_begin(bd))
return 1; return 1;
bd->moving = 1; bd->moving = 1;
e_zone_flip_win_disable();
bd->cur_mouse_action = e_action_find("window_move"); bd->cur_mouse_action = e_action_find("window_move");
if (bd->cur_mouse_action) if (bd->cur_mouse_action)
@ -2965,6 +2964,7 @@ _e_border_cb_signal_move_start(void *data, Evas_Object *obj, const char *emissio
if (!_e_border_move_begin(bd)) if (!_e_border_move_begin(bd))
return; return;
bd->moving = 1; bd->moving = 1;
e_zone_flip_win_disable();
_e_border_moveinfo_gather(bd, source); _e_border_moveinfo_gather(bd, source);
} }
@ -2976,6 +2976,7 @@ _e_border_cb_signal_move_stop(void *data, Evas_Object *obj, const char *emission
bd = data; bd = data;
if (!bd->moving) return; if (!bd->moving) return;
bd->moving = 0; bd->moving = 0;
e_zone_flip_win_restore();
_e_border_move_end(bd); _e_border_move_end(bd);
e_zone_flip_coords_handle(bd->zone, -1, -1); e_zone_flip_coords_handle(bd->zone, -1, -1);
} }

View File

@ -264,33 +264,29 @@ e_zone_flip_coords_handle(E_Zone *zone, int x, int y)
if ((y == 0) && E_ZONE_FLIP_UP(zone)) if ((y == 0) && E_ZONE_FLIP_UP(zone))
{ {
/* top */ /* top */
if (zone->flip.timer) if (!zone->flip.timer)
ecore_timer_del(zone->flip.timer); zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_UP; zone->flip.direction = E_DIRECTION_UP;
} }
else if ((x == (zone->w - 1)) && E_ZONE_FLIP_RIGHT(zone)) else if ((x == (zone->w - 1)) && E_ZONE_FLIP_RIGHT(zone))
{ {
/* right */ /* right */
if (zone->flip.timer) if (!zone->flip.timer)
ecore_timer_del(zone->flip.timer); zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_RIGHT; zone->flip.direction = E_DIRECTION_RIGHT;
} }
else if ((y == (zone->h - 1)) && E_ZONE_FLIP_DOWN(zone)) else if ((y == (zone->h - 1)) && E_ZONE_FLIP_DOWN(zone))
{ {
/* bottom */ /* bottom */
if (zone->flip.timer) if (!zone->flip.timer)
ecore_timer_del(zone->flip.timer); zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_DOWN; zone->flip.direction = E_DIRECTION_DOWN;
} }
else if ((x == 0) && E_ZONE_FLIP_LEFT(zone)) else if ((x == 0) && E_ZONE_FLIP_LEFT(zone))
{ {
/* left */ /* left */
if (zone->flip.timer) if (!zone->flip.timer)
ecore_timer_del(zone->flip.timer); zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_LEFT; zone->flip.direction = E_DIRECTION_LEFT;
} }
else else
@ -483,6 +479,57 @@ e_zone_desk_linear_flip_to(E_Zone *zone, int x)
e_zone_desk_flip_to(zone, x, y); e_zone_desk_flip_to(zone, x, y);
} }
void
e_zone_flip_win_disable(void)
{
Evas_List *l, *ll, *lll;
E_Manager *man;
E_Container *con;
for (l = e_manager_list(); l; l = l->next)
{
man = l->data;
for (ll = man->containers; ll; ll = ll->next)
{
con = ll->data;
for (lll = con->zones; lll; lll = lll->next)
{
E_Zone *zone;
zone = lll->data;
ecore_x_window_hide(zone->flip.left);
ecore_x_window_hide(zone->flip.right);
ecore_x_window_hide(zone->flip.top);
ecore_x_window_hide(zone->flip.bottom);
}
}
}
}
void
e_zone_flip_win_restore(void)
{
Evas_List *l, *ll, *lll;
E_Manager *man;
E_Container *con;
for (l = e_manager_list(); l; l = l->next)
{
man = l->data;
for (ll = man->containers; ll; ll = ll->next)
{
con = ll->data;
for (lll = con->zones; lll; lll = lll->next)
{
E_Zone *zone;
zone = lll->data;
_e_zone_update_flip(zone);
}
}
}
}
int int
e_zone_app_exec(E_Zone *zone, E_App *a) e_zone_app_exec(E_Zone *zone, E_App *a)
{ {
@ -706,30 +753,26 @@ _e_zone_cb_mouse_in(void *data, int type, void *event)
if (ev->win == zone->flip.top) if (ev->win == zone->flip.top)
{ {
if (zone->flip.timer) if (!zone->flip.timer)
ecore_timer_del(zone->flip.timer); zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_UP; zone->flip.direction = E_DIRECTION_UP;
} }
else if (ev->win == zone->flip.right) else if (ev->win == zone->flip.right)
{ {
if (zone->flip.timer) if (!zone->flip.timer)
ecore_timer_del(zone->flip.timer); zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_RIGHT; zone->flip.direction = E_DIRECTION_RIGHT;
} }
else if (ev->win == zone->flip.bottom) else if (ev->win == zone->flip.bottom)
{ {
if (zone->flip.timer) if (!zone->flip.timer)
ecore_timer_del(zone->flip.timer); zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_DOWN; zone->flip.direction = E_DIRECTION_DOWN;
} }
else if (ev->win == zone->flip.left) else if (ev->win == zone->flip.left)
{ {
if (zone->flip.timer) if (!zone->flip.timer)
ecore_timer_del(zone->flip.timer); zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.timer = ecore_timer_add(e_config->edge_flip_timeout, _e_zone_cb_timer, zone);
zone->flip.direction = E_DIRECTION_LEFT; zone->flip.direction = E_DIRECTION_LEFT;
} }
return 1; return 1;
@ -744,10 +787,15 @@ _e_zone_cb_mouse_out(void *data, int type, void *event)
ev = event; ev = event;
zone = data; zone = data;
if (zone->flip.timer) if ((ev->win == zone->flip.top) ||
ecore_timer_del(zone->flip.timer); (ev->win == zone->flip.bottom) ||
zone->flip.timer = NULL; (ev->win == zone->flip.left) ||
(ev->win == zone->flip.right))
{
if (zone->flip.timer)
ecore_timer_del(zone->flip.timer);
zone->flip.timer = NULL;
}
return 1; return 1;
} }
@ -759,6 +807,7 @@ _e_zone_cb_timer(void *data)
E_Event_Pointer_Warp *ev; E_Event_Pointer_Warp *ev;
int x, y; int x, y;
printf("_e_zone_cb_timer()\n");
ev = E_NEW(E_Event_Pointer_Warp, 1); ev = E_NEW(E_Event_Pointer_Warp, 1);
if (!ev) return 0; if (!ev) return 0;
@ -772,7 +821,7 @@ _e_zone_cb_timer(void *data)
switch (zone->flip.direction) switch (zone->flip.direction)
{ {
case E_DIRECTION_UP: case E_DIRECTION_UP:
if (E_ZONE_FLIP_UP(zone)) if (E_ZONE_FLIP_UP(zone))
{ {
current = e_desk_at_xy_get(zone, zone->desk_x_current, zone->desk_y_current - 1); current = e_desk_at_xy_get(zone, zone->desk_x_current, zone->desk_y_current - 1);
if (current) if (current)
@ -783,55 +832,58 @@ _e_zone_cb_timer(void *data)
ev->curr.y = zone->h - 2; ev->curr.y = zone->h - 2;
} }
} }
break; break;
case E_DIRECTION_RIGHT: case E_DIRECTION_RIGHT:
if (E_ZONE_FLIP_RIGHT(zone)) printf("clip right...\n");
{ if (E_ZONE_FLIP_RIGHT(zone))
current = e_desk_at_xy_get(zone, zone->desk_x_current + 1, zone->desk_y_current); {
if (current) printf("ummm...\n");
{ current = e_desk_at_xy_get(zone, zone->desk_x_current + 1, zone->desk_y_current);
e_desk_show(current); if (current)
ecore_x_pointer_warp(zone->container->win, 2, y); {
ev->curr.y = y; printf("show new desk\n");
ev->curr.x = 2; e_desk_show(current);
} ecore_x_pointer_warp(zone->container->win, 2, y);
} ev->curr.y = y;
break; ev->curr.x = 2;
}
}
break;
case E_DIRECTION_DOWN: case E_DIRECTION_DOWN:
if (E_ZONE_FLIP_DOWN(zone)) if (E_ZONE_FLIP_DOWN(zone))
{ {
current = e_desk_at_xy_get(zone, zone->desk_x_current, zone->desk_y_current + 1); current = e_desk_at_xy_get(zone, zone->desk_x_current, zone->desk_y_current + 1);
if (current) if (current)
{ {
e_desk_show(current); e_desk_show(current);
ecore_x_pointer_warp(zone->container->win, x, 2); ecore_x_pointer_warp(zone->container->win, x, 2);
ev->curr.x = x; ev->curr.x = x;
ev->curr.y = 2; ev->curr.y = 2;
} }
} }
break; break;
case E_DIRECTION_LEFT: case E_DIRECTION_LEFT:
if (E_ZONE_FLIP_LEFT(zone)) if (E_ZONE_FLIP_LEFT(zone))
{ {
current = e_desk_at_xy_get(zone, zone->desk_x_current - 1, zone->desk_y_current); current = e_desk_at_xy_get(zone, zone->desk_x_current - 1, zone->desk_y_current);
if (current) if (current)
{ {
e_desk_show(current); e_desk_show(current);
ecore_x_pointer_warp(zone->container->win, zone->w - 2, y); ecore_x_pointer_warp(zone->container->win, zone->w - 2, y);
ev->curr.y = y; ev->curr.y = y;
ev->curr.x = zone->w - 2; ev->curr.x = zone->w - 2;
} }
} }
break; break;
} }
zone->flip.timer = NULL; zone->flip.timer = NULL;
if (current) if (current)
ecore_event_add(E_EVENT_POINTER_WARP, ev, NULL, NULL); ecore_event_add(E_EVENT_POINTER_WARP, ev, NULL, NULL);
else else
free(ev); free(ev);
return 0; return 0;
} }

View File

@ -86,9 +86,11 @@ EAPI void e_zone_desk_flip_by(E_Zone *zone, int dx, int dy);
EAPI void e_zone_desk_flip_to(E_Zone *zone, int x, int y); EAPI void e_zone_desk_flip_to(E_Zone *zone, int x, int y);
EAPI void e_zone_desk_linear_flip_by(E_Zone *zone, int dx); EAPI void e_zone_desk_linear_flip_by(E_Zone *zone, int dx);
EAPI void e_zone_desk_linear_flip_to(E_Zone *zone, int x); EAPI void e_zone_desk_linear_flip_to(E_Zone *zone, int x);
EAPI void e_zone_flip_win_disable(void);
EAPI void e_zone_flip_win_restore(void);
EAPI int e_zone_app_exec(E_Zone *zone, E_App *a); EAPI int e_zone_app_exec(E_Zone *zone, E_App *a);
extern EAPI int E_EVENT_ZONE_DESK_COUNT_SET; extern EAPI int E_EVENT_ZONE_DESK_COUNT_SET;
extern EAPI int E_EVENT_POINTER_WARP; extern EAPI int E_EVENT_POINTER_WARP;