summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-04-05 13:01:22 -0500
committerDerek Foreman <derekf@osg.samsung.com>2018-04-20 13:00:28 -0500
commit0ca813dbd07e549f0c20f75e930d741c7a259e31 (patch)
tree279916c9503bd4888c8ea8db4b53945096a76d67 /src/lib/ecore_wl2
parent486bd23ca15a06ea094bd3bdd0f3cbf18c826f2a (diff)
ecore_wl2: Refactor region create
Trivial refactor
Diffstat (limited to 'src/lib/ecore_wl2')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index 6552d5ced3..c86ea27f03 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -1527,6 +1527,23 @@ _fullscreen_set(Ecore_Wl2_Window *window)
1527 } 1527 }
1528} 1528}
1529 1529
1530static struct wl_region *
1531_region_create(struct wl_compositor *comp, int x, int y, int w, int h)
1532{
1533 struct wl_region *out;
1534
1535 out = wl_compositor_create_region(comp);
1536 if (!out)
1537 {
1538 ERR("Failed to create region");
1539 return NULL;
1540 }
1541
1542 wl_region_add(out, x, y, w, h);
1543
1544 return out;
1545}
1546
1530static void 1547static void
1531_input_set(Ecore_Wl2_Window *window) 1548_input_set(Ecore_Wl2_Window *window)
1532{ 1549{
@@ -1540,15 +1557,10 @@ _input_set(Ecore_Wl2_Window *window)
1540 return; 1557 return;
1541 } 1558 }
1542 1559
1543 region = wl_compositor_create_region(window->display->wl.compositor); 1560 region = _region_create(window->display->wl.compositor,
1544 if (!region) 1561 window->input_rect.x, window->input_rect.y,
1545 { 1562 window->input_rect.w, window->input_rect.h);
1546 ERR("Failed to create input region"); 1563 if (!region) return;
1547 return;
1548 }
1549
1550 wl_region_add(region, window->input_rect.x, window->input_rect.y,
1551 window->input_rect.w, window->input_rect.h);
1552 wl_surface_set_input_region(window->surface, region); 1564 wl_surface_set_input_region(window->surface, region);
1553 wl_region_destroy(region); 1565 wl_region_destroy(region);
1554} 1566}
@@ -1564,15 +1576,10 @@ _opaque_set(Ecore_Wl2_Window *window)
1564 return; 1576 return;
1565 } 1577 }
1566 1578
1567 region = wl_compositor_create_region(window->display->wl.compositor); 1579 region = _region_create(window->display->wl.compositor,
1568 if (!region) 1580 window->opaque.x, window->opaque.y,
1569 { 1581 window->opaque.w, window->opaque.h);
1570 ERR("Failed to create opaque region"); 1582 if (!region) return;
1571 return;
1572 }
1573
1574 wl_region_add(region, window->opaque.x, window->opaque.y,
1575 window->opaque.w, window->opaque.h);
1576 wl_surface_set_opaque_region(window->surface, region); 1583 wl_surface_set_opaque_region(window->surface, region);
1577 wl_region_destroy(region); 1584 wl_region_destroy(region);
1578} 1585}