mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-07 17:42:35 +02:00
add workaround for Qt Cocoa that fixes restoring geometry when
using a unified toolbar.
This commit is contained in:
parent
a17635c89d
commit
e22c430f00
@ -163,12 +163,33 @@ TomahawkWindow::loadSettings()
|
||||
{
|
||||
TomahawkSettings* s = TomahawkSettings::instance();
|
||||
|
||||
// Workaround for broken window geometry restoring on Qt Cocoa when setUnifiedTitleAndToolBarOnMac is true.
|
||||
// See http://bugreports.qt.nokia.com/browse/QTBUG-3116 and
|
||||
// http://lists.qt.nokia.com/pipermail/qt-interest/2009-August/011491.html
|
||||
// for the 'fix'
|
||||
#ifdef QT_MAC_USE_COCOA
|
||||
bool workaround = !isVisible();
|
||||
if( workaround ) {
|
||||
// make "invisible"
|
||||
setWindowOpacity( 0 );
|
||||
// let Qt update its frameStruts
|
||||
show();
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( !s->mainWindowGeometry().isEmpty() )
|
||||
restoreGeometry( s->mainWindowGeometry() );
|
||||
if ( !s->mainWindowState().isEmpty() )
|
||||
restoreState( s->mainWindowState() );
|
||||
if ( !s->mainWindowSplitterState().isEmpty() )
|
||||
ui->splitter->restoreState( s->mainWindowSplitterState() );
|
||||
|
||||
#ifdef QT_MAC_USE_COCOA
|
||||
if( workaround ) {
|
||||
// Make it visible again
|
||||
setWindowOpacity( 1 );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user