forked from enlightenment/enlightenment
WinList: add a new functionality so that we can switch between windows of the same class.
This is a major (and interesting) killer-feature of Gnome3, so let's shamelessly steal it. SVN revision: 50154
This commit is contained in:
parent
b03dbd8535
commit
029a558a98
|
@ -35,6 +35,10 @@ e_modapi_init(E_Module *m)
|
|||
"next", NULL, 0);
|
||||
e_action_predef_name_set(_("Window : List"), _("Previous Window"),
|
||||
"winlist", "prev", NULL, 0);
|
||||
e_action_predef_name_set(_("Window : List"), _("Next window of same class"), "winlist",
|
||||
"class-next", NULL, 0);
|
||||
e_action_predef_name_set(_("Window : List"), _("Previous window of same class"),
|
||||
"winlist", "class-prev", NULL, 0);
|
||||
e_action_predef_name_set(_("Window : List"), _("Window on the Left"),
|
||||
"winlist", "left", NULL, 0);
|
||||
e_action_predef_name_set(_("Window : List"), _("Window Down"),
|
||||
|
@ -56,6 +60,8 @@ e_modapi_shutdown(E_Module *m)
|
|||
{
|
||||
e_action_predef_name_del(_("Window : List"), _("Previous Window"));
|
||||
e_action_predef_name_del(_("Window : List"), _("Next Window"));
|
||||
e_action_predef_name_del(_("Window : List"), _("Previous window of same class"));
|
||||
e_action_predef_name_del(_("Window : List"), _("Next window of same class"));
|
||||
e_action_predef_name_del(_("Window : List"), _("Window on the Left"));
|
||||
e_action_predef_name_del(_("Window : List"), _("Window Down"));
|
||||
e_action_predef_name_del(_("Window : List"), _("Window Up"));
|
||||
|
@ -98,12 +104,22 @@ _e_mod_action_winlist_cb(E_Object *obj, const char *params)
|
|||
{
|
||||
if (!strcmp(params, "next"))
|
||||
{
|
||||
if (!e_winlist_show(zone))
|
||||
if (!e_winlist_show(zone, EINA_FALSE))
|
||||
e_winlist_next();
|
||||
}
|
||||
else if (!strcmp(params, "prev"))
|
||||
{
|
||||
if (!e_winlist_show(zone))
|
||||
if (!e_winlist_show(zone, EINA_FALSE))
|
||||
e_winlist_prev();
|
||||
}
|
||||
else if (!strcmp(params, "class-next"))
|
||||
{
|
||||
if (!e_winlist_show(zone, EINA_TRUE))
|
||||
e_winlist_next();
|
||||
}
|
||||
else if (!strcmp(params, "class-prev"))
|
||||
{
|
||||
if (!e_winlist_show(zone, EINA_TRUE))
|
||||
e_winlist_prev();
|
||||
}
|
||||
else if (!strcmp(params, "left"))
|
||||
|
@ -125,7 +141,7 @@ _e_mod_action_winlist_cb(E_Object *obj, const char *params)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!e_winlist_show(zone))
|
||||
if (!e_winlist_show(zone, EINA_FALSE))
|
||||
e_winlist_next();
|
||||
}
|
||||
}
|
||||
|
@ -154,14 +170,28 @@ _e_mod_action_winlist_mouse_cb(E_Object *obj, const char *params, Ecore_Event_Mo
|
|||
{
|
||||
if (!strcmp(params, "next"))
|
||||
{
|
||||
if (e_winlist_show(zone))
|
||||
if (e_winlist_show(zone, EINA_FALSE))
|
||||
e_winlist_modifiers_set(ev->modifiers);
|
||||
else
|
||||
e_winlist_next();
|
||||
}
|
||||
else if (!strcmp(params, "prev"))
|
||||
{
|
||||
if (e_winlist_show(zone))
|
||||
if (e_winlist_show(zone, EINA_FALSE))
|
||||
e_winlist_modifiers_set(ev->modifiers);
|
||||
else
|
||||
e_winlist_prev();
|
||||
}
|
||||
else if (!strcmp(params, "class-next"))
|
||||
{
|
||||
if (e_winlist_show(zone, EINA_TRUE))
|
||||
e_winlist_modifiers_set(ev->modifiers);
|
||||
else
|
||||
e_winlist_next();
|
||||
}
|
||||
else if (!strcmp(params, "class-prev"))
|
||||
{
|
||||
if (e_winlist_show(zone, EINA_TRUE))
|
||||
e_winlist_modifiers_set(ev->modifiers);
|
||||
else
|
||||
e_winlist_prev();
|
||||
|
@ -185,7 +215,7 @@ _e_mod_action_winlist_mouse_cb(E_Object *obj, const char *params, Ecore_Event_Mo
|
|||
}
|
||||
else
|
||||
{
|
||||
if (e_winlist_show(zone))
|
||||
if (e_winlist_show(zone, EINA_FALSE))
|
||||
e_winlist_modifiers_set(ev->modifiers);
|
||||
else
|
||||
e_winlist_next();
|
||||
|
@ -216,14 +246,28 @@ _e_mod_action_winlist_key_cb(E_Object *obj, const char *params, Ecore_Event_Key
|
|||
{
|
||||
if (!strcmp(params, "next"))
|
||||
{
|
||||
if (e_winlist_show(zone))
|
||||
if (e_winlist_show(zone, EINA_FALSE))
|
||||
e_winlist_modifiers_set(ev->modifiers);
|
||||
else
|
||||
e_winlist_next();
|
||||
}
|
||||
else if (!strcmp(params, "prev"))
|
||||
{
|
||||
if (e_winlist_show(zone))
|
||||
if (e_winlist_show(zone, EINA_FALSE))
|
||||
e_winlist_modifiers_set(ev->modifiers);
|
||||
else
|
||||
e_winlist_prev();
|
||||
}
|
||||
else if (!strcmp(params, "class-next"))
|
||||
{
|
||||
if (e_winlist_show(zone, EINA_TRUE))
|
||||
e_winlist_modifiers_set(ev->modifiers);
|
||||
else
|
||||
e_winlist_next();
|
||||
}
|
||||
else if (!strcmp(params, "class-prev"))
|
||||
{
|
||||
if (e_winlist_show(zone, EINA_TRUE))
|
||||
e_winlist_modifiers_set(ev->modifiers);
|
||||
else
|
||||
e_winlist_prev();
|
||||
|
@ -247,7 +291,7 @@ _e_mod_action_winlist_key_cb(E_Object *obj, const char *params, Ecore_Event_Key
|
|||
}
|
||||
else
|
||||
{
|
||||
if (e_winlist_show(zone))
|
||||
if (e_winlist_show(zone, EINA_FALSE))
|
||||
e_winlist_modifiers_set(ev->modifiers);
|
||||
else
|
||||
e_winlist_next();
|
||||
|
|
|
@ -83,7 +83,7 @@ e_winlist_shutdown(void)
|
|||
}
|
||||
|
||||
int
|
||||
e_winlist_show(E_Zone *zone)
|
||||
e_winlist_show(E_Zone *zone, Eina_Bool same_class)
|
||||
{
|
||||
int x, y, w, h;
|
||||
Evas_Object *o;
|
||||
|
@ -149,6 +149,8 @@ e_winlist_show(E_Zone *zone)
|
|||
edje_object_part_text_set(bg_object, "e.text.title", _("Select a window"));
|
||||
evas_object_show(o);
|
||||
|
||||
last_border = e_border_focused_get();
|
||||
|
||||
desk = e_desk_current_get(winlist->zone);
|
||||
e_box_freeze(list_object);
|
||||
for (l = e_border_focus_stack_get(); l; l = l->next)
|
||||
|
@ -156,7 +158,10 @@ e_winlist_show(E_Zone *zone)
|
|||
E_Border *bd;
|
||||
|
||||
bd = l->data;
|
||||
_e_winlist_border_add(bd, winlist->zone, desk);
|
||||
if ((!same_class) ||
|
||||
(!strcmp((const char*) last_border->client.icccm.class,
|
||||
(const char*) bd->client.icccm.class)))
|
||||
_e_winlist_border_add(bd, winlist->zone, desk);
|
||||
}
|
||||
e_box_thaw(list_object);
|
||||
|
||||
|
@ -172,7 +177,6 @@ e_winlist_show(E_Zone *zone)
|
|||
if (e_config->winlist_warp_while_selecting)
|
||||
ecore_x_pointer_xy_get(winlist->zone->container->win,
|
||||
&last_pointer_x, &last_pointer_y);
|
||||
last_border = e_border_focused_get();
|
||||
if (last_border)
|
||||
{
|
||||
if (!last_border->lock_focus_out)
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
int e_winlist_init(void);
|
||||
int e_winlist_shutdown(void);
|
||||
|
||||
int e_winlist_show(E_Zone *zone);
|
||||
int e_winlist_show(E_Zone *zone, Eina_Bool same_class);
|
||||
void e_winlist_hide(void);
|
||||
void e_winlist_next(void);
|
||||
void e_winlist_prev(void);
|
||||
|
|
Loading…
Reference in New Issue