add config option for allowing sticky windows to receive focus reverts

since forever, sticky windows have not been allowed to receive focus after
various events, eg. desk flip or window close. in some workflows, however,
this may actually be desired behavior

disabled by default

fix T2837
devs/stanluk/a11y
Mike Blumenkrantz 7 years ago
parent 36644518a4
commit a08ac02e82
  1. 2
      src/bin/e_client.c
  2. 2
      src/bin/e_config.c
  3. 1
      src/bin/e_config.h
  4. 2
      src/bin/e_desk.c
  5. 9
      src/modules/conf_window_manipulation/e_int_config_focus.c

@ -3579,7 +3579,7 @@ e_client_activate(E_Client *ec, Eina_Bool just_do_it)
if (!ec->lock_user_iconify)
e_client_uniconify(ec);
}
if ((!ec->iconic) && (!ec->sticky))
if ((!ec->iconic) && ((!ec->sticky) || e_config->focus_revert_allow_sticky))
{
int val = e_config->focus_last_focused_per_desktop;

@ -525,6 +525,7 @@ _e_config_edd_init(Eina_Bool old)
E_CONFIG_VAL(D, T, resize_info_visible, INT); /**/
E_CONFIG_VAL(D, T, focus_last_focused_per_desktop, INT); /**/
E_CONFIG_VAL(D, T, focus_revert_on_hide_or_close, INT); /**/
E_CONFIG_VAL(D, T, focus_revert_allow_sticky, INT); /**/
E_CONFIG_VAL(D, T, pointer_slide, INT); /**/
E_CONFIG_VAL(D, T, disable_all_pointer_warps, INT); /**/
E_CONFIG_VAL(D, T, pointer_warp_speed, DOUBLE); /**/
@ -1410,6 +1411,7 @@ e_config_load(void)
E_CONFIG_LIMIT(e_config->resize_info_visible, 0, 1);
E_CONFIG_LIMIT(e_config->focus_last_focused_per_desktop, 0, 1);
E_CONFIG_LIMIT(e_config->focus_revert_on_hide_or_close, 0, 1);
E_CONFIG_LIMIT(e_config->focus_revert_allow_sticky, 0, 1);
E_CONFIG_LIMIT(e_config->pointer_slide, 0, 1);
E_CONFIG_LIMIT(e_config->disable_all_pointer_warps, 0, 1);
E_CONFIG_LIMIT(e_config->pointer_warp_speed, 0.0, 1.0);

@ -161,6 +161,7 @@ struct _E_Config
int resize_info_visible; // GUI
int focus_last_focused_per_desktop; // GUI
int focus_revert_on_hide_or_close; // GUI
int focus_revert_allow_sticky; // GUI
int disable_all_pointer_warps; // GUI
int pointer_slide; // GUI
double pointer_warp_speed; // GUI

@ -377,7 +377,7 @@ e_desk_last_focused_focus(E_Desk *desk)
/* this was the window last focused in this desktop */
if (!ec->lock_focus_out)
{
if (ec->sticky)
if (ec->sticky && (!e_config->focus_revert_allow_sticky))
{
ecs = ec;
continue;

@ -26,6 +26,7 @@ struct _E_Config_Dialog_Data
int always_click_to_focus;
int focus_last_focused_per_desktop;
int focus_revert_on_hide_or_close;
int focus_revert_allow_sticky;
int pointer_slide;
int disable_all_pointer_warps;
double pointer_warp_speed;
@ -75,6 +76,8 @@ _fill_data(E_Config_Dialog_Data *cfdata)
e_config->focus_last_focused_per_desktop;
cfdata->focus_revert_on_hide_or_close =
e_config->focus_revert_on_hide_or_close;
cfdata->focus_revert_allow_sticky =
e_config->focus_revert_allow_sticky;
cfdata->pointer_slide = e_config->pointer_slide;
cfdata->disable_all_pointer_warps = e_config->disable_all_pointer_warps;
cfdata->pointer_warp_speed = e_config->pointer_warp_speed;
@ -181,6 +184,8 @@ _advanced_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
cfdata->focus_last_focused_per_desktop;
e_config->focus_revert_on_hide_or_close =
cfdata->focus_revert_on_hide_or_close;
e_config->focus_revert_allow_sticky =
cfdata->focus_revert_allow_sticky;
e_config->pointer_slide = cfdata->pointer_slide;
e_config->disable_all_pointer_warps = cfdata->disable_all_pointer_warps;
e_config->pointer_warp_speed = cfdata->pointer_warp_speed;
@ -205,6 +210,7 @@ _advanced_check_changed(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *
(e_config->always_click_to_focus != cfdata->always_click_to_focus) ||
(e_config->focus_last_focused_per_desktop != cfdata->focus_last_focused_per_desktop) ||
(e_config->focus_revert_on_hide_or_close != cfdata->focus_revert_on_hide_or_close) ||
(e_config->focus_revert_allow_sticky != cfdata->focus_revert_allow_sticky) ||
(e_config->pointer_slide != cfdata->pointer_slide) ||
(e_config->disable_all_pointer_warps != cfdata->disable_all_pointer_warps) ||
(fabs(e_config->pointer_warp_speed - cfdata->pointer_warp_speed) > DBL_EPSILON) ||
@ -361,6 +367,9 @@ _advanced_create(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dialog_D
ob = e_widget_check_add(evas, _("Refocus last window on desktop switch"),
&(cfdata->focus_last_focused_per_desktop));
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Allow focusing of sticky windows when reverting focus"),
&(cfdata->focus_revert_allow_sticky));
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Focus last focused window on lost focus"),
&(cfdata->focus_revert_on_hide_or_close));
e_widget_framelist_object_append(of, ob);

Loading…
Cancel
Save