summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-10-20 13:23:12 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-10-25 10:44:16 -0400
commit36bf4cbc4e23724c4010d6cbbfa75c8091c1f5f5 (patch)
tree41b8ef8542cbe0cea606cf808e90a2923c7f9463
parent42c56cc33bea10eeeb48a650a96cb8520e445ac2 (diff)
wayland: expand efl-hints protocol to work for all types of xdg shell surfaces
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_display.c12
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c25
-rw-r--r--src/wayland_protocol/efl-hints.xml4
3 files changed, 26 insertions, 15 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c b/src/lib/ecore_wl2/ecore_wl2_display.c
index db7f479..1a2a24e 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -332,9 +332,15 @@ _cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const
332 332
333 ewd->wl.efl_hints = wl_registry_bind(registry, id, &efl_hints_interface, MIN(version, 2)); 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 {
336 efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_toplevel, 336 if (!window->zxdg_surface) continue;
337 window->aspect.w, window->aspect.h, window->aspect.aspect); 337 if (window->aspect.set)
338 efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_surface,
339 window->aspect.w, window->aspect.h, window->aspect.aspect);
340 if (window->weight.set)
341 efl_hints_set_weight(window->display->wl.efl_hints,
342 window->zxdg_surface, window->weight.w, window->weight.h);
343 }
338 } 344 }
339 345
340event: 346event:
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index c6cd351..f2a2131 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -323,6 +323,15 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
323 323
324 window->zxdg_configure_ack = zxdg_surface_v6_ack_configure; 324 window->zxdg_configure_ack = zxdg_surface_v6_ack_configure;
325 window->pending.configure = EINA_TRUE; 325 window->pending.configure = EINA_TRUE;
326 if (window->display->wl.efl_hints)
327 {
328 if (window->aspect.set)
329 efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_surface,
330 window->aspect.w, window->aspect.h, window->aspect.aspect);
331 if (window->weight.set)
332 efl_hints_set_weight(window->display->wl.efl_hints, window->zxdg_surface,
333 window->weight.w, window->weight.h);
334 }
326 335
327 if (window->type == ECORE_WL2_WINDOW_TYPE_MENU) 336 if (window->type == ECORE_WL2_WINDOW_TYPE_MENU)
328 _ecore_wl2_window_zxdg_popup_create(window); 337 _ecore_wl2_window_zxdg_popup_create(window);
@@ -355,12 +364,6 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
355 364
356 if (window->set_config.fullscreen) 365 if (window->set_config.fullscreen)
357 zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL); 366 zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL);
358 if (window->aspect.set && window->display->wl.efl_hints)
359 efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_toplevel,
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);
364 } 367 }
365 368
366 ecore_wl2_window_commit(window, EINA_TRUE); 369 ecore_wl2_window_commit(window, EINA_TRUE);
@@ -1342,9 +1345,10 @@ ecore_wl2_window_aspect_set(Ecore_Wl2_Window *window, int w, int h, unsigned int
1342 window->aspect.h = h; 1345 window->aspect.h = h;
1343 window->aspect.aspect = aspect; 1346 window->aspect.aspect = aspect;
1344 window->aspect.set = 1; 1347 window->aspect.set = 1;
1345 if (window->display->wl.efl_hints && window->zxdg_toplevel) 1348 if (!window->display->wl.efl_hints) return;
1349 if (window->zxdg_surface)
1346 efl_hints_set_aspect(window->display->wl.efl_hints, 1350 efl_hints_set_aspect(window->display->wl.efl_hints,
1347 window->zxdg_toplevel, w, h, aspect); 1351 window->zxdg_surface, w, h, aspect);
1348} 1352}
1349 1353
1350EAPI void 1354EAPI void
@@ -1362,9 +1366,10 @@ ecore_wl2_window_weight_set(Ecore_Wl2_Window *window, double w, double h)
1362 window->weight.w = ww; 1366 window->weight.w = ww;
1363 window->weight.h = hh; 1367 window->weight.h = hh;
1364 window->weight.set = 1; 1368 window->weight.set = 1;
1365 if (window->display->wl.efl_hints && window->zxdg_toplevel) 1369 if (!window->display->wl.efl_hints) return;
1370 if (window->zxdg_surface)
1366 efl_hints_set_weight(window->display->wl.efl_hints, 1371 efl_hints_set_weight(window->display->wl.efl_hints,
1367 window->zxdg_toplevel, ww, hh); 1372 window->zxdg_surface, ww, hh);
1368} 1373}
1369 1374
1370static void 1375static void
diff --git a/src/wayland_protocol/efl-hints.xml b/src/wayland_protocol/efl-hints.xml
index 64a40a8..9f2b775 100644
--- a/src/wayland_protocol/efl-hints.xml
+++ b/src/wayland_protocol/efl-hints.xml
@@ -9,13 +9,13 @@
9 <entry name="both" value="4"/> 9 <entry name="both" value="4"/>
10 </enum> 10 </enum>
11 <request name="set_aspect"> 11 <request name="set_aspect">
12 <arg name="surface" type="object" interface="zxdg_toplevel_v6"/> 12 <arg name="surface" type="object" interface="zxdg_surface_v6"/>
13 <arg name="width" type="uint"/> 13 <arg name="width" type="uint"/>
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"> 17 <request name="set_weight">
18 <arg name="surface" type="object" interface="zxdg_toplevel_v6"/> 18 <arg name="surface" type="object" interface="zxdg_surface_v6"/>
19 <arg name="width" type="int"/> 19 <arg name="width" type="int"/>
20 <arg name="height" type="int"/> 20 <arg name="height" type="int"/>
21 </request> 21 </request>