X dependency cleanup (1/3)

Move the special handling of -geometry command option from LyX to GuiApplication, 
where it belongs


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26823 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2008-10-09 07:19:34 +00:00
parent c6bff58c5d
commit 2759268092
2 changed files with 13 additions and 7 deletions

View File

@ -1057,13 +1057,6 @@ int parse_import(string const & type, string const & file, string & batch)
int parse_geometry(string const & arg1, string const &, string &)
{
geometryArg = arg1;
#if defined(_WIN32) || (defined(__CYGWIN__) && defined(X_DISPLAY_MISSING))
// remove also the arg
return 1;
#else
// don't remove "-geometry"
return -1;
#endif
}

View File

@ -131,6 +131,19 @@ namespace lyx {
frontend::Application * createApplication(int & argc, char * argv[])
{
#ifndef Q_WS_X11
// prune -geometry argument(s) by shifting
// the following ones 2 places down.
for (int i = 0 ; i < argc ; ++i) {
if (argv[i] == "-geometry") {
int const remove = (i+1) < argc ? 2 : 1;
argc -= remove;
for (int j = i; j < argc; ++j)
argv[j] = argv[j + remove];
--i;
}
}
#endif
return new frontend::GuiApplication(argc, argv);
}