summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derek.foreman.samsung@gmail.com>2018-11-28 14:18:45 -0600
committerDerek Foreman <derek.foreman.samsung@gmail.com>2018-12-14 10:29:53 -0600
commitf53c7341c367e8c04c57650f182a186869eb7e54 (patch)
treee5e7a239598876bea5fa62ea07de1aa0d9a2fb93
parentb32e5da64130c34875507c3643eda9cd089f7743 (diff)
ecore_wl2: Replace direct usage of set_config.geometry with getters
I'm going to deal with some ugly geometry problems in the getter func shortly. Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com> Reviewed-by: Chris Michael <cp.michael@samsung.com> Differential Revision: https://phab.enlightenment.org/D7431
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c36
-rw-r--r--src/lib/ecore_wl2/window_v6.x10
2 files changed, 20 insertions, 26 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index df4045007b..87ef49dfe8 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -304,17 +304,16 @@ static const struct xdg_popup_listener _xdg_popup_listener =
304static void 304static void
305_ecore_wl2_window_xdg_popup_create(Ecore_Wl2_Window *win) 305_ecore_wl2_window_xdg_popup_create(Ecore_Wl2_Window *win)
306{ 306{
307 int gx, gy, gw, gh;
307 struct xdg_positioner *pos; 308 struct xdg_positioner *pos;
308 309
309 EINA_SAFETY_ON_NULL_RETURN(win->parent); 310 EINA_SAFETY_ON_NULL_RETURN(win->parent);
310 pos = xdg_wm_base_create_positioner(win->display->wl.xdg_wm_base); 311 pos = xdg_wm_base_create_positioner(win->display->wl.xdg_wm_base);
311 if (!pos) return; 312 if (!pos) return;
312 313
313 xdg_positioner_set_anchor_rect(pos, win->set_config.geometry.x, 314 ecore_wl2_window_geometry_get(win, &gx, &gy, &gw, &gh);
314 win->set_config.geometry.y, 315 xdg_positioner_set_anchor_rect(pos, gx, gy, 1, 1);
315 1, 1); 316 xdg_positioner_set_size(pos, gw, gh);
316 xdg_positioner_set_size(pos, win->set_config.geometry.w,
317 win->set_config.geometry.h);
318 xdg_positioner_set_anchor(pos, XDG_POSITIONER_ANCHOR_TOP_LEFT); 317 xdg_positioner_set_anchor(pos, XDG_POSITIONER_ANCHOR_TOP_LEFT);
319 xdg_positioner_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM | 318 xdg_positioner_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM |
320 ZXDG_POSITIONER_V6_ANCHOR_RIGHT); 319 ZXDG_POSITIONER_V6_ANCHOR_RIGHT);
@@ -408,20 +407,18 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
408 { 407 {
409 if (window->uuid) 408 if (window->uuid)
410 { 409 {
410 int gx, gy, gw, gh;
411
411 zwp_e_session_recovery_set_uuid(window->display->wl.session_recovery, 412 zwp_e_session_recovery_set_uuid(window->display->wl.session_recovery,
412 window->surface, window->uuid); 413 window->surface, window->uuid);
414
415 ecore_wl2_window_geometry_get(window, &gx, &gy, &gw, &gh);
413 if (window->xdg_surface) 416 if (window->xdg_surface)
414 xdg_surface_set_window_geometry(window->xdg_surface, 417 xdg_surface_set_window_geometry(window->xdg_surface,
415 window->set_config.geometry.x, 418 gx, gy, gw, gh);
416 window->set_config.geometry.y,
417 window->set_config.geometry.w,
418 window->set_config.geometry.h);
419 if (window->zxdg_surface) 419 if (window->zxdg_surface)
420 zxdg_surface_v6_set_window_geometry(window->zxdg_surface, 420 zxdg_surface_v6_set_window_geometry(window->zxdg_surface,
421 window->set_config.geometry.x, 421 gx, gy, gw, gh);
422 window->set_config.geometry.y,
423 window->set_config.geometry.w,
424 window->set_config.geometry.h);
425 422
426 ecore_wl2_window_opaque_region_set(window, 423 ecore_wl2_window_opaque_region_set(window,
427 window->opaque.x, 424 window->opaque.x,
@@ -1568,18 +1565,15 @@ ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush)
1568 /* Dispatch any state we've been saving along the way */ 1565 /* Dispatch any state we've been saving along the way */
1569 if (window->pending.geom) 1566 if (window->pending.geom)
1570 { 1567 {
1568 int gx, gy, gw, gh;
1569
1570 ecore_wl2_window_geometry_get(window, &gx, &gy, &gw, &gh);
1571 if (window->xdg_toplevel) 1571 if (window->xdg_toplevel)
1572 xdg_surface_set_window_geometry(window->xdg_surface, 1572 xdg_surface_set_window_geometry(window->xdg_surface,
1573 window->set_config.geometry.x, 1573 gx, gy, gw, gh);
1574 window->set_config.geometry.y,
1575 window->set_config.geometry.w,
1576 window->set_config.geometry.h);
1577 if (window->zxdg_surface) 1574 if (window->zxdg_surface)
1578 zxdg_surface_v6_set_window_geometry(window->zxdg_surface, 1575 zxdg_surface_v6_set_window_geometry(window->zxdg_surface,
1579 window->set_config.geometry.x, 1576 gx, gy, gw, gh);
1580 window->set_config.geometry.y,
1581 window->set_config.geometry.w,
1582 window->set_config.geometry.h);
1583 } 1577 }
1584 if (window->pending.opaque || window->pending.input) 1578 if (window->pending.opaque || window->pending.input)
1585 _regions_set(window); 1579 _regions_set(window);
diff --git a/src/lib/ecore_wl2/window_v6.x b/src/lib/ecore_wl2/window_v6.x
index 333586a2ac..24e453c057 100644
--- a/src/lib/ecore_wl2/window_v6.x
+++ b/src/lib/ecore_wl2/window_v6.x
@@ -107,16 +107,16 @@ static void
107_window_v6_popup_create(Ecore_Wl2_Window *win) 107_window_v6_popup_create(Ecore_Wl2_Window *win)
108{ 108{
109 struct zxdg_positioner_v6 *pos; 109 struct zxdg_positioner_v6 *pos;
110 int wx, wy, ww, wh;
110 111
111 EINA_SAFETY_ON_NULL_RETURN(win->parent); 112 EINA_SAFETY_ON_NULL_RETURN(win->parent);
112 pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell); 113 pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell);
113 if (!pos) return; 114 if (!pos) return;
114 115
115 zxdg_positioner_v6_set_anchor_rect(pos, win->set_config.geometry.x, 116 ecore_wl2_window_geometry_get(win, &wx, &wy, &ww, &wh);
116 win->set_config.geometry.y, 117
117 1, 1); 118 zxdg_positioner_v6_set_anchor_rect(pos, wx, wy, 1, 1);
118 zxdg_positioner_v6_set_size(pos, win->set_config.geometry.w, 119 zxdg_positioner_v6_set_size(pos, ww, wh);
119 win->set_config.geometry.h);
120 zxdg_positioner_v6_set_anchor(pos, ZXDG_POSITIONER_V6_ANCHOR_TOP | 120 zxdg_positioner_v6_set_anchor(pos, ZXDG_POSITIONER_V6_ANCHOR_TOP |
121 ZXDG_POSITIONER_V6_ANCHOR_LEFT); 121 ZXDG_POSITIONER_V6_ANCHOR_LEFT);
122 zxdg_positioner_v6_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM | 122 zxdg_positioner_v6_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM |