/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
mIconified(false),
mOpaqueState(false),
mWindowRotationAcknowledgement(false),
+ mFocused(false),
mParentWindow(NULL),
mPreferredAngle(static_cast<int>(WindowOrientation::NO_ORIENTATION_PREFERENCE)),
mRotationAngle(0),
Window::~Window()
{
- auto bridge = Accessibility::Bridge::GetCurrentBridge();
- auto rootLayer = mScene.GetRootLayer();
- auto accessible = Accessibility::Accessible::Get(rootLayer, true);
- bridge->RemoveTopLevelWindow(accessible);
+ if(mScene)
+ {
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+ auto rootLayer = mScene.GetRootLayer();
+ auto accessible = Accessibility::Accessible::Get(rootLayer, true);
+ bridge->RemoveTopLevelWindow(accessible);
+ }
if(mAdaptor)
{
mEventHandler->AddObserver(*this);
// Add Window to bridge for ATSPI
- auto bridge = Accessibility::Bridge::GetCurrentBridge();
- auto rootLayer = mScene.GetRootLayer();
- auto accessible = Accessibility::Accessible::Get(rootLayer, true);
- bridge->AddTopLevelWindow(accessible);
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+ if (bridge->IsUp())
+ {
+ auto rootLayer = mScene.GetRootLayer();
+ auto accessible = Accessibility::Accessible::Get(rootLayer, true);
+ bridge->AddTopLevelWindow(accessible);
+ }
bridge->EnabledSignal().Connect(this, &Window::OnAccessibilityEnabled);
bridge->DisabledSignal().Connect(this, &Window::OnAccessibilityDisabled);
return mScene.GetRenderTaskList();
}
+ std::string Window::GetNativeResourceId() const
+ {
+ return mWindowBase->GetNativeWindowResourceId();
+ }
+
void Window::AddAvailableOrientation(WindowOrientation orientation)
{
if(IsOrientationAvailable(orientation) == false)
{
Dali::Window handle(this);
mVisibilityChangedSignal.Emit(handle, true);
+ Dali::Accessibility::Bridge::GetCurrentBridge()->WindowShown(handle);
WindowVisibilityObserver* observer(mAdaptor);
observer->OnWindowShown();
{
Dali::Window handle(this);
mVisibilityChangedSignal.Emit(handle, false);
+ Dali::Accessibility::Bridge::GetCurrentBridge()->WindowHidden(handle);
WindowVisibilityObserver* observer(mAdaptor);
observer->OnWindowHidden();
{
Dali::Window handle(this);
mVisibilityChangedSignal.Emit(handle, false);
+ Dali::Accessibility::Bridge::GetCurrentBridge()->WindowHidden(handle);
WindowVisibilityObserver* observer(mAdaptor);
observer->OnWindowHidden();
{
Dali::Window handle(this);
mVisibilityChangedSignal.Emit(handle, true);
+ Dali::Accessibility::Bridge::GetCurrentBridge()->WindowShown(handle);
WindowVisibilityObserver* observer(mAdaptor);
observer->OnWindowShown();
bridge->WindowUnfocused(handle);
}
}
+ mFocused = focusIn;
}
void Window::OnOutputTransformed()
auto rootLayer = mScene.GetRootLayer();
auto accessible = Accessibility::Accessible::Get(rootLayer, true);
bridge->AddTopLevelWindow(accessible);
+
+ if(mFocused)
+ {
+ Dali::Window handle(this);
+ bridge->WindowFocused(handle);
+ }
}
void Window::OnAccessibilityDisabled()
#define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Dali::RenderTaskList GetRenderTaskList() const;
/**
+ * @brief Get window resource ID assigned by window manager
+ * @return The resource ID of the window
+ */
+ std::string GetNativeResourceId() const;
+
+ /**
* @copydoc Dali::Window::AddAvailableOrientation()
*/
void AddAvailableOrientation(WindowOrientation orientation);
bool mIconified : 1;
bool mOpaqueState : 1;
bool mWindowRotationAcknowledgement : 1;
+ bool mFocused : 1;
Dali::Window mParentWindow;
OrientationPtr mOrientation;
static Eina_Bool EcoreEventSeatKeyboardRepeatChanged(void* data, int type, void* event)
{
- Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed* keyboardRepeat = static_cast<Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed*>(event);
- WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
- DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventSeatKeyboardRepeatChanged, id[ %d ]\n", keyboardRepeat->id);
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventSeatKeyboardRepeatChanged, id[ %d ]\n", static_cast<Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed*>(event)->id);
if(windowBase)
{
windowBase->OnKeyboardRepeatSettingsChanged();
static Eina_Bool EcoreEventWindowRedrawRequest(void* data, int type, void* event)
{
- Ecore_Wl2_Event_Window_Redraw_Request* windowRedrawRequest = static_cast<Ecore_Wl2_Event_Window_Redraw_Request*>(event);
- WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
- DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventWindowRedrawRequest, window[ %d ]\n", windowRedrawRequest->win);
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventWindowRedrawRequest, window[ %d ]\n", static_cast<Ecore_Wl2_Event_Window_Redraw_Request*>(event)->win);
if(windowBase)
{
windowBase->OnEcoreEventWindowRedrawRequest();
return ecore_wl2_window_id_get(mEcoreWindow);
}
+ std::string WindowBaseEcoreWl2::GetNativeWindowResourceId()
+ {
+ return std::to_string(ecore_wl2_window_resource_id_get(mEcoreWindow));
+ }
+
EGLNativeWindowType WindowBaseEcoreWl2::CreateEglWindow(int width, int height)
{
int totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360;