fix old FIXME regarding handling of NET_ACTIVE_WINDOW hint: new window focus option allows ignoring, animating, activating (current behavior is activating) on hint

right now this uses the "urgent" signal for the animate state, may want to change it to something else if separate theming is desired
ticket #1642


SVN revision: 78647
This commit is contained in:
Mike Blumenkrantz 2012-10-30 11:57:35 +00:00
parent aa7f3281cc
commit 3fc68c6c43
5 changed files with 50 additions and 21 deletions

View File

@ -42,6 +42,13 @@ typedef enum _E_Focus_Policy
E_FOCUS_SLOPPY
} E_Focus_Policy;
typedef enum _E_Urgency_Policy
{
E_ACTIVEHINT_POLICY_IGNORE,
E_ACTIVEHINT_POLICY_ANIMATE,
E_ACTIVEHINT_POLICY_ACTIVATE
} E_Urgency_Policy;
typedef enum _E_Focus_Setting
{
E_FOCUS_NONE,

View File

@ -684,6 +684,7 @@ e_config_init(void)
E_CONFIG_VAL(D, T, focus_policy, INT); /**/
E_CONFIG_VAL(D, T, focus_setting, INT); /**/
E_CONFIG_VAL(D, T, pass_click_on, INT); /**/
E_CONFIG_VAL(D, T, window_activehint_policy, INT); /**/
E_CONFIG_VAL(D, T, always_click_to_raise, INT); /**/
E_CONFIG_VAL(D, T, always_click_to_focus, INT); /**/
E_CONFIG_VAL(D, T, use_auto_raise, INT); /**/
@ -1255,6 +1256,10 @@ e_config_load(void)
e_config->xkb.desklock_layout = NULL;
IFCFGEND;
IFCFG(0x0160);
e_config->window_activehint_policy = 2;
IFCFGEND;
e_config->config_version = E_CONFIG_FILE_VERSION;
_e_config_free(tcfg);
}
@ -1283,6 +1288,7 @@ e_config_load(void)
E_CONFIG_LIMIT(e_config->focus_policy, 0, 2);
E_CONFIG_LIMIT(e_config->focus_setting, 0, 3);
E_CONFIG_LIMIT(e_config->pass_click_on, 0, 1);
E_CONFIG_LIMIT(e_config->window_activehint_policy, 0, 2);
E_CONFIG_LIMIT(e_config->always_click_to_raise, 0, 1);
E_CONFIG_LIMIT(e_config->always_click_to_focus, 0, 1);
E_CONFIG_LIMIT(e_config->use_auto_raise, 0, 1);

View File

@ -37,7 +37,7 @@ typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme;
/* 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
*/
#define E_CONFIG_FILE_GENERATION 0x0159
#define E_CONFIG_FILE_GENERATION 0x0160
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
struct _E_Config
@ -94,6 +94,7 @@ struct _E_Config
int focus_policy; // GUI
int focus_setting; // GUI
int pass_click_on; // GUI
int window_activehint_policy; // GUI
int always_click_to_raise; // GUI
int always_click_to_focus; // GUI
int use_auto_raise; // GUI

View File

@ -971,28 +971,25 @@ _e_manager_cb_client_message(void *data __UNUSED__, int ev_type __UNUSED__, void
e = ev;
if (e->message_type == ECORE_X_ATOM_NET_ACTIVE_WINDOW)
{
bd = e_border_find_by_client_window(e->win);
if (bd)
{
if (e->message_type != ECORE_X_ATOM_NET_ACTIVE_WINDOW) return ECORE_CALLBACK_RENEW;
bd = e_border_find_by_client_window(e->win);
if (!bd) return ECORE_CALLBACK_RENEW;
#if 0 /* notes */
if (e->data.l[0] == 0 /* 0 == old, 1 == client, 2 == pager */)
{
// FIXME: need config for the below - what to do given each
// request (either do nothng, make app look urgent/want
// attention or actiually flip to app as below is the
// current default)
// if 0 == just make app demand attention somehow
// if 1 == just make app demand attention somehow
// if 2 == activate window as below
}
timestamp = e->data.l[1];
requestor_id e->data.l[2];
if (e->data.l[0] == 0 /* 0 == old, 1 == client, 2 == pager */)
{
}
timestamp = e->data.l[1];
requestor_id e->data.l[2];
#endif
if (!bd->focused) e_border_activate(bd, EINA_FALSE);
else e_border_raise(bd);
}
switch (e_config->window_activehint_policy)
{
case 0: break;
case 1:
edje_object_signal_emit(bd->bg_object, "e,state,urgent", "e");
break;
default:
if (!bd->focused) e_border_activate(bd, EINA_FALSE);
else e_border_raise(bd);
}
return ECORE_CALLBACK_PASS_ON;

View File

@ -22,6 +22,7 @@ struct _E_Config_Dialog_Data
int focus_policy;
int focus_setting;
int pass_click_on;
int window_activehint_policy;
int always_click_to_raise;
int always_click_to_focus;
int focus_last_focused_per_desktop;
@ -68,6 +69,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->focus_policy = e_config->focus_policy;
cfdata->focus_setting = e_config->focus_setting;
cfdata->pass_click_on = e_config->pass_click_on;
cfdata->window_activehint_policy = e_config->window_activehint_policy;
cfdata->always_click_to_raise = e_config->always_click_to_raise;
cfdata->always_click_to_focus = e_config->always_click_to_focus;
cfdata->focus_last_focused_per_desktop =
@ -119,6 +121,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
e_config->focus_policy = E_FOCUS_CLICK;
e_config->focus_setting = E_FOCUS_NEW_WINDOW;
e_config->pass_click_on = 1;
e_config->window_activehint_policy = 2;
e_config->always_click_to_raise = 0;
e_config->always_click_to_focus = 0;
e_config->focus_last_focused_per_desktop = 1;
@ -130,6 +133,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
e_config->focus_policy = E_FOCUS_MOUSE;
e_config->focus_setting = E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED;
e_config->pass_click_on = 1;
e_config->window_activehint_policy = 2;
e_config->always_click_to_raise = 0;
e_config->always_click_to_focus = 0;
e_config->focus_last_focused_per_desktop = 0;
@ -141,6 +145,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
e_config->focus_policy = E_FOCUS_SLOPPY;
e_config->focus_setting = E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED;
e_config->pass_click_on = 1;
e_config->window_activehint_policy = 2;
e_config->always_click_to_raise = 0;
e_config->always_click_to_focus = 0;
e_config->focus_last_focused_per_desktop = 1;
@ -168,6 +173,7 @@ _advanced_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
e_config->focus_policy = cfdata->focus_policy;
e_config->focus_setting = cfdata->focus_setting;
e_config->pass_click_on = cfdata->pass_click_on;
e_config->window_activehint_policy = cfdata->window_activehint_policy;
e_config->always_click_to_raise = cfdata->always_click_to_raise;
e_config->always_click_to_focus = cfdata->always_click_to_focus;
e_config->focus_last_focused_per_desktop =
@ -192,6 +198,7 @@ _advanced_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *c
return ((e_config->focus_policy != cfdata->focus_policy) ||
(e_config->focus_setting != cfdata->focus_setting) ||
(e_config->pass_click_on != cfdata->pass_click_on) ||
(e_config->window_activehint_policy != cfdata->window_activehint_policy) ||
(e_config->always_click_to_raise != cfdata->always_click_to_raise) ||
(e_config->always_click_to_focus != cfdata->always_click_to_focus) ||
(e_config->focus_last_focused_per_desktop != cfdata->focus_last_focused_per_desktop) ||
@ -298,6 +305,17 @@ _advanced_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Da
e_widget_toolbook_page_append(otb, NULL, _("Stacking"), ol,
1, 0, 1, 0, 0.5, 0.0);
/* Urgency */
of = e_widget_framelist_add(evas, _("Active Window Hint Policy"), 0);
rg = e_widget_radio_group_new(&cfdata->window_activehint_policy);
ob = e_widget_radio_add(evas, _("Ignore hint"), E_ACTIVEHINT_POLICY_IGNORE, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Animate on hint"), E_ACTIVEHINT_POLICY_ANIMATE, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Activate on hint"), E_ACTIVEHINT_POLICY_ACTIVATE, rg);
e_widget_framelist_object_append(of, ob);
e_widget_toolbook_page_append(otb, NULL, _("Hints"), of,
1, 0, 1, 0, 0.5, 0.0);
/* Misc */
ol = e_widget_list_add(evas, 0, 0);
of = e_widget_framelist_add(evas, _("Other Settings"), 0);