summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJekyll Wu <adaptee@gmail.com>2012-04-18 08:04:07 (GMT)
committerJekyll Wu <adaptee@gmail.com>2012-04-20 07:33:37 (GMT)
commit6b811ec2b6e4fbf459af9765c9ead506c9a0cd3c (patch)
tree4ca4aa7970824022c314be17612cae8985defd63
parentcce19d8cb859c1d0e3bc2f019f68aa9b864a87f2 (diff)
Konsole should use new process when some Qt/KDE options are given
One typical option is "--display", because two konsole windows belonging to the same process are destined to be shown in the same display, which defeats the purpose of the "--display" option CCBUG: 297224 BUG: 179010 BUG: 297801 FIXED-IN: 4.9.0 REVIEW: 104653
-rw-r--r--src/main.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 898a057..0660083 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -86,6 +86,34 @@ extern "C" int KDE_EXPORT kdemain(int argc, char** argv)
}
bool shouldUseNewProcess()
{
+ // The "unique process" model of konsole is incompatible with some or all
+ // Qt/KDE options. When those incompatile options are given, konsole must
+ // new new process
+ //
+ // TODO: make sure the existing list is OK and add more incompatible options.
+
+ // take Qt options into consideration
+ const KCmdLineArgs* qtArgs = KCmdLineArgs::parsedArgs("qt");
+ QStringList qtProblematicOptions;
+ qtProblematicOptions << "display" << "session" << "name"
+ << "visual" << "reverse" << "stylesheet"
+ << "graphicssystem";
+ foreach(const QString& option, qtProblematicOptions) {
+ if ( qtArgs->isSet(option.toLocal8Bit()) ) {
+ return true;
+ }
+ }
+
+ // take KDE options into consideration
+ const KCmdLineArgs* kdeArgs = KCmdLineArgs::parsedArgs("kde");
+ QStringList kdeProblematicOptions;
+ kdeProblematicOptions << "config" << "style" << "waitforwm";
+ foreach(const QString& option, kdeProblematicOptions) {
+ if ( kdeArgs->isSet(option.toLocal8Bit()) ) {
+ return true;
+ }
+ }
+
const KCmdLineArgs* kUniqueAppArgs = KCmdLineArgs::parsedArgs("kuniqueapp");
// when user asks konsole to run in foreground through the --nofork option