Remove concept of multihead in kcminit

Summary:
We don't remotely support multihead in plasmashell.
Nor do we support two plasmashells running to fake it.
SDDM doesn't either.

Kwin has some code, but we don't check the screen before
choosing the DBus service to use. I doubt it works well.

This kills some code, and a blocking call to klauncher.

(Note, multihead has nothing to do with xrandr spanning screens)

Test Plan:
Code grep
Compiles

Reviewers: #plasma, mart

Reviewed By: #plasma, mart

Subscribers: apol, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9171
wilder-5.14
David Edmundson 8 years ago
parent d7fbe6c863
commit ad52844c0b
  1. 34
      startkde/kcminit/main.cpp

@ -131,32 +131,6 @@ void KCMInit::runModules( int phase )
}
}
static inline bool enableMultihead()
{
#ifdef XCB_FOUND
if (qApp->platformName() != QLatin1String("xcb"))
return false;
xcb_connection_t *c = xcb_connect(nullptr, nullptr);
if (!c || xcb_connection_has_error(c))
return false;
//on a common setup of laptop plus external vga output this still will be 1
const int xcb_screen_count = xcb_setup_roots_length(xcb_get_setup(c));
xcb_disconnect(c);
if (xcb_screen_count <= 1)
return false;
KConfig _config( QStringLiteral("kcmdisplayrc") );
KConfigGroup config(&_config, "X11");
// This key has no GUI apparently
return !config.readEntry( "disableMultihead", false);
#else
return false;
#endif
}
KCMInit::KCMInit( const QCommandLineParser& args )
{
QString arg;
@ -192,14 +166,6 @@ KCMInit::KCMInit( const QCommandLineParser& args )
list = KServiceTypeTrader::self()->query( QStringLiteral("KCModuleInit") );
}
// Pass env. var to kdeinit.
const char* name = "KDE_MULTIHEAD";
const char* value = enableMultihead() ? "true" : "false";
OrgKdeKLauncherInterface *iface = new OrgKdeKLauncherInterface(QStringLiteral("org.kde.klauncher5"), QStringLiteral("/KLauncher"), QDBusConnection::sessionBus());
iface->setLaunchEnv(QLatin1String(name), QLatin1String(value));
iface->deleteLater();
setenv( name, value, 1 ); // apply effect also to itself
if( startup ) {
runModules( 0 );
// Tell KSplash that KCMInit has started

Loading…
Cancel
Save