summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2015-01-08 11:54:04 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2015-01-12 08:23:35 +0200
commit754ed5471c34bffc47cacbd393ad383fbc644e0a (patch)
treea0cafc74af7b904f4f5e48616888a8b4aac16aa6
parent3d17bfd022bd34b3a9482b3e437a633223f71fda (diff)
DnD: fix callbacks deletion for inline windows.
During deletion of a window, widgets considered as droppable targets have to remove their DnD callbacks. To achieve this, elm_drop_target_del is called from the DEL callback (destructor). This function has to determine if X11 or Wayland is used. Since the parent is already unknown at this stage, only checking the engine name can give this information. On a regular window, the engine name is related to the target display. The problem happens when an inline window is used. The engine is a buffer and no information is given regarding the target display. The patch fixes it by checking the nature of the Ecore Evas parents. It supports nested windows (inline inside inline... inside XWin). @fix
-rw-r--r--src/lib/elm_cnp.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index ee44a3caa..363d85128 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -1901,7 +1901,23 @@ _x11_elm_widget_xwin_get(const Evas_Object *obj)
1901 if (!evas) return 0; 1901 if (!evas) return 0;
1902 ee = ecore_evas_ecore_evas_get(evas); 1902 ee = ecore_evas_ecore_evas_get(evas);
1903 if (!ee) return 0; 1903 if (!ee) return 0;
1904 xwin = _elm_ee_xwin_get(ee); 1904
1905 while(!xwin)
1906 {
1907 const char *engine_name = ecore_evas_engine_name_get(ee);
1908 if (!strcmp(engine_name, ELM_BUFFER))
1909 {
1910 ee = ecore_evas_buffer_ecore_evas_parent_get(ee);
1911 if (!ee) return 0;
1912 xwin = _elm_ee_xwin_get(ee);
1913 }
1914 else
1915 {
1916 /* In case the engine is not a buffer, we want to check once. */
1917 xwin = _elm_ee_xwin_get(ee);
1918 if (!xwin) return 0;
1919 }
1920 }
1905 } 1921 }
1906 return xwin; 1922 return xwin;
1907} 1923}
@@ -3492,7 +3508,22 @@ _wl_elm_widget_window_get(Evas_Object *obj)
3492 if (!(ee = ecore_evas_ecore_evas_get(evas))) 3508 if (!(ee = ecore_evas_ecore_evas_get(evas)))
3493 return 0; 3509 return 0;
3494 3510
3495 win = ecore_evas_wayland_window_get(ee); 3511 while(!win)
3512 {
3513 const char *engine_name = ecore_evas_engine_name_get(ee);
3514 if (!strcmp(engine_name, ELM_BUFFER))
3515 {
3516 ee = ecore_evas_buffer_ecore_evas_parent_get(ee);
3517 if (!ee) return 0;
3518 win = ecore_evas_wayland_window_get(ee);
3519 }
3520 else
3521 {
3522 /* In case the engine is not a buffer, we want to check once. */
3523 win = ecore_evas_wayland_window_get(ee);
3524 if (!win) return 0;
3525 }
3526 }
3496 } 3527 }
3497 3528
3498 return ecore_wl_window_id_get(win); 3529 return ecore_wl_window_id_get(win);