diff options
-rw-r--r-- | vcl/inc/ios/iosinst.hxx | 2 | ||||
-rw-r--r-- | vcl/ios/iosinst.cxx | 26 |
2 files changed, 27 insertions, 1 deletions
diff --git a/vcl/inc/ios/iosinst.hxx b/vcl/inc/ios/iosinst.hxx index 3b87de6a8330..2ff9e5784f14 100644 --- a/vcl/inc/ios/iosinst.hxx +++ b/vcl/inc/ios/iosinst.hxx @@ -59,6 +59,8 @@ public: } RenderWindowsArg; DECL_LINK( RenderWindows, RenderWindowsArg* ); + DECL_LINK( DisplayConfigurationChanged, void* ); + pthread_mutex_t m_aRenderMutex; pthread_cond_t m_aRenderCond; }; diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx index 920187c1aa1f..95a7aacbe6fe 100644 --- a/vcl/ios/iosinst.cxx +++ b/vcl/ios/iosinst.cxx @@ -271,12 +271,36 @@ int IosSalSystem::ShowNativeDialog( const OUString& rTitle, return 0; } +IMPL_LINK( IosSalInstance, DisplayConfigurationChanged, void*, ) +{ + for( std::list< SalFrame* >::const_iterator it = getFrames().begin(); + it != getFrames().end(); + it++ ) { + (*it)->CallCallback( SALEVENT_SETTINGSCHANGED, 0 ); + } + + lo_damaged( CGRectMake( 0, 0, viewWidth, viewHeight ) ); + return 0; +} + extern "C" void lo_set_view_size(int width, int height) { - // Horrible + int oldWidth = viewWidth; + viewWidth = width; viewHeight = height; + + if (oldWidth > 1) { + // Inform about change in display size (well, just orientation + // presumably). + IosSalInstance *pInstance = IosSalInstance::getInstance(); + + if ( pInstance == NULL ) + return; + + Application::PostUserEvent( LINK( pInstance, IosSalInstance, DisplayConfigurationChanged ), NULL ); + } } IMPL_LINK( IosSalInstance, RenderWindows, RenderWindowsArg*, arg ) |