forked from enlightenment/efl
ecore-wl2: Add client-side event for Window Activate
This patch adds and sends a client-side event when a window gets activated. '#divergence' @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
b12b26d4c0
commit
640caf1d9c
|
@ -302,6 +302,13 @@ typedef struct _Ecore_Wl2_Event_Window_Hide
|
|||
unsigned int event_win;
|
||||
} Ecore_Wl2_Event_Window_Hide;
|
||||
|
||||
typedef struct _Ecore_Wl2_Event_Window_Activate
|
||||
{
|
||||
unsigned int win;
|
||||
unsigned int parent_win;
|
||||
unsigned int event_win;
|
||||
} Ecore_Wl2_Event_Window_Activate;
|
||||
|
||||
typedef enum _Ecore_Wl2_Window_Type
|
||||
{
|
||||
ECORE_WL2_WINDOW_TYPE_NONE,
|
||||
|
@ -357,6 +364,7 @@ EAPI extern int ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_DONE; /** @since 1.20 */
|
|||
EAPI extern int ECORE_WL2_EVENT_AUX_HINT_ALLOWED; /** @since 1.20 */
|
||||
EAPI extern int ECORE_WL2_EVENT_WINDOW_SHOW; /** @since 1.20 */
|
||||
EAPI extern int ECORE_WL2_EVENT_WINDOW_HIDE; /** @since 1.20 */
|
||||
EAPI extern int ECORE_WL2_EVENT_WINDOW_ACTIVATE; /** @since 1.20 */
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
|
|
@ -48,6 +48,7 @@ EAPI int ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_DONE = 0;
|
|||
EAPI int ECORE_WL2_EVENT_AUX_HINT_ALLOWED = 0;
|
||||
EAPI int ECORE_WL2_EVENT_WINDOW_SHOW = 0;
|
||||
EAPI int ECORE_WL2_EVENT_WINDOW_HIDE = 0;
|
||||
EAPI int ECORE_WL2_EVENT_WINDOW_ACTIVATE = 0;
|
||||
|
||||
EAPI int _ecore_wl2_event_window_www = -1;
|
||||
EAPI int _ecore_wl2_event_window_www_drag = -1;
|
||||
|
@ -126,6 +127,7 @@ ecore_wl2_init(void)
|
|||
ECORE_WL2_EVENT_AUX_HINT_ALLOWED = ecore_event_type_new();
|
||||
ECORE_WL2_EVENT_WINDOW_SHOW = ecore_event_type_new();
|
||||
ECORE_WL2_EVENT_WINDOW_HIDE = ecore_event_type_new();
|
||||
ECORE_WL2_EVENT_WINDOW_ACTIVATE = ecore_event_type_new();
|
||||
}
|
||||
if (!no_session_recovery)
|
||||
no_session_recovery = !!getenv("EFL_NO_WAYLAND_SESSION_RECOVERY");
|
||||
|
@ -191,7 +193,8 @@ ecore_wl2_shutdown(void)
|
|||
ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_DONE,
|
||||
ECORE_WL2_EVENT_AUX_HINT_ALLOWED,
|
||||
ECORE_WL2_EVENT_WINDOW_SHOW,
|
||||
ECORE_WL2_EVENT_WINDOW_HIDE);
|
||||
ECORE_WL2_EVENT_WINDOW_HIDE,
|
||||
ECORE_WL2_EVENT_WINDOW_ACTIVATE);
|
||||
|
||||
/* shutdown Ecore_Event */
|
||||
ecore_event_shutdown();
|
||||
|
|
|
@ -53,6 +53,21 @@ _ecore_wl2_window_configure_send(Ecore_Wl2_Window *window, int w, int h, unsigne
|
|||
ecore_event_add(ECORE_WL2_EVENT_WINDOW_CONFIGURE, ev, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_wl2_window_activate_send(Ecore_Wl2_Window *window)
|
||||
{
|
||||
Ecore_Wl2_Event_Window_Activate *ev;
|
||||
|
||||
ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Activate));
|
||||
if (!ev) return;
|
||||
|
||||
ev->win = window->id;
|
||||
if (window->parent)
|
||||
ev->parent_win = window->parent->id;
|
||||
ev->event_win = window->id;
|
||||
ecore_event_add(ECORE_WL2_EVENT_WINDOW_ACTIVATE, ev, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_xdg_popup_cb_done(void *data, struct xdg_popup *xdg_popup EINA_UNUSED)
|
||||
{
|
||||
|
@ -118,6 +133,9 @@ _xdg_surface_cb_configure(void *data, struct xdg_surface *xdg_surface EINA_UNUSE
|
|||
|
||||
_ecore_wl2_window_configure_send(win, w, h, !!win->resizing,
|
||||
win->fullscreen, win->maximized);
|
||||
|
||||
if (win->focused)
|
||||
_ecore_wl2_window_activate_send(win);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -208,6 +226,9 @@ _zxdg_toplevel_cb_configure(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel E
|
|||
|
||||
_ecore_wl2_window_configure_send(win, width, height, !!win->resizing,
|
||||
win->fullscreen, win->maximized);
|
||||
|
||||
if (win->focused)
|
||||
_ecore_wl2_window_activate_send(win);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue