ecore_wl2_display: add tizen_move_resize for client demand move resize
authorJuyeon Lee <juyeonne.lee@samsung.com>
Mon, 13 Aug 2018 01:45:42 +0000 (10:45 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Tue, 11 Sep 2018 07:07:11 +0000 (16:07 +0900)
Client window is driven its move,resize by display server using xdg_shell.
btw some tizen application wants to make its position and size while they're shown
server received tz_position, and resized buffer in consequence so far.
but client's position, and buffer delivery does not always come to server at the
same idler loop. In that case, user could see move first, and resize after a sec.
here, added new wl protocol and ecore_wl2_window_sync_geometry_set api to make
move and resize happen at the sametime.

@tizen_only

Change-Id: If4bd8153c0842cce82333d02278e23f6d7e2402c

src/lib/ecore_wl2/Ecore_Wl2.h
src/lib/ecore_wl2/ecore_wl2_display.c
src/lib/ecore_wl2/ecore_wl2_private.h
src/lib/ecore_wl2/ecore_wl2_window.c

index 8570545..6301c83 100644 (file)
@@ -2359,6 +2359,11 @@ EAPI Eina_Bool ecore_wl2_window_ignore_output_transform_get(Ecore_Wl2_Window *wi
 EAPI struct wl_compositor *ecore_wl2_display_compositor_get(Ecore_Wl2_Display *display);
 //
 
+//TIZEN_ONLY(20180810): support client demand move resize
+EAPI void
+ecore_wl2_window_sync_geometry_set(Ecore_Wl2_Window *window, uint32_t serial, int x, int y, int w, int h);
+//
+
 # endif
 
 # undef EAPI
index ffe5a7b..a64e420 100644 (file)
@@ -644,6 +644,17 @@ static const struct tizen_screen_rotation_listener _tizen_screen_rotation_listen
 {
    _tizen_screen_rotation_cb_ignore_output_transform,
 };
+
+static void
+_tizen_move_resize_cb_geometry_done(void *data EINA_UNUSED, struct tizen_move_resize *tz_moveresize EINA_UNUSED, struct wl_surface *surface EINA_UNUSED, uint32_t serial EINA_UNUSED, int32_t x EINA_UNUSED, int32_t y EINA_UNUSED, int32_t w EINA_UNUSED, int32_t h EINA_UNUSED, int32_t err EINA_UNUSED)
+{
+   /* to be implemented*/
+}
+
+static const struct tizen_move_resize_listener _tizen_move_resize_listener =
+{
+   _tizen_move_resize_cb_geometry_done,
+};
 //
 
 static void
@@ -857,6 +868,16 @@ _cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const
           tizen_screen_rotation_add_listener(ewd->wl.tz_screen_rotation, &_tizen_screen_rotation_listener, ewd->wl.display);
      }
 //
+//TIZEN_ONLY(20180810): support client driven move resize
+   else if (!strcmp(interface, "tizen_move_resize"))
+     {
+        ewd->wl.tz_moveresize =
+           wl_registry_bind(registry, id, &tizen_move_resize_interface, 1);
+        if (ewd->wl.tz_moveresize)
+          tizen_screen_rotation_add_listener(ewd->wl.tz_moveresize, &_tizen_move_resize_listener, ewd->wl.display);
+     }
+//
+   //
 
 event:
    /* allocate space for event structure */
@@ -968,6 +989,7 @@ _ecore_wl2_display_globals_cleanup(Ecore_Wl2_Display *ewd)
    if (ewd->wl.tz_indicator) tizen_indicator_destroy(ewd->wl.tz_indicator);
    if (ewd->wl.tz_clipboard) tizen_clipboard_destroy(ewd->wl.tz_clipboard);
    if (ewd->wl.tz_screen_rotation) tizen_screen_rotation_destroy(ewd->wl.tz_screen_rotation);
+   if (ewd->wl.tz_moveresize) tizen_move_resize_destroy(ewd->wl.tz_moveresize);
 //
 
    if (ewd->wl.registry) wl_registry_destroy(ewd->wl.registry);
index 17b118f..77cf352 100644 (file)
@@ -119,6 +119,9 @@ struct _Ecore_Wl2_Display
         //TIZEN_ONLY(20171115): support output transform
         struct tizen_screen_rotation *tz_screen_rotation;
         //
+        //TIZEN_ONLY(20180810): support client demand move resize
+        struct tizen_move_resize *tz_moveresize;
+        //
 
         int compositor_version;
      } wl;
index aaa7300..8e00f7b 100644 (file)
@@ -3349,3 +3349,13 @@ ecore_wl2_window_cursor_default_restore(Ecore_Wl2_Window *win)
      ecore_wl2_input_cursor_default_restore(input);
 }
 //
+
+//TIZEN_ONLY(20180810): support client demand move resize
+EAPI void
+ecore_wl2_window_sync_geometry_set(Ecore_Wl2_Window *window, uint32_t serial, int x, int y, int w, int h)
+{
+   if (!window) return;
+   if (window->display->wl.tz_moveresize)
+     tizen_move_resize_set_geometry(window->display->wl.tz_moveresize, window->surface, serial, x, y, w, h);
+}
+//