forked from enlightenment/enlightenment
parent
18d40fac35
commit
45a7d1f244
3
TODO
3
TODO
|
@ -55,6 +55,9 @@ Also look at all the .c files - they have their own localized TODO lists
|
|||
|
||||
These are in no particular order:
|
||||
|
||||
* for click to focus - grab the mouse on all new windows, ungrab on focus, grab again on unfocus
|
||||
* move all ipc codecs to use eet
|
||||
* make raise_timer a on/off flag and add a double for delay
|
||||
* on restart e always goes back to desktop 0,0 - it shoudl go to the desktop
|
||||
it was last on (per zone, per container, per manager).
|
||||
* start module needs to have an way to alert users to "click here" and back
|
||||
|
|
|
@ -1399,6 +1399,11 @@ _e_border_free(E_Border *bd)
|
|||
if (move == bd)
|
||||
_e_border_move_end(bd);
|
||||
|
||||
if (bd->raise_timer)
|
||||
{
|
||||
ecore_timer_del(bd->raise_timer);
|
||||
bd->raise_timer = NULL;
|
||||
}
|
||||
while (bd->pending_move_resize)
|
||||
{
|
||||
free(bd->pending_move_resize->data);
|
||||
|
@ -2329,7 +2334,9 @@ _e_border_cb_mouse_in(void *data, int type, void *event)
|
|||
{
|
||||
/* FIXME: this would normally put focus on the client on pointer */
|
||||
/* focus - but click to focus it wouldnt */
|
||||
e_border_focus_set(bd, 1, 1);
|
||||
e_focus_event_mouse_in(bd);
|
||||
// e_border_focus_set(bd, 1, 1);
|
||||
// e_border_raise(bd);
|
||||
}
|
||||
if (ev->win != bd->event_win) return 1;
|
||||
bd->mouse.current.mx = ev->root.x;
|
||||
|
@ -2395,7 +2402,8 @@ _e_border_cb_mouse_out(void *data, int type, void *event)
|
|||
if ((ev->mode == ECORE_X_EVENT_MODE_NORMAL) &&
|
||||
(ev->detail == ECORE_X_EVENT_DETAIL_INFERIOR))
|
||||
return 1;
|
||||
e_border_focus_set(bd, 0, 1);
|
||||
e_focus_event_mouse_out(bd);
|
||||
//e_border_focus_set(bd, 0, 1);
|
||||
}
|
||||
if (ev->win != bd->event_win) return 1;
|
||||
bd->mouse.current.mx = ev->root.x;
|
||||
|
@ -2415,22 +2423,25 @@ _e_border_cb_mouse_down(void *data, int type, void *event)
|
|||
bd = data;
|
||||
if (ev->event_win == bd->win)
|
||||
{
|
||||
if ((ev->button >= 1) && (ev->button <= 3))
|
||||
if(!e_focus_event_mouse_down(bd))
|
||||
{
|
||||
bd->mouse.last_down[ev->button - 1].mx = ev->root.x;
|
||||
bd->mouse.last_down[ev->button - 1].my = ev->root.y;
|
||||
bd->mouse.last_down[ev->button - 1].x = bd->x;
|
||||
bd->mouse.last_down[ev->button - 1].y = bd->y;
|
||||
bd->mouse.last_down[ev->button - 1].w = bd->w;
|
||||
bd->mouse.last_down[ev->button - 1].h = bd->h;
|
||||
}
|
||||
bd->mouse.current.mx = ev->root.x;
|
||||
bd->mouse.current.my = ev->root.y;
|
||||
if (!bd->cur_mouse_action)
|
||||
{
|
||||
bd->cur_mouse_action =
|
||||
e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_BORDER,
|
||||
E_OBJECT(bd), ev);
|
||||
if ((ev->button >= 1) && (ev->button <= 3))
|
||||
{
|
||||
bd->mouse.last_down[ev->button - 1].mx = ev->root.x;
|
||||
bd->mouse.last_down[ev->button - 1].my = ev->root.y;
|
||||
bd->mouse.last_down[ev->button - 1].x = bd->x;
|
||||
bd->mouse.last_down[ev->button - 1].y = bd->y;
|
||||
bd->mouse.last_down[ev->button - 1].w = bd->w;
|
||||
bd->mouse.last_down[ev->button - 1].h = bd->h;
|
||||
}
|
||||
bd->mouse.current.mx = ev->root.x;
|
||||
bd->mouse.current.my = ev->root.y;
|
||||
if (!bd->cur_mouse_action)
|
||||
{
|
||||
bd->cur_mouse_action =
|
||||
e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_BORDER,
|
||||
E_OBJECT(bd), ev);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ev->win != bd->event_win) return 1;
|
||||
|
@ -2473,29 +2484,32 @@ _e_border_cb_mouse_up(void *data, int type, void *event)
|
|||
bd = data;
|
||||
if (ev->event_win == bd->win)
|
||||
{
|
||||
if ((ev->button >= 1) && (ev->button <= 3))
|
||||
if(!e_focus_event_mouse_up(bd))
|
||||
{
|
||||
bd->mouse.last_up[ev->button - 1].mx = ev->root.x;
|
||||
bd->mouse.last_up[ev->button - 1].my = ev->root.y;
|
||||
bd->mouse.last_up[ev->button - 1].x = bd->x;
|
||||
bd->mouse.last_up[ev->button - 1].y = bd->y;
|
||||
if ((ev->button >= 1) && (ev->button <= 3))
|
||||
{
|
||||
bd->mouse.last_up[ev->button - 1].mx = ev->root.x;
|
||||
bd->mouse.last_up[ev->button - 1].my = ev->root.y;
|
||||
bd->mouse.last_up[ev->button - 1].x = bd->x;
|
||||
bd->mouse.last_up[ev->button - 1].y = bd->y;
|
||||
}
|
||||
bd->mouse.current.mx = ev->root.x;
|
||||
bd->mouse.current.my = ev->root.y;
|
||||
/* bug/problem. this action COULD be deleted during a move */
|
||||
/* ... VERY unlikely though... VERY */
|
||||
/* also we dont pass the same params that went in - then again that */
|
||||
/* should be ok as we are just ending the action if it has an end */
|
||||
if (bd->cur_mouse_action)
|
||||
{
|
||||
if (bd->cur_mouse_action->func.end_mouse)
|
||||
bd->cur_mouse_action->func.end_mouse(E_OBJECT(bd), "", ev);
|
||||
else if (bd->cur_mouse_action->func.end)
|
||||
bd->cur_mouse_action->func.end(E_OBJECT(bd), "");
|
||||
bd->cur_mouse_action = NULL;
|
||||
}
|
||||
else
|
||||
e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_BORDER, E_OBJECT(bd), ev);
|
||||
}
|
||||
bd->mouse.current.mx = ev->root.x;
|
||||
bd->mouse.current.my = ev->root.y;
|
||||
/* bug/problem. this action COULD be deleted during a move */
|
||||
/* ... VERY unlikely though... VERY */
|
||||
/* also we dont pass the same params that went in - then again that */
|
||||
/* should be ok as we are just ending the action if it has an end */
|
||||
if (bd->cur_mouse_action)
|
||||
{
|
||||
if (bd->cur_mouse_action->func.end_mouse)
|
||||
bd->cur_mouse_action->func.end_mouse(E_OBJECT(bd), "", ev);
|
||||
else if (bd->cur_mouse_action->func.end)
|
||||
bd->cur_mouse_action->func.end(E_OBJECT(bd), "");
|
||||
bd->cur_mouse_action = NULL;
|
||||
}
|
||||
else
|
||||
e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_BORDER, E_OBJECT(bd), ev);
|
||||
}
|
||||
if (ev->win != bd->event_win) return 1;
|
||||
if ((ev->button >= 1) && (ev->button <= 3))
|
||||
|
|
|
@ -26,6 +26,13 @@ typedef enum _E_Stacking
|
|||
E_STACKING_BELOW
|
||||
} E_Stacking;
|
||||
|
||||
typedef enum _E_Focus_Policy
|
||||
{
|
||||
E_FOCUS_FOLLOW_MOUSE = 1 << 0,
|
||||
E_FOCUS_AUTORAISE = 1 << 1
|
||||
} E_Focus_Policy;
|
||||
|
||||
|
||||
typedef struct _E_Border E_Border;
|
||||
typedef struct _E_Border_Pending_Move_Resize E_Border_Pending_Move_Resize;
|
||||
typedef struct _E_Event_Border_Resize E_Event_Border_Resize;
|
||||
|
@ -229,6 +236,7 @@ struct _E_Border
|
|||
|
||||
unsigned int layer;
|
||||
E_Action *cur_mouse_action;
|
||||
Ecore_Timer *raise_timer;
|
||||
};
|
||||
|
||||
struct _E_Border_Pending_Move_Resize
|
||||
|
|
|
@ -200,6 +200,8 @@ e_config_init(void)
|
|||
e_config->evas_engine_popups = E_EVAS_ENGINE_DEFAULT;
|
||||
e_config->evas_engine_drag = E_EVAS_ENGINE_DEFAULT;
|
||||
e_config->language = strdup("");
|
||||
e_config->focus_policy = E_FOCUS_FOLLOW_MOUSE;
|
||||
e_config->raise_timer = 0;
|
||||
{
|
||||
E_Config_Module *em;
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ typedef struct _E_Config_Module E_Config_Module;
|
|||
typedef struct _E_Config_Theme E_Config_Theme;
|
||||
typedef struct _E_Config_Binding_Mouse E_Config_Binding_Mouse;
|
||||
typedef struct _E_Config_Binding_Key E_Config_Binding_Key;
|
||||
typedef struct _E_Config_Focus_Policy E_Config_Focus_Policy;
|
||||
typedef Eet_Data_Descriptor E_Config_DD;
|
||||
|
||||
#else
|
||||
|
@ -93,7 +94,9 @@ struct _E_Config
|
|||
Evas_List *path_append_icons;
|
||||
Evas_List *path_append_modules;
|
||||
Evas_List *path_append_backgrounds;
|
||||
|
||||
E_Focus_Policy focus_policy;
|
||||
int raise_timer;
|
||||
|
||||
};
|
||||
|
||||
struct _E_Config_Module
|
||||
|
@ -128,6 +131,14 @@ struct _E_Config_Binding_Key
|
|||
unsigned char any_mod;
|
||||
};
|
||||
|
||||
struct _E_Config_Focus_Policy
|
||||
{
|
||||
E_Focus_Policy focus_policy;
|
||||
int raise_timer;
|
||||
};
|
||||
|
||||
|
||||
|
||||
EAPI int e_config_init(void);
|
||||
EAPI int e_config_shutdown(void);
|
||||
|
||||
|
|
|
@ -6,10 +6,13 @@
|
|||
/* local subsystem functions */
|
||||
static int _e_focus_cb_window_focus_in(void *data, int ev_type, void *ev);
|
||||
static int _e_focus_cb_window_focus_out(void *data, int ev_type, void *ev);
|
||||
static int _e_focus_cb_mouse_button_down(void *data, int ev_type, void *ev);
|
||||
static int _e_focus_raise_timer(void* data);
|
||||
|
||||
/* local subsystem globals */
|
||||
static Ecore_Event_Handler *_e_focus_focus_in_handler = NULL;
|
||||
static Ecore_Event_Handler *_e_focus_focus_out_handler = NULL;
|
||||
static Ecore_Event_Handler *_e_focus_mouse_down_handler = NULL;
|
||||
|
||||
/* externally accessible functions */
|
||||
int
|
||||
|
@ -17,6 +20,10 @@ e_focus_init(void)
|
|||
{
|
||||
_e_focus_focus_in_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_IN, _e_focus_cb_window_focus_in, NULL);
|
||||
_e_focus_focus_out_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, _e_focus_cb_window_focus_out, NULL);
|
||||
// _e_focus_mouse_down_handler = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_DOWN,
|
||||
// _e_focus_cb_mouse_button_down, NULL);
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -25,6 +32,7 @@ e_focus_shutdown(void)
|
|||
{
|
||||
E_FN_DEL(ecore_event_handler_del, _e_focus_focus_in_handler);
|
||||
E_FN_DEL(ecore_event_handler_del, _e_focus_focus_out_handler);
|
||||
E_FN_DEL(ecore_event_handler_del, _e_focus_mouse_down_handler);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -34,6 +42,56 @@ e_focus_idler_before(void)
|
|||
return;
|
||||
}
|
||||
|
||||
int
|
||||
e_focus_event_mouse_in(E_Border* bd)
|
||||
{
|
||||
/* If focus follows mouse */
|
||||
if( e_config->focus_policy & E_FOCUS_FOLLOW_MOUSE)
|
||||
e_border_focus_set(bd, 1, 1);
|
||||
|
||||
bd->raise_timer = NULL;
|
||||
if (e_config->focus_policy & E_FOCUS_AUTORAISE)
|
||||
{
|
||||
if (e_config->raise_timer == 0)
|
||||
e_border_raise(bd);
|
||||
else
|
||||
bd->raise_timer = ecore_timer_add((double)e_config->raise_timer / 10.0,
|
||||
_e_focus_raise_timer, bd);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
e_focus_event_mouse_out(E_Border* bd)
|
||||
{
|
||||
/* If focus follows mouse */
|
||||
if (e_config->focus_policy & E_FOCUS_FOLLOW_MOUSE)
|
||||
e_border_focus_set(bd, 0, 1);
|
||||
|
||||
if (bd->raise_timer != NULL)
|
||||
{
|
||||
ecore_timer_del(bd->raise_timer);
|
||||
bd->raise_timer = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
e_focus_event_mouse_down(E_Border* bd)
|
||||
{
|
||||
if (!(e_config->focus_policy & E_FOCUS_FOLLOW_MOUSE))
|
||||
{
|
||||
e_border_focus_set(bd, 1, 1);
|
||||
e_border_raise(bd);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
e_focus_event_mouse_up(E_Border* bd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* local subsystem functions */
|
||||
|
@ -120,3 +178,44 @@ _e_focus_cb_window_focus_out(void *data, int ev_type, void *ev)
|
|||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
_e_focus_cb_mouse_button_down(void *data, int ev_type, void *ev)
|
||||
{
|
||||
Ecore_X_Event_Mouse_Button_Down* e;
|
||||
E_Border* bd = NULL;
|
||||
|
||||
e = ev;
|
||||
|
||||
fprintf(stderr,"%s, %p\n",__FUNCTION__, e->win);
|
||||
|
||||
bd = e_border_find_by_client_window(e->win);
|
||||
if (!bd)
|
||||
bd = e_border_find_by_window(e->win);
|
||||
if (!bd)
|
||||
bd = e_border_find_by_frame_window(e->win);
|
||||
|
||||
if (!bd)
|
||||
bd = e_border_find_by_client_window(e->event_win);
|
||||
if (!bd)
|
||||
bd = e_border_find_by_window(e->event_win);
|
||||
if (!bd)
|
||||
bd = e_border_find_by_frame_window(e->event_win);
|
||||
|
||||
fprintf(stderr,"bd = %p\n", bd);
|
||||
|
||||
if (bd)
|
||||
e_focus_event_mouse_down(bd);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_e_focus_raise_timer(void* data)
|
||||
{
|
||||
e_border_raise((E_Border*)data);
|
||||
((E_Border*)data)->raise_timer = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,11 @@
|
|||
EAPI int e_focus_init(void);
|
||||
EAPI int e_focus_shutdown(void);
|
||||
EAPI void e_focus_idler_before(void);
|
||||
|
||||
EAPI int e_focus_event_mouse_in(E_Border* bd);
|
||||
EAPI int e_focus_event_mouse_out(E_Border* bd);
|
||||
EAPI int e_focus_event_mouse_down(E_Border* bd);
|
||||
EAPI int e_focus_event_mouse_up(E_Border* bd);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -27,6 +27,8 @@ ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_key_binding_list_enc);
|
|||
ECORE_IPC_ENC_STRUCT_PROTO(_e_ipc_key_binding_enc);
|
||||
ECORE_IPC_DEC_STRUCT_PROTO(_e_ipc_key_binding_dec);
|
||||
ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_path_list_enc);
|
||||
ECORE_IPC_ENC_STRUCT_PROTO(_e_ipc_focus_policy_enc);
|
||||
ECORE_IPC_DEC_STRUCT_PROTO(_e_ipc_focus_policy_dec);
|
||||
|
||||
/* local subsystem globals */
|
||||
static Ecore_Ipc_Server *_e_ipc_server = NULL;
|
||||
|
@ -735,8 +737,37 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|||
e_config->zone_desks_y_count,
|
||||
E_IPC_OP_DESKS_GET_REPLY);
|
||||
break;
|
||||
|
||||
/* Module PATH IPC */
|
||||
case E_IPC_OP_FOCUS_POLICY_SET:
|
||||
{
|
||||
E_Config_Focus_Policy policy;
|
||||
|
||||
_e_ipc_focus_policy_dec(e->data, e->size, &policy);
|
||||
e_config->focus_policy = policy.focus_policy;
|
||||
e_config->raise_timer = policy.raise_timer;
|
||||
|
||||
}
|
||||
break;
|
||||
case E_IPC_OP_FOCUS_POLICY_GET:
|
||||
{
|
||||
int bytes;
|
||||
E_Config_Focus_Policy policy;
|
||||
char *data;
|
||||
|
||||
policy.focus_policy = e_config->focus_policy;
|
||||
policy.raise_timer = e_config->raise_timer;
|
||||
|
||||
data = _e_ipc_focus_policy_enc(&policy, &bytes);
|
||||
|
||||
ecore_ipc_client_send(e->client,
|
||||
E_IPC_DOMAIN_REPLY,
|
||||
E_IPC_OP_FOCUS_POLICY_GET_REPLY,
|
||||
0, 0, 0,
|
||||
data, bytes);
|
||||
|
||||
free(data);
|
||||
|
||||
}
|
||||
break;
|
||||
case E_IPC_OP_MODULE_DIRS_LIST:
|
||||
{
|
||||
Evas_List *dir_list;
|
||||
|
@ -1488,3 +1519,22 @@ ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_path_list_enc)
|
|||
ECORE_IPC_PUTS(dir, l1);
|
||||
ECORE_IPC_ENC_EVAS_LIST_FOOT();
|
||||
}
|
||||
|
||||
ECORE_IPC_ENC_STRUCT_PROTO(_e_ipc_focus_policy_enc)
|
||||
{
|
||||
ECORE_IPC_ENC_STRUCT_HEAD(E_Config_Focus_Policy,
|
||||
1 + 4);
|
||||
ECORE_IPC_PUT8(focus_policy);
|
||||
ECORE_IPC_PUT32(raise_timer);
|
||||
ECORE_IPC_ENC_STRUCT_FOOT();
|
||||
}
|
||||
|
||||
ECORE_IPC_DEC_STRUCT_PROTO(_e_ipc_focus_policy_dec)
|
||||
{
|
||||
ECORE_IPC_DEC_STRUCT_HEAD_MIN(E_Config_Focus_Policy,
|
||||
1 + 4);
|
||||
ECORE_IPC_CHEKS();
|
||||
ECORE_IPC_GET8(focus_policy);
|
||||
ECORE_IPC_GET32(raise_timer);
|
||||
ECORE_IPC_DEC_STRUCT_FOOT();
|
||||
}
|
||||
|
|
|
@ -149,6 +149,11 @@ typedef enum _E_Ipc_Op
|
|||
E_IPC_OP_DESKS_SET,
|
||||
E_IPC_OP_DESKS_GET,
|
||||
E_IPC_OP_DESKS_GET_REPLY,
|
||||
|
||||
E_IPC_OP_FOCUS_POLICY_SET,
|
||||
E_IPC_OP_FOCUS_POLICY_GET,
|
||||
E_IPC_OP_FOCUS_POLICY_GET_REPLY,
|
||||
|
||||
E_IPC_OP_LAST
|
||||
/* FIXME: add ipc: */
|
||||
/* get list of actions */
|
||||
|
|
|
@ -43,6 +43,8 @@ ECORE_IPC_DEC_EVAS_LIST_PROTO(_e_ipc_key_binding_list_dec);
|
|||
ECORE_IPC_ENC_STRUCT_PROTO(_e_ipc_key_binding_enc);
|
||||
ECORE_IPC_DEC_STRUCT_PROTO(_e_ipc_key_binding_dec);
|
||||
ECORE_IPC_DEC_EVAS_LIST_PROTO(_e_ipc_path_list_dec);
|
||||
ECORE_IPC_ENC_STRUCT_PROTO(_e_ipc_focus_policy_enc);
|
||||
ECORE_IPC_DEC_STRUCT_PROTO(_e_ipc_focus_policy_dec);
|
||||
|
||||
/* local subsystem globals */
|
||||
static Ecore_Ipc_Server *_e_ipc_server = NULL;
|
||||
|
@ -240,6 +242,82 @@ _e_opt_binding_key_del(char **params)
|
|||
free(data);
|
||||
}
|
||||
|
||||
static void _e_opt_focus_policy_parse(E_Config_Focus_Policy* policy, char **params)
|
||||
{
|
||||
/* M1[|M2...] */
|
||||
{
|
||||
char *p, *pp;
|
||||
|
||||
policy->focus_policy = 0;
|
||||
pp = params[0];
|
||||
for (;;)
|
||||
{
|
||||
p = strchr(pp, '|');
|
||||
if (p)
|
||||
{
|
||||
if (!strncmp(pp, "FOLLOW|", 7))
|
||||
policy->focus_policy |= E_FOCUS_FOLLOW_MOUSE;
|
||||
else if (!strncmp(pp, "CLICK|", 6))
|
||||
policy->focus_policy &=
|
||||
~(E_FOCUS_FOLLOW_MOUSE | E_FOCUS_AUTORAISE);
|
||||
else if (!strncmp(pp, "AUTORAISE|", 10))
|
||||
policy->focus_policy |= E_FOCUS_AUTORAISE;
|
||||
else if (strlen(pp) > 0)
|
||||
{
|
||||
printf("OPT1 option. Must be or mask of:\n"
|
||||
" FOLLOW CLICK AUTORAISE\n");
|
||||
exit(-1);
|
||||
}
|
||||
pp = p + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!strcmp(pp, "FOLLOW"))
|
||||
policy->focus_policy |= E_FOCUS_FOLLOW_MOUSE;
|
||||
else if (!strcmp(pp, "CLICK"))
|
||||
policy->focus_policy &=
|
||||
~(E_FOCUS_FOLLOW_MOUSE | E_FOCUS_AUTORAISE);
|
||||
else if (!strcmp(pp, "AUTORAISE"))
|
||||
policy->focus_policy |= E_FOCUS_AUTORAISE;
|
||||
else if (strlen(pp) > 0)
|
||||
{
|
||||
printf("OPT1 option. Must be or mask of:\n"
|
||||
" FOLLOW CLICK AUTORAISE\n");
|
||||
exit(-1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(params[1][0] != 0)
|
||||
policy->raise_timer = atoi(params[1]);
|
||||
else if(policy->focus_policy & E_FOCUS_AUTORAISE)
|
||||
{
|
||||
printf("OPT2 option is should be seted, if you use AUTORAISE.\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
_e_opt_focus_policy_set(char** params)
|
||||
{
|
||||
E_Config_Focus_Policy policy;
|
||||
int bytes;
|
||||
char *data;
|
||||
|
||||
_e_opt_focus_policy_parse(&policy, params);
|
||||
data = _e_ipc_focus_policy_enc(&policy, &bytes);
|
||||
ecore_ipc_server_send(_e_ipc_server,
|
||||
E_IPC_DOMAIN_REQUEST,
|
||||
E_IPC_OP_FOCUS_POLICY_SET,
|
||||
0, 0, 0,
|
||||
data, bytes);
|
||||
|
||||
free(data);
|
||||
}
|
||||
|
||||
#define SIMPLE_REQ 0
|
||||
#define SIMPLE_STR_REQ 1
|
||||
#define FULL_FUNC 2
|
||||
|
@ -263,7 +341,7 @@ E_IPC_Opt_Handler handlers[] =
|
|||
OSTR("-module-enable", "Enable module OPT1 if not enabled", E_IPC_OP_MODULE_ENABLE, 0),
|
||||
OSTR("-module-disable", "Disable module OPT1 if not disabled", E_IPC_OP_MODULE_DISABLE, 0),
|
||||
OREQ("-module-list", "List all loaded modules and their states", E_IPC_OP_MODULE_LIST, 1),
|
||||
OSTR("-bg-set", "Set the background edje file to be OPT1", E_IPC_OP_BG_SET, 0),
|
||||
OSTR("-bg-set", "Set the background edje file to be OPT1", E_IPC_OP_BG_SET, 0),
|
||||
OREQ("-bg-get", "Get the background edje file", E_IPC_OP_BG_GET, 1),
|
||||
OSTR("-font-fallback-remove", "Remove OPT1 from the fontset", E_IPC_OP_FONT_FALLBACK_REMOVE, 0),
|
||||
OSTR("-font-fallback-prepend", "Prepend OPT1 to the fontset", E_IPC_OP_FONT_FALLBACK_PREPEND, 0),
|
||||
|
@ -293,19 +371,19 @@ E_IPC_Opt_Handler handlers[] =
|
|||
OSTR("-module-dirs-remove", "Remove OPT1 from the user module path", E_IPC_OP_MODULE_DIRS_REMOVE, 0),
|
||||
OREQ("-data-dirs-list", "List all data directories", E_IPC_OP_DATA_DIRS_LIST, 1),
|
||||
OSTR("-data-dirs-append", "Append OPT1 to the user data path", E_IPC_OP_DATA_DIRS_APPEND, 0),
|
||||
OSTR("-data-dirs-prepend", "Prepend OPT1 to the user data path", E_IPC_OP_DATA_DIRS_PREPEND, 0),
|
||||
OSTR("-data-dirs-prepend", "Prepend OPT1 to the user data path", E_IPC_OP_DATA_DIRS_PREPEND, 0),
|
||||
OSTR("-data-dirs-remove", "Remove OPT1 from the user data path", E_IPC_OP_DATA_DIRS_REMOVE, 0),
|
||||
OREQ("-font-dirs-list", "List all font directories", E_IPC_OP_FONT_DIRS_LIST, 1),
|
||||
OSTR("-font-dirs-append", "Append OPT1 to the user font path", E_IPC_OP_FONT_DIRS_APPEND, 0),
|
||||
OSTR("-font-dirs-prepend", "Prepend OPT1 to the user font path", E_IPC_OP_FONT_DIRS_PREPEND, 0),
|
||||
OSTR("-font-dirs-prepend", "Prepend OPT1 to the user font path", E_IPC_OP_FONT_DIRS_PREPEND, 0),
|
||||
OSTR("-font-dirs-remove", "Remove OPT1 from the user font path", E_IPC_OP_FONT_DIRS_REMOVE, 0),
|
||||
OREQ("-theme-dirs-list", "List all theme directories", E_IPC_OP_THEME_DIRS_LIST, 1),
|
||||
OSTR("-theme-dirs-append", "Append OPT1 to the user theme path", E_IPC_OP_THEME_DIRS_APPEND, 0),
|
||||
OSTR("-theme-dirs-prepend", "Prepend OPT1 to the user theme path", E_IPC_OP_THEME_DIRS_PREPEND, 0),
|
||||
OSTR("-theme-dirs-prepend", "Prepend OPT1 to the user theme path", E_IPC_OP_THEME_DIRS_PREPEND, 0),
|
||||
OSTR("-theme-dirs-remove", "Remove OPT1 from the user theme path", E_IPC_OP_THEME_DIRS_REMOVE, 0),
|
||||
OREQ("-init-dirs-list", "List all init directories", E_IPC_OP_INIT_DIRS_LIST, 1),
|
||||
OSTR("-init-dirs-append", "Append OPT1 to the user init path", E_IPC_OP_INIT_DIRS_APPEND, 0),
|
||||
OSTR("-init-dirs-prepend", "Prepend OPT1 to the user init path", E_IPC_OP_INIT_DIRS_PREPEND, 0),
|
||||
OSTR("-init-dirs-prepend", "Prepend OPT1 to the user init path", E_IPC_OP_INIT_DIRS_PREPEND, 0),
|
||||
OSTR("-init-dirs-remove", "Remove OPT1 from the user init path", E_IPC_OP_INIT_DIRS_REMOVE, 0),
|
||||
OREQ("-icon-dirs-list", "List all icon directories", E_IPC_OP_ICON_DIRS_LIST, 1),
|
||||
OSTR("-icon-dirs-append", "Append OPT1 to the user icon path", E_IPC_OP_ICON_DIRS_APPEND, 0),
|
||||
|
@ -315,7 +393,7 @@ E_IPC_Opt_Handler handlers[] =
|
|||
OSTR("-image-dirs-append", "Append OPT1 to the user image path", E_IPC_OP_IMAGE_DIRS_APPEND, 0),
|
||||
OSTR("-image-dirs-prepend", "Prepend OPT1 to the user image path", E_IPC_OP_IMAGE_DIRS_PREPEND, 0),
|
||||
OSTR("-image-dirs-remove", "Remove OPT1 from the user image path", E_IPC_OP_IMAGE_DIRS_REMOVE, 0),
|
||||
OREQ("-bg-dirs-list", "List all background directories", E_IPC_OP_BG_DIRS_LIST, 1),
|
||||
OREQ("-bg-dirs-list", "List all background directories", E_IPC_OP_BG_DIRS_LIST, 1),
|
||||
OSTR("-bg-dirs-append", "Append OPT1 to the user background path", E_IPC_OP_BG_DIRS_APPEND, 0),
|
||||
OSTR("-bg-dirs-prepend", "Prepend OPT1 to the user background path", E_IPC_OP_BG_DIRS_PREPEND, 0),
|
||||
OSTR("-bg-dirs-remove", "Remove OPT1 from the user background path", E_IPC_OP_BG_DIRS_REMOVE, 0),
|
||||
|
@ -343,7 +421,11 @@ E_IPC_Opt_Handler handlers[] =
|
|||
ODBL("-edge-flip_timeout-set", "Set the edge flip timeout (sec)", E_IPC_OP_EDGE_FLIP_TIMEOUT_SET, 0),
|
||||
OREQ("-edge-flip_timeout-get", "Get the edge flip timeout", E_IPC_OP_EDGE_FLIP_TIMEOUT_GET, 1),
|
||||
O2INT("-desks-set", "Set the number of virtual desktops (X x Y. OPT1 = X, OPT2 = Y)", E_IPC_OP_DESKS_SET, 0),
|
||||
OREQ("-desks-get", "Get the number of virtual desktops", E_IPC_OP_DESKS_GET, 1)
|
||||
OREQ("-desks-get", "Get the number of virtual desktops", E_IPC_OP_DESKS_GET, 1),
|
||||
O2INT("-desks-set", "Set the number of virtual desktops (X x Y. OPT1 = X, OPT2 = Y)", E_IPC_OP_DESKS_SET, 0),
|
||||
OREQ("-desks-get", "Get the number of virtual desktops", E_IPC_OP_DESKS_GET, 1),
|
||||
OFNC("-focus-policy-set", "Set focus policy. OPT1 = Policy. OPT2 = Raise Time.", 2, _e_opt_focus_policy_set, 0),
|
||||
OREQ("-focus-policy-get", "Get focus policy.", E_IPC_OP_FOCUS_POLICY_GET, 1)
|
||||
};
|
||||
|
||||
/* externally accessible functions */
|
||||
|
@ -1027,6 +1109,16 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
|
|||
printf("REPLY: %i %i\n", val1, val2);
|
||||
}
|
||||
break;
|
||||
case E_IPC_OP_FOCUS_POLICY_GET_REPLY:
|
||||
if(e->data)
|
||||
{
|
||||
E_Config_Focus_Policy policy;
|
||||
|
||||
if(_e_ipc_focus_policy_dec(e->data, e->size, &policy))
|
||||
printf("REPLY: %i %i\n", policy.focus_policy, policy.raise_timer);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1283,3 +1375,22 @@ ECORE_IPC_DEC_EVAS_LIST_PROTO(_e_ipc_path_list_dec)
|
|||
ECORE_IPC_GETS(dir);
|
||||
ECORE_IPC_DEC_EVAS_LIST_FOOT();
|
||||
}
|
||||
|
||||
ECORE_IPC_ENC_STRUCT_PROTO(_e_ipc_focus_policy_enc)
|
||||
{
|
||||
ECORE_IPC_ENC_STRUCT_HEAD(E_Config_Focus_Policy,
|
||||
1 + 4);
|
||||
ECORE_IPC_PUT8(focus_policy);
|
||||
ECORE_IPC_PUT32(raise_timer);
|
||||
ECORE_IPC_ENC_STRUCT_FOOT();
|
||||
}
|
||||
|
||||
ECORE_IPC_DEC_STRUCT_PROTO(_e_ipc_focus_policy_dec)
|
||||
{
|
||||
ECORE_IPC_DEC_STRUCT_HEAD_MIN(E_Config_Focus_Policy,
|
||||
1 + 4);
|
||||
ECORE_IPC_CHEKS();
|
||||
ECORE_IPC_GET8(focus_policy);
|
||||
ECORE_IPC_GET32(raise_timer);
|
||||
ECORE_IPC_DEC_STRUCT_FOOT();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue