Start showing recently binded current client's external window if there has been... 14/83014/2 accepted/tizen/common/20160812.141258 accepted/tizen/ivi/20160815.233507 accepted/tizen/mobile/20160815.233418 accepted/tizen/tv/20160815.233433 accepted/tizen/wearable/20160815.233450 submit/tizen/20160812.083535
authorRoman Peresipkyn <r.peresipkyn@samsung.com>
Fri, 5 Aug 2016 12:15:03 +0000 (15:15 +0300)
committerRoman Peresipkyn <r.peresipkyn@samsung.com>
Tue, 9 Aug 2016 07:25:37 +0000 (10:25 +0300)
changes:
1. send EOM's attribute and attribute_status states in 'info' event on
connection and disconnection of an external output. It was necessary
because events on clients side are handled in wron way.
2. Send ACTIVE and INACTIVE events to 'current' client if external
output has been connected or disconnected.

Change-Id: Iae4e6396fd71ac911c8b9938756967362c44fd2e
Signed-off-by: Roman Peresipkyn <r.peresipkyn@samsung.com>
protocol/eom-client-protocol.h
protocol/eom-protocol.c
protocol/eom-server-protocol.h
protocol/eom.xml
src/e_mod_main.c

index 1fcd29d..4aacb71 100644 (file)
@@ -174,6 +174,10 @@ struct wl_eom_listener {
         * @w_mm: (none)
         * @h_mm: (none)
         * @connection: (none)
+        * @skip: (none)
+        * @attribute: (none)
+        * @attribute_state: (none)
+        * @error: (none)
         */
        void (*output_info)(void *data,
                            struct wl_eom *wl_eom,
@@ -184,7 +188,11 @@ struct wl_eom_listener {
                            uint32_t h,
                            uint32_t w_mm,
                            uint32_t h_mm,
-                           uint32_t connection);
+                           uint32_t connection,
+                           uint32_t skip,
+                           uint32_t attribute,
+                           uint32_t attribute_state,
+                           uint32_t error);
        /**
         * output_type - (none)
         * @output_id: (none)
index c032027..b0b38d5 100644 (file)
@@ -15,6 +15,10 @@ static const struct wl_interface *types[] = {
        NULL,
        NULL,
        NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
        &xdg_surface_interface,
        NULL,
        &wl_shell_surface_interface,
@@ -22,14 +26,14 @@ static const struct wl_interface *types[] = {
 
 static const struct wl_message wl_eom_requests[] = {
        { "set_attribute", "uu", types + 0 },
-       { "set_xdg_window", "uo", types + 8 },
-       { "set_shell_window", "uo", types + 10 },
+       { "set_xdg_window", "uo", types + 12 },
+       { "set_shell_window", "uo", types + 14 },
        { "get_output_info", "u", types + 0 },
 };
 
 static const struct wl_message wl_eom_events[] = {
        { "output_count", "u", types + 0 },
-       { "output_info", "uuuuuuuu", types + 0 },
+       { "output_info", "uuuuuuuuuuuu", types + 0 },
        { "output_type", "uuu", types + 0 },
        { "output_mode", "uu", types + 0 },
        { "output_attribute", "uuuu", types + 0 },
index 333d0cd..f170f7f 100644 (file)
@@ -212,9 +212,9 @@ wl_eom_send_output_count(struct wl_resource *resource_, uint32_t count)
 }
 
 static inline void
-wl_eom_send_output_info(struct wl_resource *resource_, uint32_t output_id, uint32_t type, uint32_t mode, uint32_t w, uint32_t h, uint32_t w_mm, uint32_t h_mm, uint32_t connection)
+wl_eom_send_output_info(struct wl_resource *resource_, uint32_t output_id, uint32_t type, uint32_t mode, uint32_t w, uint32_t h, uint32_t w_mm, uint32_t h_mm, uint32_t connection, uint32_t skip, uint32_t attribute, uint32_t attribute_state, uint32_t error)
 {
-       wl_resource_post_event(resource_, WL_EOM_OUTPUT_INFO, output_id, type, mode, w, h, w_mm, h_mm, connection);
+       wl_resource_post_event(resource_, WL_EOM_OUTPUT_INFO, output_id, type, mode, w, h, w_mm, h_mm, connection, skip, attribute, attribute_state, error);
 }
 
 static inline void
index ff50650..2ea8e15 100644 (file)
@@ -34,7 +34,7 @@
       <entry name="dsi" value="16" summary="VGA output connector type"/>
     </enum>
 
-   <enum name="status">
+    <enum name="status">
       <description summary="connection status of the external output">
       ***** TODO ******
       </description>
@@ -43,7 +43,7 @@
       <entry name="disconnection" value="2" summary="output disconnected"/>
     </enum>
 
-   <enum name="mode">
+    <enum name="mode">
       <description summary="mode of the external output">
       ***** TODO ******
       </description>
@@ -52,7 +52,7 @@
       <entry name="presentation" value="2" summary="presentation mode"/>
     </enum>
 
-   <enum name="attribute">
+    <enum name="attribute">
       <description summary="attribute of the external output">
       ***** TODO ******
       </description>
@@ -62,7 +62,7 @@
       <entry name="exclusive" value="3" summary="exclusive attribute"/>
     </enum>
 
-   <enum name="attribute_state">
+    <enum name="attribute_state">
       <description summary="state of the external output attribute">
       ***** TODO ******
       </description>
       <arg name="w_mm" type="uint"/>
       <arg name="h_mm" type="uint"/>
       <arg name="connection" type="uint"/>
+      <arg name="skip" type="uint"/>
+      <arg name="attribute" type="uint"/>
+      <arg name="attribute_state" type="uint"/>
+      <arg name="error" type="uint"/>
     </event>
 
     <event name="output_type">
index e7fac6c..0a7a94d 100644 (file)
@@ -183,13 +183,8 @@ _e_eom_cb_wl_bind(struct wl_client *client, void *data, uint32_t version, uint32
                      output->id, output->type, output->mode, output->width, output->height,
                      output->phys_width, output->phys_height, output->status);
              wl_eom_send_output_info(resource, output->id, output->type, output->mode, output->width, output->height,
-                                     output->phys_width, output->phys_height, output->status);
-
-             wl_eom_send_output_attribute(resource,
-                                          output->id,
-                                          _e_eom_output_state_get_attribute(output),
-                                          _e_eom_output_state_get_attribute_state(output),
-                                          EOM_ERROR_NONE);
+                                     output->phys_width, output->phys_height, output->status,
+                                     1, 0, 0, 0);
           }
      }
 
@@ -712,17 +707,23 @@ _e_eom_output_connected(E_EomOutputPtr eom_output)
           {
              EOM_DBG("Send MIRROR ON notification to clients");
 
-             wl_eom_send_output_info(iterator->resource, eom_output->id,
-                                     eom_output->type, eom_output->mode,
-                                     eom_output->width, eom_output->height,
-                                     eom_output->phys_width, eom_output->phys_height,
-                                     eom_output->status);
-
-             wl_eom_send_output_attribute(iterator->resource,
-                                          eom_output->id,
-                                          _e_eom_output_state_get_attribute(eom_output),
-                                          _e_eom_output_state_get_attribute_state(eom_output),
-                                          EOM_ERROR_NONE);
+             if (iterator->current)
+               wl_eom_send_output_info(iterator->resource, eom_output->id,
+                                       eom_output->type, eom_output->mode,
+                                       eom_output->width, eom_output->height,
+                                       eom_output->phys_width, eom_output->phys_height,
+                                       eom_output->status,
+                                       0,
+                                       _e_eom_output_state_get_attribute(eom_output),
+                                       EOM_OUTPUT_ATTRIBUTE_STATE_ACTIVE,
+                                       EOM_ERROR_NONE);
+             else
+               wl_eom_send_output_info(iterator->resource, eom_output->id,
+                                       eom_output->type, eom_output->mode,
+                                       eom_output->width, eom_output->height,
+                                       eom_output->phys_width, eom_output->phys_height,
+                                       eom_output->status,
+                                       1, 0, 0, 0);
           }
      }
 
@@ -803,18 +804,23 @@ _e_eom_cb_tdm_output_status_change(tdm_output *output, tdm_output_change_type ty
              if (iterator)
                {
                   EOM_DBG("Send MIRROR OFF notification to clients");
-
-                  wl_eom_send_output_info(iterator->resource, eom_output->id,
-                                          eom_output->type, eom_output->mode,
-                                          eom_output->width, eom_output->height,
-                                          eom_output->phys_width, eom_output->phys_height,
-                                          eom_output->status);
-
-                  wl_eom_send_output_attribute(iterator->resource,
-                                               eom_output->id,
-                                               _e_eom_output_state_get_attribute(eom_output),
-                                               EOM_OUTPUT_ATTRIBUTE_STATE_LOST,
-                                               EOM_ERROR_NONE);
+                  if (iterator->current)
+                    wl_eom_send_output_info(iterator->resource, eom_output->id,
+                                            eom_output->type, eom_output->mode,
+                                            eom_output->width, eom_output->height,
+                                            eom_output->phys_width, eom_output->phys_height,
+                                            eom_output->status,
+                                            0,
+                                            _e_eom_output_state_get_attribute(eom_output),
+                                            EOM_OUTPUT_ATTRIBUTE_STATE_INACTIVE,
+                                            EOM_ERROR_NONE);
+                  else
+                    wl_eom_send_output_info(iterator->resource, eom_output->id,
+                                            eom_output->type, eom_output->mode,
+                                            eom_output->width, eom_output->height,
+                                            eom_output->phys_width, eom_output->phys_height,
+                                            eom_output->status,
+                                            1, 0, 0, 0);
                }
           }
 
@@ -1033,7 +1039,7 @@ _e_eom_cb_wl_request_get_output_info(struct wl_client *client, struct wl_resourc
                           output->phys_width, output->phys_height, output->status);
 
                   wl_eom_send_output_info(resource, output->id, output->type, output->mode, output->width, output->height,
-                                          output->phys_width, output->phys_height, output->status);
+                                          output->phys_width, output->phys_height, output->status, 1, 0, 0, 0);
                }
           }
      }
@@ -1314,7 +1320,7 @@ _e_eom_output_start_mirror(E_EomOutputPtr eom_output)
    GOTOIFTRUE(tdm_err != TDM_ERROR_NONE, err, "Commit crtc:%d", tdm_err);
 
    _e_eom_output_state_set_mode(eom_output, EOM_OUTPUT_MODE_MIRROR);
-   _e_eom_output_state_set_attribute(eom_output, EOM_OUTPUT_ATTRIBUTE_NONE);
+   /* _e_eom_output_state_set_attribute(eom_output, EOM_OUTPUT_ATTRIBUTE_NONE); */
    eom_output->state = MIRROR;
 
    return;