els_tooltip: Don't expect to have X running if support is compiled in
authorDaniel Willmann <d.willmann@samsung.com>
Tue, 11 Jun 2013 10:18:25 +0000 (11:18 +0100)
committerDaniel Willmann <d.willmann@samsung.com>
Tue, 11 Jun 2013 13:33:27 +0000 (14:33 +0100)
Refactor the code so common code is not duplicated inside the
if (transparent) and else blocks

Backport 3112de826b33ffb847c8df827f172772f2f0ef96

Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
src/lib/els_tooltip.c

index 2e86a2589a56e1f2dfddf614997b2ca3feb8ca08..4c28b28d906f0738344817db9eeddc1429201dbe 100644 (file)
@@ -302,20 +302,19 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt)
                {
                   evas_object_hide(tt->tt_win);
                   elm_win_alpha_set(tt->tt_win, EINA_TRUE);
-#ifdef HAVE_ELEMENTARY_X
-                  ecore_x_window_shape_input_rectangle_set(elm_win_xwindow_get(tt->tt_win), 0, 0, 0, 0);
-#endif
-                  evas_object_show(tt->tt_win);
                }
              else
                {
                   evas_object_hide(tt->tt_win);
                   elm_win_alpha_set(tt->tt_win, EINA_FALSE);
+               }
 #ifdef HAVE_ELEMENTARY_X
-                  ecore_x_window_shape_input_rectangle_set(elm_win_xwindow_get(tt->tt_win), 0, 0, 0, 0);
+             Ecore_X_Window win;
+             win = elm_win_xwindow_get(tt->tt_win);
+             if (win)
+               ecore_x_window_shape_input_rectangle_set(win, 0, 0, 0, 0);
 #endif
-                  evas_object_show(tt->tt_win);
-               }
+             evas_object_show(tt->tt_win);
           }
 
         str = edje_object_data_get(tt->tooltip, "pad_x");