*/
EventHandler( Window* window )
: mWindow( window ),
- mWindowPropertyHandler( ecore_event_handler_add( ECORE_X_EVENT_WINDOW_PROPERTY, EcoreEventWindowPropertyChanged, this ) ),
- mClientMessagehandler( ecore_event_handler_add( ECORE_X_EVENT_CLIENT_MESSAGE, EcoreEventClientMessage, this ) ),
+ mWindowPropertyHandler( NULL ),
+ mClientMessagehandler( NULL ),
mEcoreWindow( 0 )
{
// store ecore window handle
&tmp, 1);
#endif // DALI_PROFILE_UBUNTU
- ecore_x_input_multi_select( mEcoreWindow );
+ if( mWindow->mEcoreEventHander )
+ {
+ ecore_x_input_multi_select( mEcoreWindow );
+ mWindowPropertyHandler= ecore_event_handler_add( ECORE_X_EVENT_WINDOW_PROPERTY, EcoreEventWindowPropertyChanged, this );
+ mClientMessagehandler = ecore_event_handler_add( ECORE_X_EVENT_CLIENT_MESSAGE, EcoreEventClientMessage, this );
+ }
+
}
/**
};
-Window* Window::New(const PositionSize& posSize, const std::string& name, bool isTransparent)
+Window* Window::New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent)
{
Window* window = new Window();
window->mIsTransparent = isTransparent;
- window->Initialize(posSize, name);
+ window->Initialize(posSize, name, className);
return window;
}
mStarted(false),
mIsTransparent(false),
mWMRotationAppSet(false),
+ mEcoreEventHander(true),
mIndicator(NULL),
mIndicatorOrientation(Dali::Window::PORTRAIT),
mNextIndicatorOrientation(Dali::Window::PORTRAIT),
mEventHandler(NULL),
mPreferredOrientation(Dali::Window::PORTRAIT)
{
+
+ // Detect if we're not running in a ecore main loop (e.g. libuv).
+ // Typically ecore_x_init is called by app_efl_main->elm_init
+ // but if we're not using app_efl_main then we have to call it ourselves
+ // This is a hack until we create a pure X Window class
+ if( ecore_x_display_get() == NULL )
+ {
+ mEcoreEventHander = false;
+ ecore_x_init (NULL); // internally calls _ecore_x_input_init
+ }
+
}
Window::~Window()
delete mSurface;
}
-void Window::Initialize(const PositionSize& windowPosition, const std::string& name)
+void Window::Initialize(const PositionSize& windowPosition, const std::string& name, const std::string& className)
{
// create an X11 window by default
Any surface;
- ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( windowPosition, surface, name, mIsTransparent );
+ ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( windowPosition, surface, name, className, mIsTransparent );
windowSurface->Map();
mSurface = windowSurface;
mAdaptor = NULL;
}
-OrientationPtr Window::GetOrientation()
-{
- return mOrientation;
-}
-
void Window::AddAvailableOrientation(Dali::Window::WindowOrientation orientation)
{
bool found = false;