ensure wayland parts of shot module use the correct wayland display objects
authorMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 17 Jul 2015 18:55:44 +0000 (14:55 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 17 Jul 2015 19:30:30 +0000 (15:30 -0400)
the ecore-wl global objects used here will be wrong for the case of nested
compositors

src/modules/shot/e_mod_main.c

index 96ed891..1cba5c7 100644 (file)
@@ -952,7 +952,7 @@ _wl_shot_now(E_Zone *zone, E_Client *ec, const char *params)
         sh = E_CLAMP(sh, 1, ec->zone->y + ec->zone->h - y);
      }
 
-   shm = ecore_wl_shm_get();
+   shm = e_comp->wl_comp_data->wl.shm ?: ecore_wl_shm_get();
 
    EINA_LIST_FOREACH(_outputs, l, output)
      {
@@ -1288,14 +1288,16 @@ e_modapi_init(E_Module *m)
 #ifdef HAVE_WAYLAND
    Eina_Inlist *globals;
    Ecore_Wl_Global *global;
+   struct wl_registry *reg;
 
-   globals = ecore_wl_globals_get();
+   globals = e_comp->wl_comp_data->wl.globals ?: ecore_wl_globals_get();
+   reg = e_comp->wl_comp_data->wl.registry ?: ecore_wl_registry_get();
    EINA_INLIST_FOREACH(globals, global)
      {
         if (!strcmp(global->interface, "screenshooter"))
           {
              _wl_screenshooter =
-               wl_registry_bind(ecore_wl_registry_get(), global->id,
+               wl_registry_bind(reg, global->id,
                                 &screenshooter_interface, global->version);
 
              if (_wl_screenshooter)
@@ -1311,7 +1313,7 @@ e_modapi_init(E_Module *m)
              if (output)
                {
                   output->output =
-                    wl_registry_bind(ecore_wl_registry_get(), global->id,
+                    wl_registry_bind(reg, global->id,
                                      &wl_output_interface, global->version);
                   _outputs = eina_list_append(_outputs, output);
                   wl_output_add_listener(output->output,