Window* Window::New(Any surface, const std::string& name, const std::string& className, const WindowData& windowData)
{
- Window* window = new Window();
- window->mIsTransparent = windowData.GetTransparency();
+ Window* window = new Window();
+ window->mIsTransparent = windowData.GetTransparency();
+ window->mIsFrontBufferRendering = windowData.GetFrontBufferRendering();
window->Initialize(surface, windowData.GetPositionSize(), name, className, windowData.GetWindowType());
return window;
}
mFocused(false),
mIsWindowRotating(false),
mIsEnabledUserGeometry(false),
- mIsEmittedWindowCreatedEvent(false)
+ mIsEmittedWindowCreatedEvent(false),
+ mIsFrontBufferRendering(false)
{
}
// For Debugging
mNativeWindowId = mWindowBase->GetNativeWindowId();
+
+ if(mIsFrontBufferRendering)
+ {
+ SetFrontBufferRendering(mIsFrontBufferRendering);
+ }
}
void Window::SetRenderNotification(TriggerEventInterface* renderNotification)
mEventHandler = EventHandlerPtr(new EventHandler(mWindowSurface->GetWindowBase(), *mAdaptor));
mEventHandler->AddObserver(*this);
+ if(mWindowBase->GetType() == WindowType::IME)
+ {
+ mWindowBase->InitializeIme();
+ mWindowSurface->InitializeImeSurface();
+ }
+
// Add Window to bridge for ATSPI
auto bridge = Accessibility::Bridge::GetCurrentBridge();
OnAccessibilityDisabled();
}
+ if(mScene)
+ {
+ bool isGeometry = Dali::Internal::Adaptor::WindowSystem::IsGeometryHittestEnabled();
+ mScene.SetGeometryHittestEnabled(isGeometry);
+
+ mScene.SetNativeId(GetNativeId());
+ }
+
// If you call the 'Show' before creating the adaptor, the application cannot know the app resource id.
// The show must be called after the adaptor is initialized.
Show();
mResizeSignal.Emit(handle, newSize);
mAdaptor->SurfaceResizeComplete(mSurface.get(), newSize);
+
+ if(Dali::Accessibility::IsUp())
+ {
+ Dali::Accessibility::Accessible::Get(mScene.GetRootLayer())->EmitBoundsChanged(Dali::Rect<>(oldRect.x, oldRect.y, size.GetWidth(), size.GetHeight()));
+ }
}
mSurface->SetFullSwapNextFrame();
-
- Dali::Accessibility::Accessible::Get(mScene.GetRootLayer())->EmitBoundsChanged(Dali::Rect<>(oldRect.x, oldRect.y, size.GetWidth(), size.GetHeight()));
}
Dali::Window::WindowSize Window::GetSize() const
DALI_LOG_RELEASE_INFO("send moved signal with new position: %d, %d\n", newPosition.GetX(), newPosition.GetY());
mMovedSignal.Emit(handle, newPosition);
+
+ if(Dali::Accessibility::IsUp())
+ {
+ Dali::Accessibility::Accessible::Get(mScene.GetRootLayer())->EmitBoundsChanged(Dali::Rect<>(position.GetX(), position.GetY(), oldRect.width, oldRect.height));
+ }
}
mSurface->SetFullSwapNextFrame();
-
- Dali::Accessibility::Accessible::Get(mScene.GetRootLayer())->EmitBoundsChanged(Dali::Rect<>(position.GetX(), position.GetY(), oldRect.width, oldRect.height));
}
Dali::Window::WindowPosition Window::GetPosition() const
mAdaptor->SurfaceResizeComplete(mSurface.get(), newSize);
}
- mSurface->SetFullSwapNextFrame();
+ if((moved || resize) && Dali::Accessibility::IsUp())
+ {
+ Dali::Accessibility::Accessible::Get(mScene.GetRootLayer())->EmitBoundsChanged(Dali::Rect<>(positionSize.x, positionSize.y, positionSize.width, positionSize.height));
+ }
- Dali::Accessibility::Accessible::Get(mScene.GetRootLayer())->EmitBoundsChanged(Dali::Rect<>(positionSize.x, positionSize.y, positionSize.width, positionSize.height));
+ mSurface->SetFullSwapNextFrame();
}
void Window::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
mAdaptor->SurfaceResizeComplete(mSurface.get(), newSize);
}
- mSurface->SetFullSwapNextFrame();
+ if((moved || resize) && Dali::Accessibility::IsUp())
+ {
+ Dali::Accessibility::Accessible::Get(mScene.GetRootLayer())->EmitBoundsChanged(Dali::Rect<>(positionSize.x, positionSize.y, positionSize.width, positionSize.height));
+ }
- Dali::Accessibility::Accessible::Get(mScene.GetRootLayer())->EmitBoundsChanged(Dali::Rect<>(positionSize.x, positionSize.y, positionSize.width, positionSize.height));
+ mSurface->SetFullSwapNextFrame();
}
void Window::OnTouchPoint(Dali::Integration::Point& point, int timeStamp)
void Window::OnKeyEvent(Dali::Integration::KeyEvent& keyEvent)
{
mLastKeyEvent = Dali::DevelKeyEvent::New(keyEvent.keyName, keyEvent.logicalKey, keyEvent.keyString, keyEvent.keyCode, keyEvent.keyModifier, keyEvent.time, static_cast<Dali::KeyEvent::State>(keyEvent.state), keyEvent.compose, keyEvent.deviceName, keyEvent.deviceClass, keyEvent.deviceSubclass);
+ DevelKeyEvent::SetWindowId(mLastKeyEvent, keyEvent.windowId);
FeedKeyEvent(keyEvent);
}
auto bridge = Accessibility::Bridge::GetCurrentBridge();
auto rootLayer = mScene.GetRootLayer();
auto accessible = Accessibility::Accessible::Get(rootLayer);
- bridge->AddTopLevelWindow(accessible);
DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Accessibility is enabled\n", this, mNativeWindowId);
+ bridge->AddTopLevelWindow(accessible);
+ InterceptKeyEventSignal().Connect(this, &Window::OnAccessibilityInterceptKeyEvent);
+
Dali::Window handle(this);
if(!mIsEmittedWindowCreatedEvent)
{
auto bridge = Accessibility::Bridge::GetCurrentBridge();
auto rootLayer = mScene.GetRootLayer();
auto accessible = Accessibility::Accessible::Get(rootLayer);
- bridge->RemoveTopLevelWindow(accessible);
+
DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Accessibility is disabled\n", this, mNativeWindowId);
+
+ InterceptKeyEventSignal().Disconnect(this, &Window::OnAccessibilityInterceptKeyEvent);
+ bridge->RemoveTopLevelWindow(accessible);
+}
+
+bool Window::OnAccessibilityInterceptKeyEvent(const Dali::KeyEvent& keyEvent)
+{
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+
+ if(!bridge->IsUp() || keyEvent.IsNoInterceptModifier())
+ {
+ DALI_LOG_ERROR("This KeyEvent should not have been intercepted!");
+
+ return false;
+ }
+
+ auto callback = [handle = Dali::Window(this)](Dali::KeyEvent keyEvent, bool consumed) {
+ if(!consumed)
+ {
+ Dali::DevelKeyEvent::SetNoInterceptModifier(keyEvent, true);
+ Dali::DevelWindow::FeedKeyEvent(handle, keyEvent);
+ }
+ };
+
+ bool emitted = bridge->EmitKeyEvent(keyEvent, callback);
+
+ // If emitted, consume the event in order not to have to wait for the D-Bus call
+ // to finish. If the event turns out not to be consumed by the remote client,
+ // then it is fed back to the window from the D-Bus callback.
+ return emitted;
}
void Window::OnMoveCompleted(Dali::Window::WindowPosition& position)
return mWindowBase->GetFullScreen();
}
+void Window::SetFrontBufferRendering(bool enable)
+{
+ mWindowBase->SetFrontBufferRendering(enable);
+ mWindowSurface->SetFrontBufferRendering(enable);
+}
+
+bool Window::GetFrontBufferRendering()
+{
+ return mWindowBase->GetFrontBufferRendering();
+}
+
} // namespace Adaptor
} // namespace Internal