diff options
Diffstat (limited to 'tdm/kfrontend/kgapp.cpp')
-rw-r--r-- | tdm/kfrontend/kgapp.cpp | 19 |
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 |