fix edge bindings to work if you add other bindings to corners other

than edge flips.



SVN revision: 70558
This commit is contained in:
Carsten Haitzler 2012-04-30 12:29:34 +00:00
parent bad06a673a
commit 7c23365cf9
3 changed files with 67 additions and 96 deletions

View File

@ -532,6 +532,25 @@ e_bindings_edge_flippable_get(E_Zone_Edge edge)
return EINA_FALSE; return EINA_FALSE;
} }
EAPI Eina_Bool
e_bindings_edge_non_flippable_get(E_Zone_Edge edge)
{
E_Binding_Edge *bind;
Eina_List *l;
EINA_LIST_FOREACH(edge_bindings, l, bind)
{
if ((bind->edge == edge) && (bind->action))
{
if ((!strcmp(bind->action, "desk_flip_in_direction")) ||
(!strcmp(bind->action, "desk_flip_by")))
continue;
return EINA_TRUE;
}
}
return EINA_FALSE;
}
EAPI E_Binding_Edge * EAPI E_Binding_Edge *
e_bindings_edge_get(const char *action, E_Zone_Edge edge, Eina_Bool click) e_bindings_edge_get(const char *action, E_Zone_Edge edge, Eina_Bool click)
{ {

View File

@ -125,6 +125,7 @@ EAPI E_Action *e_bindings_key_up_event_find(E_Binding_Context ctxt, Ecore_Even
EAPI void e_bindings_edge_add(E_Binding_Context ctxt, E_Zone_Edge edge, E_Binding_Modifier mod, int any_mod, const char *action, const char *params, float delay); EAPI void e_bindings_edge_add(E_Binding_Context ctxt, E_Zone_Edge edge, E_Binding_Modifier mod, int any_mod, const char *action, const char *params, float delay);
EAPI Eina_Bool e_bindings_edge_flippable_get(E_Zone_Edge edge); EAPI Eina_Bool e_bindings_edge_flippable_get(E_Zone_Edge edge);
EAPI Eina_Bool e_bindings_edge_non_flippable_get(E_Zone_Edge edge);
EAPI E_Binding_Edge *e_bindings_edge_get(const char *action, E_Zone_Edge edge, Eina_Bool click); EAPI E_Binding_Edge *e_bindings_edge_get(const char *action, E_Zone_Edge edge, Eina_Bool click);
EAPI void e_bindings_edge_del(E_Binding_Context ctxt, E_Zone_Edge edge, E_Binding_Modifier mod, int any_mod, const char *action, const char *params, float delay); EAPI void e_bindings_edge_del(E_Binding_Context ctxt, E_Zone_Edge edge, E_Binding_Modifier mod, int any_mod, const char *action, const char *params, float delay);
EAPI E_Action *e_bindings_edge_in_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Zone_Edge *ev); EAPI E_Action *e_bindings_edge_in_event_handle(E_Binding_Context ctxt, E_Object *obj, E_Event_Zone_Edge *ev);

View File

@ -840,102 +840,53 @@ e_zone_edge_disable(void)
EAPI void EAPI void
e_zone_edges_desk_flip_capable(E_Zone *zone, Eina_Bool l, Eina_Bool r, Eina_Bool t, Eina_Bool b) e_zone_edges_desk_flip_capable(E_Zone *zone, Eina_Bool l, Eina_Bool r, Eina_Bool t, Eina_Bool b)
{ {
if (l) #define NEED_FLIP_EDGE(x) \
{ (e_bindings_edge_flippable_get(x) || e_bindings_edge_non_flippable_get(x))
if (e_bindings_edge_flippable_get(E_ZONE_EDGE_LEFT)) #define NEED_EDGE(x) \
{ (e_bindings_edge_non_flippable_get(x))
if (zone->edge.left) ecore_x_window_show(zone->edge.left); #define CHECK_EDGE(v, ed, win) \
} do { \
} if (v) { \
else if (NEED_FLIP_EDGE(ed)) { if (zone->edge.win) ecore_x_window_show(zone->edge.win); } \
{ else if (zone->edge.win) ecore_x_window_hide(zone->edge.win); \
if (zone->edge.left) ecore_x_window_hide(zone->edge.left); } \
} else { \
if (r) if (NEED_EDGE(ed)) { if (zone->edge.win) ecore_x_window_show(zone->edge.win); } \
{ else if (zone->edge.win) ecore_x_window_hide(zone->edge.win); \
if (e_bindings_edge_flippable_get(E_ZONE_EDGE_RIGHT)) } \
{ } while (0)
if (zone->edge.right) ecore_x_window_show(zone->edge.right);
} CHECK_EDGE(l, E_ZONE_EDGE_LEFT, left);
} CHECK_EDGE(r, E_ZONE_EDGE_RIGHT, right);
else CHECK_EDGE(t, E_ZONE_EDGE_TOP, top);
{ CHECK_EDGE(b, E_ZONE_EDGE_BOTTOM, bottom);
if (zone->edge.right) ecore_x_window_hide(zone->edge.right);
} #define CHECK_CORNER(v1, v2, ed, win1, win2) \
if (t) if ((!v1) && (!v2)) { \
{ if (NEED_EDGE(ed)) { \
if (e_bindings_edge_flippable_get(E_ZONE_EDGE_TOP)) if (zone->corner.win1) ecore_x_window_show(zone->corner.win1); \
{ if (zone->corner.win2) ecore_x_window_show(zone->corner.win2); \
if (zone->edge.top) ecore_x_window_show(zone->edge.top); } \
} else { \
} if (zone->corner.win1) ecore_x_window_hide(zone->corner.win1); \
else if (zone->corner.win2) ecore_x_window_hide(zone->corner.win2); \
{ } \
if (zone->edge.top) ecore_x_window_hide(zone->edge.top); } \
} else { \
if (b) if (NEED_FLIP_EDGE(ed)) { \
{ if (zone->corner.win1) ecore_x_window_show(zone->corner.win1); \
if (e_bindings_edge_flippable_get(E_ZONE_EDGE_BOTTOM)) if (zone->corner.win2) ecore_x_window_show(zone->corner.win2); \
{ } \
if (zone->edge.bottom) ecore_x_window_show(zone->edge.bottom); else { \
} if (zone->corner.win1) ecore_x_window_hide(zone->corner.win1); \
} if (zone->corner.win2) ecore_x_window_hide(zone->corner.win2); \
else } \
{ }
if (zone->edge.bottom) ecore_x_window_hide(zone->edge.bottom);
} CHECK_CORNER(l, t, E_ZONE_EDGE_TOP_LEFT, left_top, top_left);
if ((!l) && (!t)) CHECK_CORNER(r, t, E_ZONE_EDGE_TOP_RIGHT, right_top, top_right);
{ CHECK_CORNER(l, b, E_ZONE_EDGE_BOTTOM_LEFT, left_bottom, bottom_left);
if (zone->corner.left_top) ecore_x_window_hide(zone->corner.left_top); CHECK_CORNER(r, b, E_ZONE_EDGE_BOTTOM_RIGHT, right_bottom, bottom_right);
if (zone->corner.top_left) ecore_x_window_hide(zone->corner.top_left);
}
else
{
if (e_bindings_edge_flippable_get(E_ZONE_EDGE_TOP_LEFT))
{
if (zone->corner.left_top) ecore_x_window_show(zone->corner.left_top);
if (zone->corner.top_left) ecore_x_window_show(zone->corner.top_left);
}
}
if ((!r) && (!t))
{
if (zone->corner.right_top) ecore_x_window_hide(zone->corner.right_top);
if (zone->corner.top_right) ecore_x_window_hide(zone->corner.top_right);
}
else
{
if (e_bindings_edge_flippable_get(E_ZONE_EDGE_TOP_RIGHT))
{
if (zone->corner.right_top) ecore_x_window_show(zone->corner.right_top);
if (zone->corner.top_right) ecore_x_window_show(zone->corner.top_right);
}
}
if ((!l) && (!b))
{
if (zone->corner.left_bottom) ecore_x_window_hide(zone->corner.left_bottom);
if (zone->corner.bottom_left) ecore_x_window_hide(zone->corner.bottom_left);
}
else
{
if (e_bindings_edge_flippable_get(E_ZONE_EDGE_BOTTOM_LEFT))
{
if (zone->corner.left_bottom) ecore_x_window_show(zone->corner.left_bottom);
if (zone->corner.bottom_left) ecore_x_window_show(zone->corner.bottom_left);
}
}
if ((!r) && (!b))
{
if (zone->corner.right_bottom) ecore_x_window_hide(zone->corner.right_bottom);
if (zone->corner.bottom_right) ecore_x_window_hide(zone->corner.bottom_right);
}
else
{
if (e_bindings_edge_flippable_get(E_ZONE_EDGE_BOTTOM_RIGHT))
{
if (zone->corner.right_bottom) ecore_x_window_show(zone->corner.right_bottom);
if (zone->corner.bottom_right) ecore_x_window_show(zone->corner.bottom_right);
}
}
} }
EAPI Eina_Bool EAPI Eina_Bool