summaryrefslogtreecommitdiffstats
path: root/tdm/kfrontend/kgapp.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2013-01-12 04:30:22 -0600
committerTimothy Pearson <[email protected]>2013-01-12 04:30:22 -0600
commit261c0e1f6b9a69442520936ef7f91e1eac9f9514 (patch)
treed3aae9148f3711cd93a369d2daa0295a29d1407b /tdm/kfrontend/kgapp.cpp
parent167c4cbea6bce3dc763b93cf13bbc1d5c4a103c6 (diff)
downloadtdebase-261c0e1f6b9a69442520936ef7f91e1eac9f9514.tar.gz
tdebase-261c0e1f6b9a69442520936ef7f91e1eac9f9514.zip
Add display hotplug support to TDM
Fix displayconfig control module
Diffstat (limited to 'tdm/kfrontend/kgapp.cpp')
-rw-r--r--tdm/kfrontend/kgapp.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/tdm/kfrontend/kgapp.cpp b/tdm/kfrontend/kgapp.cpp
index bb57b617b..120e20cb4 100644
--- a/tdm/kfrontend/kgapp.cpp
+++ b/tdm/kfrontend/kgapp.cpp
@@ -100,6 +100,9 @@ GreeterApp::GreeterApp()
alarm( pingInterval * 70 ); // sic! give the "proper" pinger enough time
startTimer( pingInterval * 60000 );
}
+
+ TDEHardwareDevices *hwdevices = KGlobal::hardwareDevices();
+ connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*)));
}
GreeterApp::GreeterApp(Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap) : KApplication(dpy, visual, colormap)
@@ -114,6 +117,17 @@ GreeterApp::GreeterApp(Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap) : K
alarm( pingInterval * 70 ); // sic! give the "proper" pinger enough time
startTimer( pingInterval * 60000 );
}
+
+ TDEHardwareDevices *hwdevices = KGlobal::hardwareDevices();
+ connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*)));
+}
+
+void GreeterApp::deviceChanged(TDEGenericDevice* device) {
+ if (device->type() == TDEGenericDeviceType::Monitor) {
+ KRandrSimpleAPI *randrsimple = new KRandrSimpleAPI();
+ randrsimple->applyHotplugRules(KDE_CONFDIR);
+ delete randrsimple;
+ }
}
void
@@ -272,13 +286,14 @@ kg_main( const char *argv0 )
Display *dpy = tqt_xdisplay();
- if (!_GUIStyle.isEmpty())
+ if (!_GUIStyle.isEmpty()) {
app->setStyle( _GUIStyle );
+ }
// Load up systemwide display settings
#ifdef WITH_XRANDR
KRandrSimpleAPI *randrsimple = new KRandrSimpleAPI();
- TQPoint primaryScreenPosition = randrsimple->applyDisplayConfiguration("", KDE_CONFDIR);
+ TQPoint primaryScreenPosition = randrsimple->applyStartupDisplayConfiguration(KDE_CONFDIR);
randrsimple->applyHotplugRules(KDE_CONFDIR);
delete randrsimple;
#endif