summaryrefslogtreecommitdiffstats
path: root/tdm
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-12 04:30:22 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-12 04:30:22 -0600
commit261c0e1f6b9a69442520936ef7f91e1eac9f9514 (patch)
treed3aae9148f3711cd93a369d2daa0295a29d1407b /tdm
parent167c4cbea6bce3dc763b93cf13bbc1d5c4a103c6 (diff)
downloadtdebase-261c0e1f6b9a69442520936ef7f91e1eac9f9514.tar.gz
tdebase-261c0e1f6b9a69442520936ef7f91e1eac9f9514.zip
Add display hotplug support to TDM
Fix displayconfig control module
Diffstat (limited to 'tdm')
-rw-r--r--tdm/kfrontend/kgapp.cpp19
-rw-r--r--tdm/kfrontend/kgapp.h6
2 files changed, 22 insertions, 3 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
diff --git a/tdm/kfrontend/kgapp.h b/tdm/kfrontend/kgapp.h
index 2c4374f47..4769ff65a 100644
--- a/tdm/kfrontend/kgapp.h
+++ b/tdm/kfrontend/kgapp.h
@@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define KGAPP_H
#include <kapplication.h>
+#include <tdehardwaredevices.h>
class GreeterApp : public KApplication {
Q_OBJECT
@@ -41,7 +42,10 @@ class GreeterApp : public KApplication {
virtual void timerEvent( TQTimerEvent * );
signals:
- void activity();
+ void activity();
+
+ private slots:
+ void deviceChanged( TDEGenericDevice * );
private:
int pingInterval;