summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHosang Kim <hosang12.kim@samsung.com>2020-05-27 10:05:30 -0400
committerChristopher Michael <devilhorns@comcast.net>2020-05-27 10:05:30 -0400
commitd6ce6a8cd541d21cb6fe5bed910238c0cc1fdd00 (patch)
treebd78825b20e6f234af6a93b036495121edb559d4
parent28d41f4e6cb7e07d3a2d7685151beb65edfd77c0 (diff)
ecore_wl2_window: copy available rotation info.
Summary: ecore_wl2_window doesn't copy rotation information. If passed pointer is destroyed, rotation information disappears. So add memory allocating for managing information. Reviewers: CHAN, devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11891
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index 7d9de5775c..e11e2e30a3 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -739,6 +739,9 @@ ecore_wl2_window_free(Ecore_Wl2_Window *window)
739 if (window->class) eina_stringshare_del(window->class); 739 if (window->class) eina_stringshare_del(window->class);
740 if (window->role) eina_stringshare_del(window->role); 740 if (window->role) eina_stringshare_del(window->role);
741 741
742 if (window->wm_rot.available_rots) free(window->wm_rot.available_rots);
743 window->wm_rot.available_rots = NULL;
744
742 display->windows = 745 display->windows =
743 eina_inlist_remove(display->windows, EINA_INLIST_GET(window)); 746 eina_inlist_remove(display->windows, EINA_INLIST_GET(window));
744 747
@@ -1252,9 +1255,24 @@ ecore_wl2_window_preferred_rotation_get(Ecore_Wl2_Window *window)
1252EAPI void 1255EAPI void
1253ecore_wl2_window_available_rotations_set(Ecore_Wl2_Window *window, const int *rots, unsigned int count) 1256ecore_wl2_window_available_rotations_set(Ecore_Wl2_Window *window, const int *rots, unsigned int count)
1254{ 1257{
1258 unsigned int i = 0;
1255 EINA_SAFETY_ON_NULL_RETURN(window); 1259 EINA_SAFETY_ON_NULL_RETURN(window);
1260
1261 if (window->wm_rot.available_rots)
1262 {
1263 free(window->wm_rot.available_rots);
1264 window->wm_rot.available_rots = NULL;
1265 }
1256 window->wm_rot.count = count; 1266 window->wm_rot.count = count;
1257 window->wm_rot.available_rots = (int *)rots; 1267
1268 if (count >= 1)
1269 {
1270 window->wm_rot.available_rots = calloc(count, sizeof(int));
1271 if (!window->wm_rot.available_rots) return;
1272
1273 for (; i < count; i++)
1274 window->wm_rot.available_rots[i] = ((int *)rots)[i];
1275 }
1258} 1276}
1259 1277
1260EAPI Eina_Bool 1278EAPI Eina_Bool