1 From 704d403b040c6255b391a26274c723008a1f188d Mon Sep 17 00:00:00 2001
2 From: Alexander Shalamov <alexander.shalamov@intel.com>
3 Date: Mon, 12 Aug 2013 17:58:36 +0300
4 Subject: [PATCH 22/33] Remove elm dependency from preserve_window_efl
7 ui/gfx/preserve_window_efl.cc | 14 ++++++++++++--
8 1 file changed, 12 insertions(+), 2 deletions(-)
10 diff --git a/ui/gfx/preserve_window_efl.cc b/ui/gfx/preserve_window_efl.cc
11 index 9c3fe3a..bed34a0 100644
12 --- a/ui/gfx/preserve_window_efl.cc
13 +++ b/ui/gfx/preserve_window_efl.cc
16 #include <Ecore_Evas.h>
18 -#include <Elementary.h>
21 #include "base/logging.h"
22 @@ -110,7 +109,18 @@ void evas_smart_preserve_window_smart_add(Evas_Object* o) {
23 evas_object_smart_data_set(o, smart_data);
26 - smart_data->window_ = ecore_x_window_new(elm_win_xwindow_get(o), 0, 0, 1, 1);
27 + Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(o));
28 + Ecore_X_Window x_window_id;
29 + const char* engine_name = ecore_evas_engine_name_get(ee);
30 + if (!strncmp(engine_name, "software_x11", 12)) {
31 + x_window_id = ecore_evas_software_x11_window_get(ee);
32 + } else if (!strncmp(engine_name, "opengl_x11", 10)) {
33 + x_window_id = ecore_evas_gl_x11_window_get(ee);
35 + LOG(FATAL) << "Unsupported Evas engine " << engine_name << "! Please add it to evas_smart_preserve_window_smart_add().";
38 + smart_data->window_ = ecore_x_window_new(x_window_id, 0, 0, 1, 1);
40 // Do not listen to any events in this new window, otherwise they will not be
41 // propagated to the parent X window (the one which is actually interested in