forked from enlightenment/enlightenment
feature: new focus option "raise on revert focus"
this option provides the functionality which was intended by the old and broken "raise on focus" option. it raises windows ONLY when reverting focus in cases not directly triggered by the user or any application
This commit is contained in:
parent
c081cee34d
commit
166ed0d234
|
@ -354,7 +354,11 @@ _e_client_revert_focus(E_Client *ec)
|
||||||
|
|
||||||
if ((ec->parent) &&
|
if ((ec->parent) &&
|
||||||
(ec->parent->desk == desk) && (ec->parent->modal == ec))
|
(ec->parent->desk == desk) && (ec->parent->modal == ec))
|
||||||
|
{
|
||||||
evas_object_focus_set(ec->parent->frame, 1);
|
evas_object_focus_set(ec->parent->frame, 1);
|
||||||
|
if (e_config->raise_on_revert_focus)
|
||||||
|
evas_object_raise(ec->parent->frame);
|
||||||
|
}
|
||||||
else if (e_config->focus_revert_on_hide_or_close)
|
else if (e_config->focus_revert_on_hide_or_close)
|
||||||
{
|
{
|
||||||
Eina_Bool unlock = ec->lock_focus_out;
|
Eina_Bool unlock = ec->lock_focus_out;
|
||||||
|
@ -367,6 +371,7 @@ _e_client_revert_focus(E_Client *ec)
|
||||||
pec = e_client_under_pointer_get(desk, ec);
|
pec = e_client_under_pointer_get(desk, ec);
|
||||||
if (pec)
|
if (pec)
|
||||||
evas_object_focus_set(pec->frame, 1);
|
evas_object_focus_set(pec->frame, 1);
|
||||||
|
/* no autoraise/revert here because it's probably annoying */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -610,6 +610,7 @@ _e_config_edd_init(Eina_Bool old)
|
||||||
|
|
||||||
E_CONFIG_VAL(D, T, border_raise_on_mouse_action, INT);
|
E_CONFIG_VAL(D, T, border_raise_on_mouse_action, INT);
|
||||||
E_CONFIG_VAL(D, T, border_raise_on_focus, INT);
|
E_CONFIG_VAL(D, T, border_raise_on_focus, INT);
|
||||||
|
E_CONFIG_VAL(D, T, raise_on_revert_focus, INT);
|
||||||
E_CONFIG_VAL(D, T, desk_flip_wrap, INT);
|
E_CONFIG_VAL(D, T, desk_flip_wrap, INT);
|
||||||
E_CONFIG_VAL(D, T, fullscreen_flip, INT);
|
E_CONFIG_VAL(D, T, fullscreen_flip, INT);
|
||||||
E_CONFIG_VAL(D, T, multiscreen_flip, INT);
|
E_CONFIG_VAL(D, T, multiscreen_flip, INT);
|
||||||
|
@ -1403,6 +1404,7 @@ e_config_load(void)
|
||||||
E_CONFIG_LIMIT(e_config->desklock_ask_presentation_timeout, 1.0, 300.0);
|
E_CONFIG_LIMIT(e_config->desklock_ask_presentation_timeout, 1.0, 300.0);
|
||||||
E_CONFIG_LIMIT(e_config->border_raise_on_mouse_action, 0, 1);
|
E_CONFIG_LIMIT(e_config->border_raise_on_mouse_action, 0, 1);
|
||||||
E_CONFIG_LIMIT(e_config->border_raise_on_focus, 0, 1);
|
E_CONFIG_LIMIT(e_config->border_raise_on_focus, 0, 1);
|
||||||
|
E_CONFIG_LIMIT(e_config->raise_on_revert_focus, 0, 1);
|
||||||
E_CONFIG_LIMIT(e_config->desk_flip_wrap, 0, 1);
|
E_CONFIG_LIMIT(e_config->desk_flip_wrap, 0, 1);
|
||||||
E_CONFIG_LIMIT(e_config->fullscreen_flip, 0, 1);
|
E_CONFIG_LIMIT(e_config->fullscreen_flip, 0, 1);
|
||||||
E_CONFIG_LIMIT(e_config->icon_theme_overrides, 0, 1);
|
E_CONFIG_LIMIT(e_config->icon_theme_overrides, 0, 1);
|
||||||
|
|
|
@ -47,7 +47,7 @@ typedef enum
|
||||||
/* increment this whenever a new set of config values are added but the users
|
/* increment this whenever a new set of config values are added but the users
|
||||||
* config doesn't need to be wiped - simply new values need to be put in
|
* config doesn't need to be wiped - simply new values need to be put in
|
||||||
*/
|
*/
|
||||||
#define E_CONFIG_FILE_GENERATION 15
|
#define E_CONFIG_FILE_GENERATION 16
|
||||||
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION)
|
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION)
|
||||||
|
|
||||||
#define E_CONFIG_BINDINGS_VERSION 0 // DO NOT INCREMENT UNLESS YOU WANT TO WIPE ALL BINDINGS!!!!!
|
#define E_CONFIG_BINDINGS_VERSION 0 // DO NOT INCREMENT UNLESS YOU WANT TO WIPE ALL BINDINGS!!!!!
|
||||||
|
@ -254,6 +254,7 @@ struct _E_Config
|
||||||
|
|
||||||
int border_raise_on_mouse_action; // GUI
|
int border_raise_on_mouse_action; // GUI
|
||||||
int border_raise_on_focus; // GUI
|
int border_raise_on_focus; // GUI
|
||||||
|
int raise_on_revert_focus; // GUI
|
||||||
int desk_flip_wrap; // GUI
|
int desk_flip_wrap; // GUI
|
||||||
int fullscreen_flip; // GUI
|
int fullscreen_flip; // GUI
|
||||||
int multiscreen_flip; // GUI
|
int multiscreen_flip; // GUI
|
||||||
|
|
|
@ -401,6 +401,8 @@ e_desk_last_focused_focus(E_Desk *desk)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
e_client_focus_set_with_pointer(ec);
|
e_client_focus_set_with_pointer(ec);
|
||||||
|
if (e_config->raise_on_revert_focus)
|
||||||
|
evas_object_raise(ec->frame);
|
||||||
return ec;
|
return ec;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -408,6 +410,8 @@ e_desk_last_focused_focus(E_Desk *desk)
|
||||||
if (ecs)
|
if (ecs)
|
||||||
{
|
{
|
||||||
e_client_focus_set_with_pointer(ecs);
|
e_client_focus_set_with_pointer(ecs);
|
||||||
|
if (e_config->raise_on_revert_focus)
|
||||||
|
evas_object_raise(ecs->frame);
|
||||||
return ecs;
|
return ecs;
|
||||||
}
|
}
|
||||||
if (e_client_focused_get())
|
if (e_client_focused_get())
|
||||||
|
@ -699,6 +703,8 @@ e_desk_flip_end(E_Desk *desk)
|
||||||
if (!e_client_util_desk_visible(ec, desk)) continue;
|
if (!e_client_util_desk_visible(ec, desk)) continue;
|
||||||
if (ec->iconic) continue;
|
if (ec->iconic) continue;
|
||||||
evas_object_focus_set(ec->frame, 1);
|
evas_object_focus_set(ec->frame, 1);
|
||||||
|
if (e_config->raise_on_revert_focus)
|
||||||
|
evas_object_raise(ec->frame);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ struct _E_Config_Dialog_Data
|
||||||
double pointer_warp_speed;
|
double pointer_warp_speed;
|
||||||
double auto_raise_delay;
|
double auto_raise_delay;
|
||||||
int border_raise_on_mouse_action;
|
int border_raise_on_mouse_action;
|
||||||
|
int raise_on_revert_focus;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* a nice easy setup function that does the dirty work */
|
/* a nice easy setup function that does the dirty work */
|
||||||
|
@ -84,6 +85,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
||||||
cfdata->auto_raise_delay = e_config->auto_raise_delay;
|
cfdata->auto_raise_delay = e_config->auto_raise_delay;
|
||||||
cfdata->border_raise_on_mouse_action =
|
cfdata->border_raise_on_mouse_action =
|
||||||
e_config->border_raise_on_mouse_action;
|
e_config->border_raise_on_mouse_action;
|
||||||
|
cfdata->raise_on_revert_focus = e_config->raise_on_revert_focus;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
|
@ -186,6 +188,7 @@ _advanced_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
||||||
e_config->use_auto_raise = cfdata->use_auto_raise;
|
e_config->use_auto_raise = cfdata->use_auto_raise;
|
||||||
e_config->auto_raise_delay = cfdata->auto_raise_delay;
|
e_config->auto_raise_delay = cfdata->auto_raise_delay;
|
||||||
e_config->border_raise_on_mouse_action = cfdata->border_raise_on_mouse_action;
|
e_config->border_raise_on_mouse_action = cfdata->border_raise_on_mouse_action;
|
||||||
|
e_config->raise_on_revert_focus = cfdata->raise_on_revert_focus;
|
||||||
e_comp_button_bindings_grab_all();
|
e_comp_button_bindings_grab_all();
|
||||||
e_config_save_queue();
|
e_config_save_queue();
|
||||||
return 1; /* Apply was OK */
|
return 1; /* Apply was OK */
|
||||||
|
@ -207,7 +210,8 @@ _advanced_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *c
|
||||||
(fabs(e_config->pointer_warp_speed - cfdata->pointer_warp_speed) < DBL_EPSILON) ||
|
(fabs(e_config->pointer_warp_speed - cfdata->pointer_warp_speed) < DBL_EPSILON) ||
|
||||||
(e_config->use_auto_raise != cfdata->use_auto_raise) ||
|
(e_config->use_auto_raise != cfdata->use_auto_raise) ||
|
||||||
(e_config->auto_raise_delay != cfdata->auto_raise_delay) ||
|
(e_config->auto_raise_delay != cfdata->auto_raise_delay) ||
|
||||||
(e_config->border_raise_on_mouse_action != cfdata->border_raise_on_mouse_action);
|
(e_config->border_raise_on_mouse_action != cfdata->border_raise_on_mouse_action) ||
|
||||||
|
(e_config->raise_on_revert_focus != cfdata->raise_on_revert_focus);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**--GUI--**/
|
/**--GUI--**/
|
||||||
|
@ -291,6 +295,9 @@ _advanced_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Da
|
||||||
ob = e_widget_check_add(evas, _("Raise when starting to move or resize"),
|
ob = e_widget_check_add(evas, _("Raise when starting to move or resize"),
|
||||||
&(cfdata->border_raise_on_mouse_action));
|
&(cfdata->border_raise_on_mouse_action));
|
||||||
e_widget_framelist_object_append(of, ob);
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_check_add(evas, _("Raise when reverting focus"),
|
||||||
|
&(cfdata->raise_on_revert_focus));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
e_widget_list_object_append(ol, of, 1, 0, 0.5);
|
e_widget_list_object_append(ol, of, 1, 0, 0.5);
|
||||||
e_widget_toolbook_page_append(otb, NULL, _("Stacking"), ol,
|
e_widget_toolbook_page_append(otb, NULL, _("Stacking"), ol,
|
||||||
1, 0, 1, 0, 0.5, 0.0);
|
1, 0, 1, 0, 0.5, 0.0);
|
||||||
|
|
|
@ -55,6 +55,7 @@ wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
|
||||||
e_config->pass_click_on = 1;
|
e_config->pass_click_on = 1;
|
||||||
e_config->always_click_to_raise = 1;
|
e_config->always_click_to_raise = 1;
|
||||||
e_config->always_click_to_focus = 1;
|
e_config->always_click_to_focus = 1;
|
||||||
|
e_config->raise_on_revert_focus = 1;
|
||||||
e_config->focus_last_focused_per_desktop = 1;
|
e_config->focus_last_focused_per_desktop = 1;
|
||||||
e_config->pointer_slide = 0;
|
e_config->pointer_slide = 0;
|
||||||
e_config->disable_all_pointer_warps = 1;
|
e_config->disable_all_pointer_warps = 1;
|
||||||
|
|
Loading…
Reference in New Issue