aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-01-30 14:52:55 -0600
committerDerek Foreman <derekf@osg.samsung.com>2018-01-30 17:09:51 -0600
commit8abac6da65a1bfd5883383bb72de1215ff555b8f (patch)
tree01447454d5cbebf2e8f889cd1e3a07232dba95e1
parentecore_wl2: Add internal _ecore_wl2_output_find (diff)
downloadefl-8abac6da65a1bfd5883383bb72de1215ff555b8f.tar.gz
ecore_wl2: Track outputs a surface is present on
Keep a list of Ecore_Wl2_Output * a surface is present on.
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_private.h2
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c35
2 files changed, 37 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h
index ec7b767691..107bc6360b 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -224,6 +224,8 @@ struct _Ecore_Wl2_Window
Eina_List *supported_aux_hints;
Eina_List *frame_callbacks;
+ Eina_List *outputs;
+
Ecore_Wl2_Window_Configure_State set_config;
Ecore_Wl2_Window_Configure_State req_config;
Ecore_Wl2_Window_Configure_State def_config;
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index 8ee6e84c21..0e93170876 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -422,6 +422,39 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
}
}
+static void
+_surface_enter(void *data, struct wl_surface *surf EINA_UNUSED, struct wl_output *op)
+{
+ Ecore_Wl2_Window *win;
+ Ecore_Wl2_Output *output;
+
+ win = data;
+
+ output = _ecore_wl2_output_find(win->display, op);
+ EINA_SAFETY_ON_NULL_RETURN(output);
+
+ win->outputs = eina_list_append(win->outputs, output);
+}
+
+static void
+_surface_leave(void *data, struct wl_surface *surf EINA_UNUSED, struct wl_output *op)
+{
+ Ecore_Wl2_Window *win;
+ Ecore_Wl2_Output *output;
+
+ win = data;
+ output = _ecore_wl2_output_find(win->display, op);
+ EINA_SAFETY_ON_NULL_RETURN(output);
+
+ win->outputs = eina_list_remove(win->outputs, output);
+}
+
+static const struct wl_surface_listener _surface_listener =
+{
+ _surface_enter,
+ _surface_leave,
+};
+
void
_ecore_wl2_window_surface_create(Ecore_Wl2_Window *window)
{
@@ -440,6 +473,8 @@ _ecore_wl2_window_surface_create(Ecore_Wl2_Window *window)
window->surface_id =
wl_proxy_get_id((struct wl_proxy *)window->surface);
+
+ wl_surface_add_listener(window->surface, &_surface_listener, window);
if (window->display->wl.efl_aux_hints)
{
efl_aux_hints_get_supported_aux_hints(window->display->wl.efl_aux_hints, window->surface);