#endif
E_API int E_EVENT_CLIENT_VISIBILITY_CHANGE = -1;
E_API int E_EVENT_CLIENT_BUFFER_CHANGE = -1;
+E_API int E_EVENT_CLIENT_FOCUS_SKIP_SET = -1;
+E_API int E_EVENT_CLIENT_FOCUS_SKIP_UNSET = -1;
static Eina_Hash *clients_hash[E_PIXMAP_TYPE_MAX] = {NULL}; // pixmap->client
return focus_ec;
}
+static void
+_e_client_event_focus_skip_set(E_Client *ec, Eina_Bool by_client)
+{
+ E_Event_Client_Focus_Skip_Set *ev;
+
+ ev = E_NEW(E_Event_Client_Focus_Skip_Set, 1);
+ if (!ev) return;
+
+ ev->ec = ec;
+ ev->by_client = by_client;
+ e_object_ref(E_OBJECT(ec));
+
+ ecore_event_add(E_EVENT_CLIENT_FOCUS_SKIP_SET, ev, (Ecore_End_Cb)_e_client_event_simple_free, NULL);
+}
+
+static void
+_e_client_event_focus_skip_unset(E_Client *ec, Eina_Bool by_client)
+{
+ E_Event_Client_Focus_Skip_Unset *ev;
+
+ ev = E_NEW(E_Event_Client_Focus_Skip_Unset, 1);
+ if (!ev) return;
+
+ ev->ec = ec;
+ ev->by_client = by_client;
+ e_object_ref(E_OBJECT(ec));
+
+ ecore_event_add(E_EVENT_CLIENT_FOCUS_SKIP_UNSET, ev, (Ecore_End_Cb)_e_client_event_simple_free, NULL);
+}
+
+E_API void
+e_client_focus_skip_set(E_Client *ec, Eina_Bool skip, Eina_Bool by_client)
+{
+ if (!ec) return;
+
+ if (skip)
+ {
+ if (ec->icccm.accepts_focus)
+ {
+ ELOGF("TZPOL", "FOCUS|SKIP SET (by_client:%d)", ec, by_client);
+ ec->icccm.accepts_focus = ec->icccm.take_focus = 0;
+ ec->changes.accepts_focus = 1;
+ EC_CHANGED(ec);
+
+ _e_client_event_focus_skip_set(ec, by_client);
+ }
+ }
+ else
+ {
+ if (!ec->icccm.accepts_focus)
+ {
+ ELOGF("TZPOL", "FOCUS|SKIP UNSET (by_client:%d)", ec, by_client);
+ ec->icccm.accepts_focus = ec->icccm.take_focus = 1;
+ ec->changes.accepts_focus = 1;
+ EC_CHANGED(ec);
+
+ _e_client_event_focus_skip_unset(ec, by_client);
+ }
+ }
+}
+
EINTERN void
e_client_revert_focus(E_Client *ec)
{
#endif
E_EVENT_CLIENT_VISIBILITY_CHANGE = ecore_event_type_new();
E_EVENT_CLIENT_BUFFER_CHANGE = ecore_event_type_new();
+ E_EVENT_CLIENT_FOCUS_SKIP_SET = ecore_event_type_new();;
+ E_EVENT_CLIENT_FOCUS_SKIP_UNSET = ecore_event_type_new();;
return (!!clients_hash[1]);
}
typedef struct E_Event_Client E_Event_Client;
typedef struct _E_Event_Client_Property E_Event_Client_Property;
+typedef struct _E_Event_Client_Focus_Skip E_Event_Client_Focus_Skip_Set;
+typedef struct _E_Event_Client_Focus_Skip E_Event_Client_Focus_Skip_Unset;
typedef struct _E_Client_Pending_Resize E_Client_Pending_Resize;
typedef struct _E_Client_Pending_Geometry E_Client_Pending_Geometry;
typedef struct E_Event_Client_Zone_Set E_Event_Client_Zone_Set;
unsigned int property;
};
+struct _E_Event_Client_Focus_Skip
+{
+ E_Client *ec;
+ Eina_Bool by_client;
+};
+
struct _E_Client_Hook
{
EINA_INLIST;
#endif
E_API extern int E_EVENT_CLIENT_VISIBILITY_CHANGE;
E_API extern int E_EVENT_CLIENT_BUFFER_CHANGE;
+E_API extern int E_EVENT_CLIENT_FOCUS_SKIP_SET;
+E_API extern int E_EVENT_CLIENT_FOCUS_SKIP_UNSET;
EINTERN void e_client_idler_before(void);
EINTERN Eina_Bool e_client_init(void);
E_API void e_client_base_output_resolution_transform_adjust(E_Client *ec);
E_API Eina_Bool e_client_base_output_resolution_update(E_Client *ec);
+E_API void e_client_focus_skip_set(E_Client *ec, Eina_Bool skip, Eina_Bool by_client);
EINTERN void e_client_revert_focus(E_Client *ec);
EINTERN Eina_Bool e_client_check_above_focused(E_Client *ec);
ec = wl_resource_get_user_data(surf);
EINA_SAFETY_ON_NULL_RETURN(ec);
- if (ec->icccm.accepts_focus)
- {
- ELOGF("TZPOL", "FOCUS|SKIP SET", ec);
- ec->icccm.accepts_focus = ec->icccm.take_focus = 0;
- ec->changes.accepts_focus = 1;
- EC_CHANGED(ec);
- }
+ e_client_focus_skip_set(ec, EINA_TRUE, EINA_TRUE);
}
static void
ec = wl_resource_get_user_data(surf);
EINA_SAFETY_ON_NULL_RETURN(ec);
- if (!ec->icccm.accepts_focus)
- {
- ELOGF("TZPOL", "FOCUS|SKIP UNSET", ec);
- ec->icccm.accepts_focus = ec->icccm.take_focus = 1;
- ec->changes.accepts_focus = 1;
- EC_CHANGED(ec);
- }
+ e_client_focus_skip_set(ec, EINA_FALSE, EINA_TRUE);
}
// --------------------------------------------------------