summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_display.c2
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_private.h8
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c23
-rw-r--r--src/lib/efl_wl/efl_wl.c14
-rw-r--r--src/lib/elementary/efl_ui_win.c11
-rw-r--r--src/lib/elementary/efl_ui_win.eo1
-rw-r--r--src/wayland_protocol/efl-hints.xml5
7 files changed, 61 insertions, 3 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c b/src/lib/ecore_wl2/ecore_wl2_display.c
index 1780371524..db7f47999a 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -330,7 +330,7 @@ _cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const
330 { 330 {
331 Ecore_Wl2_Window *window; 331 Ecore_Wl2_Window *window;
332 332
333 ewd->wl.efl_hints = wl_registry_bind(registry, id, &efl_hints_interface, 1); 333 ewd->wl.efl_hints = wl_registry_bind(registry, id, &efl_hints_interface, MIN(version, 2));
334 EINA_INLIST_FOREACH(ewd->windows, window) 334 EINA_INLIST_FOREACH(ewd->windows, window)
335 if (window->zxdg_toplevel && window->aspect.set) 335 if (window->zxdg_toplevel && window->aspect.set)
336 efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_toplevel, 336 efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_toplevel,
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h
index e8e95b6a57..dc345bce7a 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -199,6 +199,12 @@ struct _Ecore_Wl2_Window
199 Eina_Bool set : 1; 199 Eina_Bool set : 1;
200 } aspect; 200 } aspect;
201 201
202 struct
203 {
204 int w, h;
205 Eina_Bool set : 1;
206 } weight;
207
202 Eina_Inlist *subsurfs; 208 Eina_Inlist *subsurfs;
203 Eina_List *supported_aux_hints; 209 Eina_List *supported_aux_hints;
204 Eina_List *frame_callbacks; 210 Eina_List *frame_callbacks;
@@ -549,6 +555,8 @@ void _ecore_wl2_window_semi_free(Ecore_Wl2_Window *window);
549void _ecore_wl2_offer_unref(Ecore_Wl2_Offer *offer); 555void _ecore_wl2_offer_unref(Ecore_Wl2_Offer *offer);
550Eina_Bool _ecore_wl2_display_sync_get(void); 556Eina_Bool _ecore_wl2_display_sync_get(void);
551 557
558EAPI void ecore_wl2_window_weight_set(Ecore_Wl2_Window *window, double w, double h);
559
552EAPI extern int _ecore_wl2_event_window_www; 560EAPI extern int _ecore_wl2_event_window_www;
553EAPI extern int _ecore_wl2_event_window_www_drag; 561EAPI extern int _ecore_wl2_event_window_www_drag;
554 562
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index b33e4240d0..c6cd35135a 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -358,6 +358,9 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
358 if (window->aspect.set && window->display->wl.efl_hints) 358 if (window->aspect.set && window->display->wl.efl_hints)
359 efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_toplevel, 359 efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_toplevel,
360 window->aspect.w, window->aspect.h, window->aspect.aspect); 360 window->aspect.w, window->aspect.h, window->aspect.aspect);
361 if (window->weight.set && window->display->wl.efl_hints)
362 efl_hints_set_weight(window->display->wl.efl_hints, window->zxdg_toplevel,
363 window->weight.w, window->weight.h);
361 } 364 }
362 365
363 ecore_wl2_window_commit(window, EINA_TRUE); 366 ecore_wl2_window_commit(window, EINA_TRUE);
@@ -1344,6 +1347,26 @@ ecore_wl2_window_aspect_set(Ecore_Wl2_Window *window, int w, int h, unsigned int
1344 window->zxdg_toplevel, w, h, aspect); 1347 window->zxdg_toplevel, w, h, aspect);
1345} 1348}
1346 1349
1350EAPI void
1351ecore_wl2_window_weight_set(Ecore_Wl2_Window *window, double w, double h)
1352{
1353 int ww, hh;
1354 EINA_SAFETY_ON_NULL_RETURN(window);
1355
1356 ww = lround(w * 100);
1357 hh = lround(h * 100);
1358
1359 if ((window->weight.w == ww) && (window->weight.h == hh))
1360 return;
1361
1362 window->weight.w = ww;
1363 window->weight.h = hh;
1364 window->weight.set = 1;
1365 if (window->display->wl.efl_hints && window->zxdg_toplevel)
1366 efl_hints_set_weight(window->display->wl.efl_hints,
1367 window->zxdg_toplevel, ww, hh);
1368}
1369
1347static void 1370static void
1348_frame_cb(void *data, struct wl_callback *callback, uint32_t timestamp) 1371_frame_cb(void *data, struct wl_callback *callback, uint32_t timestamp)
1349{ 1372{
diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c
index 7e76d2a765..de86613a9f 100644
--- a/src/lib/efl_wl/efl_wl.c
+++ b/src/lib/efl_wl/efl_wl.c
@@ -326,6 +326,7 @@ struct Comp_Surface
326 Eina_Bool dead : 1; 326 Eina_Bool dead : 1;
327 Eina_Bool commit : 1; 327 Eina_Bool commit : 1;
328 Eina_Bool extracted : 1; 328 Eina_Bool extracted : 1;
329 Eina_Bool hint_set_weight : 1;
329}; 330};
330 331
331struct Comp_Subsurface 332struct Comp_Subsurface
@@ -4997,9 +4998,18 @@ hints_set_aspect(struct wl_client *client, struct wl_resource *resource, struct
4997 shell_surface_aspect_update(cs); 4998 shell_surface_aspect_update(cs);
4998} 4999}
4999 5000
5001static void
5002hints_set_weight(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface, int w, int h)
5003{
5004 Comp_Surface *cs = wl_resource_get_user_data(surface);
5005 cs->hint_set_weight = 1;
5006 evas_object_size_hint_weight_set(cs->obj, w / 100., h / 100.);
5007}
5008
5000static const struct efl_hints_interface hints_interface = 5009static const struct efl_hints_interface hints_interface =
5001{ 5010{
5002 hints_set_aspect, 5011 hints_set_aspect,
5012 hints_set_weight,
5003}; 5013};
5004 5014
5005static void 5015static void
@@ -5496,7 +5506,7 @@ efl_wl_minmax_set(Evas_Object *obj, Eina_Bool set)
5496 } 5506 }
5497} 5507}
5498 5508
5499EAPI void * 5509void *
5500efl_wl_global_add(Evas_Object *obj, const void *interface, uint32_t version, void *data, void *bind_cb) 5510efl_wl_global_add(Evas_Object *obj, const void *interface, uint32_t version, void *data, void *bind_cb)
5501{ 5511{
5502 Comp *c; 5512 Comp *c;
@@ -5543,7 +5553,7 @@ extracted_changed(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event
5543 shell_surface_send_configure(data); 5553 shell_surface_send_configure(data);
5544} 5554}
5545 5555
5546EAPI Eina_Bool 5556Eina_Bool
5547efl_wl_surface_extract(Evas_Object *surface) 5557efl_wl_surface_extract(Evas_Object *surface)
5548{ 5558{
5549 Comp_Surface *cs; 5559 Comp_Surface *cs;
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 77205592c1..09615f78f8 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -5977,6 +5977,17 @@ _efl_ui_win_efl_gfx_size_hint_hint_aspect_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Da
5977} 5977}
5978 5978
5979EOLIAN static void 5979EOLIAN static void
5980_efl_ui_win_efl_gfx_size_hint_hint_weight_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd,
5981 double w, double h)
5982{
5983 efl_gfx_size_hint_weight_set(efl_super(obj, MY_CLASS), w, h);
5984#ifdef HAVE_ELEMENTARY_WL2
5985 if (pd->wl.win)
5986 ecore_wl2_window_weight_set(pd->wl.win, w, h);
5987#endif
5988}
5989
5990EOLIAN static void
5980_efl_ui_win_efl_gfx_size_hint_hint_base_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Size2D sz) 5991_efl_ui_win_efl_gfx_size_hint_hint_base_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Size2D sz)
5981{ 5992{
5982 sd->size_base_w = sz.w; 5993 sd->size_base_w = sz.w;
diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo
index d194dd294d..b7b7213e26 100644
--- a/src/lib/elementary/efl_ui_win.eo
+++ b/src/lib/elementary/efl_ui_win.eo
@@ -843,6 +843,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Access.Window,
843 Efl.Gfx.Size.Hint.hint_base { get; set; } 843 Efl.Gfx.Size.Hint.hint_base { get; set; }
844 Efl.Gfx.Size.Hint.hint_step { get; set; } 844 Efl.Gfx.Size.Hint.hint_step { get; set; }
845 Efl.Gfx.Size.Hint.hint_aspect { set; } 845 Efl.Gfx.Size.Hint.hint_aspect { set; }
846 Efl.Gfx.Size.Hint.hint_weight { set; }
846 Efl.Gfx.Size.Hint.hint_max { set; } 847 Efl.Gfx.Size.Hint.hint_max { set; }
847 Efl.Text.text { get; set; } 848 Efl.Text.text { get; set; }
848 Efl.Canvas.pointer_position { get; } 849 Efl.Canvas.pointer_position { get; }
diff --git a/src/wayland_protocol/efl-hints.xml b/src/wayland_protocol/efl-hints.xml
index 51689d780c..64a40a8804 100644
--- a/src/wayland_protocol/efl-hints.xml
+++ b/src/wayland_protocol/efl-hints.xml
@@ -14,6 +14,11 @@
14 <arg name="height" type="uint"/> 14 <arg name="height" type="uint"/>
15 <arg name="aspect" type="uint" enum="aspect"/> 15 <arg name="aspect" type="uint" enum="aspect"/>
16 </request> 16 </request>
17 <request name="set_weight">
18 <arg name="surface" type="object" interface="zxdg_toplevel_v6"/>
19 <arg name="width" type="int"/>
20 <arg name="height" type="int"/>
21 </request>
17 </interface> 22 </interface>
18 23
19</protocol> 24</protocol>