summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-04-16 01:46:04 +0300
committerTor Lillqvist <tml@iki.fi>2013-04-16 11:19:35 +0300
commitbd2a91420e4cea477e4317223092b1db5ff09c7f (patch)
treeb02fd21e4782513d2c8bc09e175d104d43cf9f1d /vcl
parente013425372a34afa91fb312d8237b2ce22147d81 (diff)
Try to propagate display size change to LO
Change-Id: If52c0aa9290c377c08f2cec8c9e36d987c0ed9b6
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/ios/iosinst.hxx2
-rw-r--r--vcl/ios/iosinst.cxx26
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 )