MainWindow: fixed problems with maximized window-state when using FVWM2

Added a workaround for FVWM2 as showMaximized() does not work with it
unless the window is already visible.
(cherry picked from commit 515f0243b9)
This commit is contained in:
Achim Settelmeier
2009-05-05 23:33:53 +02:00
committed by Tobias Doerffel
parent 03ecb86494
commit 2f5dd60fd9

View File

@@ -90,6 +90,7 @@ int main( int argc, char * * argv )
srand( getpid() + time( 0 ) );
bool core_only = false;
bool fullscreen = true;
bool exit_after_import = false;
QString file_to_load, file_to_save, file_to_import, render_out;
@@ -101,7 +102,14 @@ int main( int argc, char * * argv )
QString( argv[i] ) == "-h" ) ) )
{
core_only = true;
break;
}
else if( argc > i && QString( argv[i] ) == "-geometry" )
{
// option -geometry is filtered by Qt later,
// so we need to check its presence now to
// determine, if the application should run in
// fullscreen mode (default, no -geometry given).
fullscreen = false;
}
}
@@ -411,7 +419,11 @@ int main( int argc, char * * argv )
// we try to load given file
if( !file_to_load.isEmpty() )
{
engine::getMainWindow()->showMaximized();
engine::getMainWindow()->show();
if( fullscreen )
{
engine::getMainWindow()->showMaximized();
}
engine::getSong()->loadProject( file_to_load );
}
else if( !file_to_import.isEmpty() )
@@ -422,12 +434,24 @@ int main( int argc, char * * argv )
{
return 0;
}
engine::getMainWindow()->showMaximized();
engine::getMainWindow()->show();
if( fullscreen )
{
engine::getMainWindow()->showMaximized();
}
}
else
{
engine::getSong()->createNewProject();
engine::getMainWindow()->showMaximized();
// [Settel] workaround: showMaximized() doesn't work with
// FVWM2 unless the window is already visible -> show() first
engine::getMainWindow()->show();
if( fullscreen )
{
engine::getMainWindow()->showMaximized();
}
}
}
else