forked from enlightenment/enlightenment
add jump mode to quickaccess for cedric
SVN revision: 75596
This commit is contained in:
parent
a57b2b8651
commit
76c91a123d
|
@ -450,6 +450,7 @@ e_qa_config_dd_new(void)
|
||||||
E_CONFIG_VAL(D, T, config.autohide, UCHAR);
|
E_CONFIG_VAL(D, T, config.autohide, UCHAR);
|
||||||
E_CONFIG_VAL(D, T, config.relaunch, UCHAR);
|
E_CONFIG_VAL(D, T, config.relaunch, UCHAR);
|
||||||
E_CONFIG_VAL(D, T, config.hidden, UCHAR);
|
E_CONFIG_VAL(D, T, config.hidden, UCHAR);
|
||||||
|
E_CONFIG_VAL(D, T, config.jump, UCHAR);
|
||||||
E_CONFIG_VAL(D, T, transient, UCHAR);
|
E_CONFIG_VAL(D, T, transient, UCHAR);
|
||||||
#undef T
|
#undef T
|
||||||
#undef D
|
#undef D
|
||||||
|
|
|
@ -32,6 +32,7 @@ typedef struct E_Quick_Access_Entry
|
||||||
Eina_Bool hide_when_behind; // hide when window is not focused instead of raising
|
Eina_Bool hide_when_behind; // hide when window is not focused instead of raising
|
||||||
Eina_Bool hidden; // FIXME: used for tracking current state to restore on restart
|
Eina_Bool hidden; // FIXME: used for tracking current state to restore on restart
|
||||||
Eina_Bool relaunch; // reopen on exit
|
Eina_Bool relaunch; // reopen on exit
|
||||||
|
Eina_Bool jump; // don't hide window, just jump to it when activated
|
||||||
} config;
|
} config;
|
||||||
Eina_Bool transient;
|
Eina_Bool transient;
|
||||||
} E_Quick_Access_Entry;
|
} E_Quick_Access_Entry;
|
||||||
|
|
|
@ -173,6 +173,8 @@ _e_qa_border_activate(E_Quick_Access_Entry *entry)
|
||||||
{
|
{
|
||||||
entry->config.hidden = 0;
|
entry->config.hidden = 0;
|
||||||
if (!entry->border) return;
|
if (!entry->border) return;
|
||||||
|
if (entry->config.jump)
|
||||||
|
e_desk_show(entry->border->desk);
|
||||||
e_border_raise(entry->border);
|
e_border_raise(entry->border);
|
||||||
e_border_show(entry->border);
|
e_border_show(entry->border);
|
||||||
e_border_focus_set(entry->border, 1, 1);
|
e_border_focus_set(entry->border, 1, 1);
|
||||||
|
@ -182,6 +184,7 @@ _e_qa_border_activate(E_Quick_Access_Entry *entry)
|
||||||
static void
|
static void
|
||||||
_e_qa_border_deactivate(E_Quick_Access_Entry *entry)
|
_e_qa_border_deactivate(E_Quick_Access_Entry *entry)
|
||||||
{
|
{
|
||||||
|
if (entry->config.jump) return;
|
||||||
entry->config.hidden = 1;
|
entry->config.hidden = 1;
|
||||||
if (!entry->border) return;
|
if (!entry->border) return;
|
||||||
e_border_hide(entry->border, 1);
|
e_border_hide(entry->border, 1);
|
||||||
|
@ -194,10 +197,18 @@ _e_qa_entry_border_props_apply(E_Quick_Access_Entry *entry)
|
||||||
|
|
||||||
if (entry->config.autohide && (!entry->border->focused))
|
if (entry->config.autohide && (!entry->border->focused))
|
||||||
_e_qa_border_deactivate(entry);
|
_e_qa_border_deactivate(entry);
|
||||||
|
if (entry->config.jump)
|
||||||
|
{
|
||||||
|
entry->border->client.netwm.state.skip_taskbar = 0;
|
||||||
|
entry->border->client.netwm.state.skip_pager = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (qa_config->skip_taskbar)
|
if (qa_config->skip_taskbar)
|
||||||
entry->border->client.netwm.state.skip_taskbar = 1;
|
entry->border->client.netwm.state.skip_taskbar = 1;
|
||||||
if (qa_config->skip_pager)
|
if (qa_config->skip_pager)
|
||||||
entry->border->client.netwm.state.skip_pager = 1;
|
entry->border->client.netwm.state.skip_pager = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -225,7 +236,6 @@ _e_qa_entry_border_associate(E_Quick_Access_Entry *entry, E_Border *bd)
|
||||||
/* FIXME: doesn't work, causes window to flicker on associate
|
/* FIXME: doesn't work, causes window to flicker on associate
|
||||||
if (entry->config.hidden)
|
if (entry->config.hidden)
|
||||||
_e_qa_border_deactivate(entry);
|
_e_qa_border_deactivate(entry);
|
||||||
else
|
|
||||||
*/
|
*/
|
||||||
_e_qa_entry_border_props_apply(entry);
|
_e_qa_entry_border_props_apply(entry);
|
||||||
}
|
}
|
||||||
|
@ -410,7 +420,7 @@ _e_qa_border_new(E_Quick_Access_Entry *entry)
|
||||||
{
|
{
|
||||||
E_Exec_Instance *ei;
|
E_Exec_Instance *ei;
|
||||||
|
|
||||||
if (!entry->cmd) return;
|
if ((!entry->cmd) || (!entry->config.relaunch)) return;
|
||||||
if (entry->exe)
|
if (entry->exe)
|
||||||
{
|
{
|
||||||
INF("already waiting '%s' to start for '%s' (name=%s, class=%s), "
|
INF("already waiting '%s' to start for '%s' (name=%s, class=%s), "
|
||||||
|
@ -466,7 +476,7 @@ _e_qa_toggle_cb(E_Object *obj __UNUSED__, const char *params)
|
||||||
|
|
||||||
if (entry->border)
|
if (entry->border)
|
||||||
{
|
{
|
||||||
if (entry->border->focused || entry->config.hide_when_behind)
|
if ((!entry->config.jump) && (entry->border->focused || entry->config.hide_when_behind))
|
||||||
{
|
{
|
||||||
_e_qa_border_deactivate(entry);
|
_e_qa_border_deactivate(entry);
|
||||||
return;
|
return;
|
||||||
|
@ -665,6 +675,19 @@ _e_qa_bd_menu_relaunch(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSE
|
||||||
if (entry->transient) _e_qa_entry_transient_convert(entry);
|
if (entry->transient) _e_qa_entry_transient_convert(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_qa_bd_menu_jump(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
||||||
|
{
|
||||||
|
E_Quick_Access_Entry *entry = data;
|
||||||
|
|
||||||
|
entry->config.jump = !entry->config.jump;
|
||||||
|
if (entry->config.jump)
|
||||||
|
{
|
||||||
|
entry->config.autohide = entry->config.hide_when_behind = 0;
|
||||||
|
}
|
||||||
|
_e_qa_entry_border_props_apply(entry);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_qa_bd_menu_hideraise(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
_e_qa_bd_menu_hideraise(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
|
||||||
{
|
{
|
||||||
|
@ -720,6 +743,8 @@ _e_qa_bd_menu_pre(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi)
|
||||||
e_object_data_set(E_OBJECT(subm), entry);
|
e_object_data_set(E_OBJECT(subm), entry);
|
||||||
e_menu_item_submenu_set(mi, subm);
|
e_menu_item_submenu_set(mi, subm);
|
||||||
|
|
||||||
|
if (!entry->config.jump)
|
||||||
|
{
|
||||||
mi = e_menu_item_new(subm);
|
mi = e_menu_item_new(subm);
|
||||||
e_menu_item_check_set(mi, 1);
|
e_menu_item_check_set(mi, 1);
|
||||||
e_menu_item_toggle_set(mi, entry->config.autohide);
|
e_menu_item_toggle_set(mi, entry->config.autohide);
|
||||||
|
@ -731,6 +756,13 @@ _e_qa_bd_menu_pre(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi)
|
||||||
e_menu_item_toggle_set(mi, entry->config.hide_when_behind);
|
e_menu_item_toggle_set(mi, entry->config.hide_when_behind);
|
||||||
e_menu_item_label_set(mi, _("Hide Instead Of Raise"));
|
e_menu_item_label_set(mi, _("Hide Instead Of Raise"));
|
||||||
e_menu_item_callback_set(mi, _e_qa_bd_menu_hideraise, entry);
|
e_menu_item_callback_set(mi, _e_qa_bd_menu_hideraise, entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
mi = e_menu_item_new(subm);
|
||||||
|
e_menu_item_check_set(mi, 1);
|
||||||
|
e_menu_item_toggle_set(mi, entry->config.jump);
|
||||||
|
e_menu_item_label_set(mi, _("Jump Mode"));
|
||||||
|
e_menu_item_callback_set(mi, _e_qa_bd_menu_jump, entry);
|
||||||
|
|
||||||
/* can't set relaunch for internal E dialogs; safety #1 */
|
/* can't set relaunch for internal E dialogs; safety #1 */
|
||||||
if (strcmp(entry->name, "E"))
|
if (strcmp(entry->name, "E"))
|
||||||
|
|
Loading…
Reference in New Issue