wayland: fix min/max size setting

also don't set arbitrary hints on init

@fix
This commit is contained in:
Mike Blumenkrantz 2017-08-04 16:11:00 -04:00
parent 70c118fab6
commit f03028d22f
3 changed files with 13 additions and 4 deletions

View 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;

View 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);

View 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