defer_focus_stack = eina_list_remove(defer_focus_stack, ec);
}
+EINTERN void
+e_client_focus_defer_clear(void)
+{
+ if (!defer_focus_stack) return;
+
+ defer_focus_stack = eina_list_free(defer_focus_stack);
+}
+
E_API Eina_Bool
e_client_focus_track_enabled(void)
{
focus_stack = l;
}
+EINTERN void
+e_client_focus_stack_clear(void)
+{
+ if (!focus_stack) return;
+
+ focus_stack = eina_list_free(focus_stack);
+}
+
E_API Eina_List *
e_client_lost_windows_get(E_Zone *zone)
{
EINTERN void e_client_focus_stack_append_current_focused(E_Client *ec);
E_API void e_client_focus_defer_set(E_Client *ec);
E_API void e_client_focus_defer_unset(E_Client *ec);
+EINTERN void e_client_focus_defer_clear(void);
E_API Eina_Bool e_client_focus_track_enabled(void);
E_API void e_client_focus_track_freeze(void);
E_API void e_client_focus_track_thaw(void);
E_API void e_client_activate(E_Client *ec, Eina_Bool just_do_it);
E_API E_Client *e_client_focused_get(void);
E_API Eina_List *e_client_focus_stack_get(void);
+EINTERN void e_client_focus_stack_clear(void);
E_API Eina_List *e_client_lost_windows_get(E_Zone *zone);
E_API void e_client_shade(E_Client *ec, E_Direction dir);
E_API void e_client_unshade(E_Client *ec, E_Direction dir);
}
static void
+_e_info_client_cb_focus_policy_ext(const Eldbus_Message *msg)
+{
+ const char *errname = NULL, *errtext = NULL;
+ const int result = 0;
+
+ EINA_SAFETY_ON_TRUE_GOTO(eldbus_message_error_get(msg, &errname, &errtext), err);
+
+ EINA_SAFETY_ON_FALSE_GOTO(eldbus_message_arguments_get(msg, "i", &result), err);
+
+ if (result >= 0)
+ printf("Successfully changed, now focus_policy_ext=%d\n", result);
+ else
+ printf("value change failed\n");
+
+ return;
+
+err:
+ if(errname || errtext)
+ printf("errname : %s, errmsg : %s\n", errname, errtext);
+ else
+ printf("Error occurred in _e_info_client_cb_focus_policy_ext\n");
+
+ return;
+}
+
+static void
+_e_info_client_proc_focus_policy_ext(int argc, char **argv)
+{
+ int input = -1;
+
+ EINA_SAFETY_ON_FALSE_GOTO(argc == 3, usage);
+
+ input = atoi(argv[2]);
+ if ((input != 0) && (input != 1) && (input != -1)) goto usage;
+
+ _e_info_client_eldbus_message_with_args("focus_policy_ext_set", _e_info_client_cb_focus_policy_ext, "i", atoi(argv[2]));
+
+ return;
+
+usage :
+ printf("Usage : %s -focus_policy_ext [policy_enum]\n\n", argv[0]);
+ printf(" %s -focus_policy_ext 0 : set focus_policy_ext to E_FOCUS_EXT_TOP_STACK\n", argv[0]);
+ printf(" %s -focus_policy_ext 1 : set focus_policy_ext to E_FOCUS_EXT_HISTORY\n", argv[0]);
+ printf(" %s -focus_policy_ext : show now focus_policy_ext\n", argv[0]);
+
+ return;
+}
+
+static void
_e_info_client_cb_focus_history(const Eldbus_Message *msg)
{
const char *errname = NULL, *errtext = NULL;
_e_info_client_magnifier
},
{
+ "focus_policy_ext",
+ "[0], [1]",
+ "set focus_policy_ext, 0 is E_FOCUS_EXT_TOP_STACK, 1 is E_FOCUS_EXT_HISTORY",
+ _e_info_client_proc_focus_policy_ext
+ },
+ {
"focus_history",
NULL,
"get focus history",
}
static Eldbus_Message *
+_e_info_server_cb_focus_policy_ext_set(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply;
+ E_Client *ec = NULL;
+ int option = 0, res = -1;
+
+ if (!eldbus_message_arguments_get(msg, "i", &option))
+ {
+ return eldbus_message_error_new(msg, GET_CALL_MSG_ARG_ERR,
+ "focus_policy_ext_set: an attempt to get argument from method call message failed");
+ }
+
+ e_client_focus_defer_clear();
+ e_client_focus_stack_clear();
+
+ switch (option)
+ {
+ case -1:
+ // get now focus policy ext
+ break;
+ case 0:
+ // use topmost focus
+ e_config->focus_policy_ext = E_FOCUS_EXT_TOP_STACK;
+ break;
+ case 1:
+ default:
+ // use focus history
+ e_config->focus_policy_ext = E_FOCUS_EXT_HISTORY;
+
+ E_CLIENT_FOREACH(ec)
+ {
+ e_client_focus_latest_set(ec);
+ }
+ break;
+ }
+
+ res = e_config->focus_policy_ext;
+
+ reply = eldbus_message_method_return_new(msg);
+ eldbus_message_arguments_append(reply, "i", res);
+
+ return reply;
+}
+
+static Eldbus_Message *
_e_info_server_cb_focus_history(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
Eldbus_Message *reply;
{ "input_region", ELDBUS_ARGS({"siiii", "options"}), ELDBUS_ARGS({"a(iiii)", "path"}), _e_info_server_cb_input_region, 0},
{ "hwc_wins", ELDBUS_ARGS({"i", "option"}), ELDBUS_ARGS({"as", "hwc wins info"}), _e_info_server_cb_hwc_wins_info_get, 0 },
{ "screen_info", ELDBUS_ARGS({"i", "option"}), ELDBUS_ARGS({"as", "screen info"}), _e_info_server_cb_screen_info_get, 0 },
+ { "focus_policy_ext_set", ELDBUS_ARGS({"i", "option"}), ELDBUS_ARGS({"i", "result"}), _e_info_server_cb_focus_policy_ext_set, 0 },
{ "focus_history", NULL, ELDBUS_ARGS({"a(ubbbs)", "history array"}), _e_info_server_cb_focus_history, 0 },
{ NULL, NULL, NULL, NULL, 0 }
};