if test "x$enable_wayland" = "xyes"; then
if test "x$enable_ecore_wayland2" = "xyes"; then
-PKG_CHECK_MODULES(WAYLAND, [ecore-wl2 egl wayland-egl wayland-client >= 1.2.0 xkbcommon libtbm])
+PKG_CHECK_MODULES(WAYLAND, [ecore-wl2 egl wayland-egl wayland-egl-tizen wayland-client >= 1.2.0 xkbcommon libtbm])
else
PKG_CHECK_MODULES(WAYLAND, [ecore-wayland egl wayland-egl wayland-client >= 1.2.0 xkbcommon libtbm])
fi
--- /dev/null
+/*
+ * Copyright (c) 2018 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali/internal/window-system/common/window-impl.h>
+
+namespace Dali
+{
+
+namespace DevelWindow
+{
+
+void SetPositionSize( Window window, PositionSize positionSize )
+{
+ GetImplementation( window ).SetPositionSize( positionSize );
+}
+
+} // namespace DevelWindow
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_WINDOW_DEVEL_H
+#define DALI_WINDOW_DEVEL_H
+
+/*
+ * Copyright (c) 2018 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/adaptor-framework/window.h>
+
+namespace Dali
+{
+
+namespace DevelWindow
+{
+
+/**
+ * @brief Sets position and size of the window. This API guarantees that both moving and resizing of window will appear on the screen at once.
+ *
+ * @param[in] window The window instance
+ * @param[in] positionSize The new window position and size
+ */
+DALI_ADAPTOR_API void SetPositionSize( Window window, PositionSize positionSize );
+
+} // namespace DevelWindow
+
+} // namespace Dali
+
+#endif // DALI_WINDOW_DEVEL_H
$(adaptor_devel_api_dir)/adaptor-framework/video-player.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/virtual-keyboard.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/thread-settings.cpp \
- $(adaptor_devel_api_dir)/adaptor-framework/web-engine.cpp
+ $(adaptor_devel_api_dir)/adaptor-framework/web-engine.cpp \
+ $(adaptor_devel_api_dir)/adaptor-framework/window-devel.cpp
$(adaptor_devel_api_dir)/adaptor-framework/virtual-keyboard.h \
$(adaptor_devel_api_dir)/adaptor-framework/physical-keyboard.h \
$(adaptor_devel_api_dir)/adaptor-framework/key-devel.h \
- $(adaptor_devel_api_dir)/adaptor-framework/thread-settings.h
+ $(adaptor_devel_api_dir)/adaptor-framework/thread-settings.h \
+ $(adaptor_devel_api_dir)/adaptor-framework/window-devel.h
devel_api_text_abstraction_src_files = \
$(adaptor_devel_api_dir)/text-abstraction/bidirectional-support.cpp \
mResizeEnabled = true;
}
- PositionSize positionSize = mSurface->GetPositionSize();
+ PositionSize oldRect = mSurface->GetPositionSize();
- if( positionSize.width != size.GetWidth() || positionSize.height != size.GetHeight() )
- {
- positionSize.width = size.GetWidth();
- positionSize.height = size.GetHeight();
+ mSurface->MoveResize( PositionSize( oldRect.x, oldRect.y, size.GetWidth(), size.GetHeight() ) );
- mSurface->MoveResize( positionSize );
+ PositionSize newRect = mSurface->GetPositionSize();
+
+ // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
+ if( ( oldRect.width != newRect.width ) || ( oldRect.height != newRect.height ) )
+ {
+ Uint16Pair newSize( newRect.width, newRect.height );
- mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizePrepare( newSize );
- // Emit signal
- mResizedSignal.Emit( Dali::Window::WindowSize( positionSize.width, positionSize.height ) );
+ mResizedSignal.Emit( newSize );
- mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizeComplete( newSize );
}
}
mResizeEnabled = true;
}
- PositionSize positionSize = mSurface->GetPositionSize();
-
- if( positionSize.x != position.GetX() || positionSize.y != position.GetY() )
- {
- positionSize.x = position.GetX();
- positionSize.y = position.GetY();
+ PositionSize oldRect = mSurface->GetPositionSize();
- mSurface->MoveResize( positionSize );
- }
+ mSurface->MoveResize( PositionSize( position.GetX(), position.GetY(), oldRect.width, oldRect.height ) );
}
Dali::Window::WindowPosition Window::GetPosition() const
return Dali::Window::WindowPosition( positionSize.x, positionSize.y );
}
+void Window::SetPositionSize( PositionSize positionSize )
+{
+ if( !mResizeEnabled )
+ {
+ AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
+ mResizeEnabled = true;
+ }
+
+ PositionSize oldRect = mSurface->GetPositionSize();
+
+ mSurface->MoveResize( positionSize );
+
+ PositionSize newRect = mSurface->GetPositionSize();
+
+ // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
+ if( ( oldRect.width != newRect.width ) || ( oldRect.height != newRect.height ) )
+ {
+ Uint16Pair newSize( newRect.width, newRect.height );
+
+ mAdaptor->SurfaceResizePrepare( newSize );
+
+ mResizedSignal.Emit( newSize );
+
+ mAdaptor->SurfaceResizeComplete( newSize );
+ }
+}
+
void Window::SetTransparency( bool transparent )
{
mSurface->SetTransparency( transparent );
Dali::Window::WindowPosition GetPosition() const;
/**
+ * @copydoc Dali::DevelWindow::SetPositionSize()
+ */
+ void SetPositionSize( PositionSize positionSize );
+
+ /**
* @copydoc Dali::Window::SetTransparency()
*/
void SetTransparency( bool transparent );
#include <Ecore_Input.h>
#include <vconf.h>
#include <vconf-keys.h>
+#include <wayland-egl-tizen.h>
namespace Dali
{
mBrightness( 0 ),
mBrightnessChangeState( 0 ),
mBrightnessChangeDone( true ),
- mOwnSurface( false )
+ mOwnSurface( false ),
+ mMoveResizeSerial( 0 ),
+ mLastSubmittedMoveResizeSerial( 0 )
#ifdef DALI_ELDBUS_AVAILABLE
, mSystemConnection( NULL )
#endif
void WindowBaseEcoreWl2::ResizeEglWindow( PositionSize positionSize )
{
wl_egl_window_resize( mEglWindow, positionSize.width, positionSize.height, positionSize.x, positionSize.y );
+
+ // Note: Both "Resize" and "MoveResize" cases can reach here, but only "MoveResize" needs to submit serial number
+ if( mMoveResizeSerial != mLastSubmittedMoveResizeSerial )
+ {
+ wl_egl_window_tizen_set_window_serial( mEglWindow, mMoveResizeSerial );
+ mLastSubmittedMoveResizeSerial = mMoveResizeSerial;
+ }
}
bool WindowBaseEcoreWl2::IsEglWindowRotationSupported()
void WindowBaseEcoreWl2::MoveResize( PositionSize positionSize )
{
- ecore_wl2_window_position_set( mEcoreWindow, positionSize.x, positionSize.y );
- ecore_wl2_window_geometry_set( mEcoreWindow, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
+ ecore_wl2_window_sync_geometry_set( mEcoreWindow, ++mMoveResizeSerial, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
}
void WindowBaseEcoreWl2::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode )
bool mOwnSurface;
+ volatile uint32_t mMoveResizeSerial;
+ uint32_t mLastSubmittedMoveResizeSerial;
+
#ifdef DALI_ELDBUS_AVAILABLE
Eldbus_Connection* mSystemConnection;
#endif // DALI_ELDBUS_AVAILABLE
# dali-adaptor uses ecore mainloop
%if 0%{?tizen_version_major} >= 5
BuildRequires: pkgconfig(ecore-wl2)
+BuildRequires: pkgconfig(wayland-egl-tizen)
%else
BuildRequires: pkgconfig(ecore-wayland)
%endif