wayland: fix min/max size setting
authorMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 4 Aug 2017 20:11:00 +0000 (16:11 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 4 Aug 2017 20:10:42 +0000 (16:10 -0400)
also don't set arbitrary hints on init

@fix

src/lib/ecore_wl2/ecore_wl2_private.h
src/lib/ecore_wl2/ecore_wl2_window.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c

index 1055d7a..3569db9 100644 (file)
@@ -170,6 +170,8 @@ struct _Ecore_Wl2_Window
    uint32_t configure_serial;
    void (*configure_ack)(struct xdg_surface *surface, uint32_t serial);
    void (*zxdg_configure_ack)(struct zxdg_surface_v6 *surface, uint32_t serial);
+   void (*zxdg_set_min_size)(struct zxdg_toplevel_v6 *toplevel, int32_t w, int32_t h);
+   void (*zxdg_set_max_size)(struct zxdg_toplevel_v6 *toplevel, int32_t w, int32_t h);
 
    Eina_Rectangle saved;
    Eina_Rectangle geometry;
index ba7f4e7..78f6129 100644 (file)
@@ -459,8 +459,8 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
         if (window->class)
           zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class);
 
-        zxdg_toplevel_v6_set_min_size(window->zxdg_toplevel, 1, 1);
-        zxdg_toplevel_v6_set_max_size(window->zxdg_toplevel, 32767, 32767);
+        window->zxdg_set_min_size = zxdg_toplevel_v6_set_min_size;
+        window->zxdg_set_max_size = zxdg_toplevel_v6_set_max_size;
 
         window->zxdg_configure_ack = zxdg_surface_v6_ack_configure;
         _ecore_wl2_window_type_set(window);
index df0a6ba..0bf78dd 100644 (file)
@@ -1434,27 +1434,34 @@ _ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *
 static void
 _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h)
 {
+   Ecore_Evas_Engine_Wl_Data *wdata;
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
    if (!ee) return;
+
    if (w < 0) w = 0;
    if (h < 0) h = 0;
    if ((ee->prop.min.w == w) && (ee->prop.min.h == h)) return;
    ee->prop.min.w = w;
    ee->prop.min.h = h;
+   wdata = ee->engine.data;
+   if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel)
+     wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, w, h);
 }
 
 static void
 _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h)
 {
+   Ecore_Evas_Engine_Wl_Data *wdata;
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
    if (!ee) return;
-   if (w < 0) w = 0;
-   if (h < 0) h = 0;
    if ((ee->prop.max.w == w) && (ee->prop.max.h == h)) return;
    ee->prop.max.w = w;
    ee->prop.max.h = h;
+   wdata = ee->engine.data;
+   if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel)
+     wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, w, h);
 }
 
 static void