]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiApplication.cpp
X dependency cleanup (1/3)
[features.git] / src / frontends / qt4 / GuiApplication.cpp
index 3a3f11bce4a805a3317a87c24f0d66d2adfea87d..a851ff56c6ee739620d9e03c8f87aa68877b3e57 100644 (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);
 }