diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2015-02-19 14:49:21 -0500 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2015-02-19 14:49:21 -0500 |
commit | 7aa0ff24c7c36e7f32522a1175ace5d1656f4077 (patch) | |
tree | 2785f2355dad7a4e40e2216ec133f23f7f6d7222 /src/modules | |
parent | 4276b3ac55671c6cab52f5b84b18c863c5f4a9c1 (diff) | |
download | enlightenment-7aa0ff24c7c36e7f32522a1175ace5d1656f4077.tar.gz |
Provide wl_output events on hotplug
Summary:
Clients that have bound wl_output now receive wl_output events on hotplug
NOTE: We don't handle removal yet
Reviewers: devilhorns, zmike
Reviewed By: devilhorns, zmike
Subscribers: cedric
Maniphest Tasks: T2131
Differential Revision: https://phab.enlightenment.org/D2008
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/wl_drm/e_mod_main.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c index fbaa615ddd..4640599dfe 100644 --- a/src/modules/wl_drm/e_mod_main.c +++ b/src/modules/wl_drm/e_mod_main.c @@ -1,9 +1,11 @@ +#define E_COMP_WL #include "e.h" #include <Ecore_Drm.h> EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Wl_Drm" }; static Ecore_Event_Handler *activate_handler; +static Ecore_Event_Handler *output_handler; static Eina_Bool session_state = EINA_FALSE; static Eina_Bool @@ -52,6 +54,33 @@ end: return ECORE_CALLBACK_PASS_ON; } +static Eina_Bool +_e_mod_drm_cb_output(void *data, int type EINA_UNUSED, void *event) +{ + Ecore_Drm_Event_Output *e; + Eina_List *l; + E_Comp *c; + struct wl_resource *resource; + + if ((!event) || (!data)) goto end; + e = event; + c = data; + + if (!e->plug) goto end; + + EINA_LIST_FOREACH(c->wl_comp_data->output.resources, l, resource) + { + wl_output_send_geometry(resource, e->x, e->y, e->phys_width, + e->phys_height, e->subpixel_order, + e->make, e->model, e->transform); + wl_output_send_scale(resource, 1); + if (wl_resource_get_version(resource) >= WL_OUTPUT_DONE_SINCE_VERSION) + wl_output_send_done(resource); + } +end: + return ECORE_CALLBACK_PASS_ON; +} + EAPI void * e_modapi_init(E_Module *m) { @@ -142,8 +171,9 @@ e_modapi_init(E_Module *m) activate_handler = ecore_event_handler_add(ECORE_DRM_EVENT_ACTIVATE, _e_mod_drm_cb_activate, comp); - - + output_handler = + ecore_event_handler_add(ECORE_DRM_EVENT_OUTPUT, + _e_mod_drm_cb_output, comp); return m; } |