summaryrefslogtreecommitdiff
path: root/src/lib/efl_wl/efl_wl.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-08-04 16:17:53 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-08-04 16:17:33 -0400
commitbe20f7d96c4bc2d4c9a9f5dc6dbc754d0aafa881 (patch)
tree930bf8c34f220b74bd7eb866ec9ae1afbfe2886b /src/lib/efl_wl/efl_wl.c
parent70afe70c9ab9c20b2b41380b8d0e7f19e1d33fa0 (diff)
efl-wl: support min/max hinting
@feature
Diffstat (limited to 'src/lib/efl_wl/efl_wl.c')
-rw-r--r--src/lib/efl_wl/efl_wl.c51
1 files changed, 49 insertions, 2 deletions
diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c
index 2a78282372..575012e0e6 100644
--- a/src/lib/efl_wl/efl_wl.c
+++ b/src/lib/efl_wl/efl_wl.c
@@ -144,6 +144,7 @@ typedef struct Comp
144 Eina_Bool x11_selection : 1; 144 Eina_Bool x11_selection : 1;
145 Eina_Bool rtl : 1; 145 Eina_Bool rtl : 1;
146 Eina_Bool aspect : 1; 146 Eina_Bool aspect : 1;
147 Eina_Bool minmax : 1;
147} Comp; 148} Comp;
148 149
149typedef struct Comp_Data_Device_Source Comp_Data_Device_Source; 150typedef struct Comp_Data_Device_Source Comp_Data_Device_Source;
@@ -1168,6 +1169,19 @@ shell_surface_activate_recurse(Comp_Surface *cs)
1168} 1169}
1169 1170
1170static void 1171static void
1172shell_surface_minmax_update(Comp_Surface *cs)
1173{
1174 int w, h;
1175
1176 if (!cs) return;
1177 if (!cs->c->minmax) return;
1178 evas_object_size_hint_min_get(cs->obj, &w, &h);
1179 evas_object_size_hint_min_set(cs->c->obj, w, h);
1180 evas_object_size_hint_max_get(cs->obj, &w, &h);
1181 evas_object_size_hint_max_set(cs->c->obj, w, h);
1182}
1183
1184static void
1171shell_surface_aspect_update(Comp_Surface *cs) 1185shell_surface_aspect_update(Comp_Surface *cs)
1172{ 1186{
1173 Evas_Aspect_Control aspect; 1187 Evas_Aspect_Control aspect;
@@ -1225,6 +1239,7 @@ shell_surface_send_configure(Comp_Surface *cs)
1225 if (ccs->shell.surface && ccs->role && ccs->shell.popup) 1239 if (ccs->shell.surface && ccs->role && ccs->shell.popup)
1226 ccs->shell.activated = cs->shell.activated; 1240 ccs->shell.activated = cs->shell.activated;
1227 shell_surface_aspect_update(cs); 1241 shell_surface_aspect_update(cs);
1242 shell_surface_minmax_update(cs);
1228 } 1243 }
1229 else 1244 else
1230 shell_surface_deactivate_recurse(cs); 1245 shell_surface_deactivate_recurse(cs);
@@ -3080,10 +3095,25 @@ static void
3080shell_surface_toplevel_move(){} 3095shell_surface_toplevel_move(){}
3081static void 3096static void
3082shell_surface_toplevel_resize(){} 3097shell_surface_toplevel_resize(){}
3098
3083static void 3099static void
3084shell_surface_toplevel_set_max_size(){} 3100shell_surface_toplevel_set_max_size(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t w, int32_t h)
3101{
3102 Comp_Surface *cs = wl_resource_get_user_data(resource);
3103 evas_object_size_hint_max_set(cs->obj, w, h);
3104 if (cs == cs->c->active_surface)
3105 shell_surface_minmax_update(cs);
3106}
3107
3085static void 3108static void
3086shell_surface_toplevel_set_min_size(){} 3109shell_surface_toplevel_set_min_size(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t w, int32_t h)
3110{
3111 Comp_Surface *cs = wl_resource_get_user_data(resource);
3112 evas_object_size_hint_min_set(cs->obj, w, h);
3113 if (cs == cs->c->active_surface)
3114 shell_surface_minmax_update(cs);
3115}
3116
3087static void 3117static void
3088shell_surface_toplevel_set_maximized(){} 3118shell_surface_toplevel_set_maximized(){}
3089static void 3119static void
@@ -5373,3 +5403,20 @@ efl_wl_aspect_set(Evas_Object *obj, Eina_Bool set)
5373 else 5403 else
5374 evas_object_size_hint_aspect_set(obj, EVAS_ASPECT_CONTROL_NONE, 0, 0); 5404 evas_object_size_hint_aspect_set(obj, EVAS_ASPECT_CONTROL_NONE, 0, 0);
5375} 5405}
5406
5407void
5408efl_wl_minmax_set(Evas_Object *obj, Eina_Bool set)
5409{
5410 Comp *c;
5411
5412 if (!eina_streq(evas_object_type_get(obj), "comp")) abort();
5413 c = evas_object_smart_data_get(obj);
5414 c->minmax = !!set;
5415 if (c->minmax)
5416 shell_surface_minmax_update(c->active_surface);
5417 else
5418 {
5419 evas_object_size_hint_min_set(obj, 0, 0);
5420 evas_object_size_hint_max_set(obj, -1, -1);
5421 }
5422}