summaryrefslogtreecommitdiff
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
parentcc0cfb782221684ed9e65614a07e0018031788c2 (diff)
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
224 Eina_List *supported_aux_hints; 224 Eina_List *supported_aux_hints;
225 Eina_List *frame_callbacks; 225 Eina_List *frame_callbacks;
226 226
227 Eina_List *outputs;
228
227 Ecore_Wl2_Window_Configure_State set_config; 229 Ecore_Wl2_Window_Configure_State set_config;
228 Ecore_Wl2_Window_Configure_State req_config; 230 Ecore_Wl2_Window_Configure_State req_config;
229 Ecore_Wl2_Window_Configure_State def_config; 231 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)
422 } 422 }
423} 423}
424 424
425static void
426_surface_enter(void *data, struct wl_surface *surf EINA_UNUSED, struct wl_output *op)
427{
428 Ecore_Wl2_Window *win;
429 Ecore_Wl2_Output *output;
430
431 win = data;
432
433 output = _ecore_wl2_output_find(win->display, op);
434 EINA_SAFETY_ON_NULL_RETURN(output);
435
436 win->outputs = eina_list_append(win->outputs, output);
437}
438
439static void
440_surface_leave(void *data, struct wl_surface *surf EINA_UNUSED, struct wl_output *op)
441{
442 Ecore_Wl2_Window *win;
443 Ecore_Wl2_Output *output;
444
445 win = data;
446 output = _ecore_wl2_output_find(win->display, op);
447 EINA_SAFETY_ON_NULL_RETURN(output);
448
449 win->outputs = eina_list_remove(win->outputs, output);
450}
451
452static const struct wl_surface_listener _surface_listener =
453{
454 _surface_enter,
455 _surface_leave,
456};
457
425void 458void
426_ecore_wl2_window_surface_create(Ecore_Wl2_Window *window) 459_ecore_wl2_window_surface_create(Ecore_Wl2_Window *window)
427{ 460{
@@ -440,6 +473,8 @@ _ecore_wl2_window_surface_create(Ecore_Wl2_Window *window)
440 473
441 window->surface_id = 474 window->surface_id =
442 wl_proxy_get_id((struct wl_proxy *)window->surface); 475 wl_proxy_get_id((struct wl_proxy *)window->surface);
476
477 wl_surface_add_listener(window->surface, &_surface_listener, window);
443 if (window->display->wl.efl_aux_hints) 478 if (window->display->wl.efl_aux_hints)
444 { 479 {
445 efl_aux_hints_get_supported_aux_hints(window->display->wl.efl_aux_hints, window->surface); 480 efl_aux_hints_get_supported_aux_hints(window->display->wl.efl_aux_hints, window->surface);