summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-09-26 16:15:07 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-09-26 16:44:45 +0900
commitd567faa7787afb3d478f1c857cb28ab4fa0e5fc3 (patch)
tree8c9fab44527ff6259924eb19e267dccf5c479963 /src/lib/elementary
parentabc075aeb3ef53e7c879e548f4280a48ed477639 (diff)
Fix infinite recursion for legacy + efl ui win events
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_win.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index ae7354a026..30d4d3d492 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -1853,6 +1853,14 @@ EFL_CALLBACKS_ARRAY_DEFINE(_elm_win_evas_feed_fake_callbacks,
1853{ EFL_EVENT_KEY_DOWN, _evas_event_key_feed_fake_cb }, 1853{ EFL_EVENT_KEY_DOWN, _evas_event_key_feed_fake_cb },
1854{ EFL_EVENT_KEY_UP, _evas_event_key_feed_fake_cb }) 1854{ EFL_EVENT_KEY_UP, _evas_event_key_feed_fake_cb })
1855 1855
1856#define RECURSE_PROTECT(x) \
1857 do { static int calling = 0; \
1858 if (calling) return; \
1859 calling++; \
1860 x; \
1861 calling--; \
1862 } while (0)
1863
1856static void 1864static void
1857_elm_win_evas_render_post(void *data, 1865_elm_win_evas_render_post(void *data,
1858 Evas *e EINA_UNUSED, 1866 Evas *e EINA_UNUSED,
@@ -1861,7 +1869,7 @@ _elm_win_evas_render_post(void *data,
1861 Efl_Gfx_Event_Render_Post *ev = event_info; 1869 Efl_Gfx_Event_Render_Post *ev = event_info;
1862 Eo *win = data; 1870 Eo *win = data;
1863 1871
1864 efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_RENDER_POST, ev); 1872 RECURSE_PROTECT(efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_RENDER_POST, ev));
1865} 1873}
1866 1874
1867static void 1875static void
@@ -1872,7 +1880,7 @@ _elm_win_evas_render_pre(void *data,
1872 Eo *win = data; 1880 Eo *win = data;
1873 1881
1874 _elm_win_throttle_ok = EINA_TRUE; 1882 _elm_win_throttle_ok = EINA_TRUE;
1875 efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_RENDER_PRE, NULL); 1883 RECURSE_PROTECT(efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_RENDER_PRE, NULL));
1876} 1884}
1877 1885
1878static void 1886static void
@@ -1883,7 +1891,7 @@ _elm_win_evas_focus_in(void *data,
1883 Eo *win = data; 1891 Eo *win = data;
1884 1892
1885 _elm_win_throttle_ok = EINA_TRUE; 1893 _elm_win_throttle_ok = EINA_TRUE;
1886 efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_FOCUS_IN, NULL); 1894 RECURSE_PROTECT(efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_FOCUS_IN, NULL));
1887} 1895}
1888 1896
1889static void 1897static void
@@ -1893,7 +1901,7 @@ _elm_win_evas_focus_out(void *data,
1893{ 1901{
1894 Eo *win = data; 1902 Eo *win = data;
1895 1903
1896 efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_FOCUS_OUT, NULL); 1904 RECURSE_PROTECT(efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_FOCUS_OUT, NULL));
1897} 1905}
1898 1906
1899static void 1907static void
@@ -1905,7 +1913,7 @@ _elm_win_evas_object_focus_in(void *data,
1905 Eo *win = data; 1913 Eo *win = data;
1906 1914
1907 _elm_win_throttle_ok = EINA_TRUE; 1915 _elm_win_throttle_ok = EINA_TRUE;
1908 efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_OBJECT_FOCUS_IN, object); 1916 RECURSE_PROTECT(efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_OBJECT_FOCUS_IN, object));
1909} 1917}
1910 1918
1911static void 1919static void
@@ -1916,7 +1924,7 @@ _elm_win_evas_object_focus_out(void *data,
1916 Eo *object = event_info; 1924 Eo *object = event_info;
1917 Eo *win = data; 1925 Eo *win = data;
1918 1926
1919 efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_OBJECT_FOCUS_OUT, object); 1927 RECURSE_PROTECT(efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_OBJECT_FOCUS_OUT, object));
1920} 1928}
1921 1929
1922static void 1930static void
@@ -1927,7 +1935,7 @@ _elm_win_evas_device_changed(void *data,
1927 Eo *device = event_info; 1935 Eo *device = event_info;
1928 Eo *win = data; 1936 Eo *win = data;
1929 1937
1930 efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_DEVICE_CHANGED, device); 1938 RECURSE_PROTECT(efl_event_callback_legacy_call(win, EFL_CANVAS_EVENT_DEVICE_CHANGED, device));
1931} 1939}
1932 1940
1933static void 1941static void