summaryrefslogtreecommitdiffstats
path: root/redhat/kdebase/kdebase-3.5.13-randrtray_merge_x11_reconfig_requests.patch~
blob: e17ae11b5b3bdc6605d581c48ef82060fa9d375d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Index: krandrapp.cpp
===================================================================
--- kcontrol/randr/krandrapp.cpp	(revision 1261452)
+++ kcontrol/randr/krandrapp.cpp	(working copy)
@@ -28,13 +28,20 @@
 KRandRApp::KRandRApp()
 	: m_tray(new KRandRSystemTray(0L, "RANDRTray"))
 {
+	connect(&m_eventMergingTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(handleX11ConfigChangeEvent()));
 	m_tray->show();
 }
 
+void KRandRApp::handleX11ConfigChangeEvent()
+{
+	m_eventMergingTimer.stop();
+	m_tray->configChanged();
+}
+
 bool KRandRApp::x11EventFilter(XEvent* e)
 {
 	if (e->type == m_tray->screenChangeNotifyEvent()) {
-		m_tray->configChanged();
+		m_eventMergingTimer.start(1000, TRUE);
 	}
 	return KApplication::x11EventFilter( e );
 }
Index: krandrapp.h
===================================================================
--- kcontrol/randr/krandrapp.h	(revision 1261452)
+++ kcontrol/randr/krandrapp.h	(working copy)
@@ -19,6 +19,7 @@
 #ifndef KRANDRAPP_H
 #define KRANDRAPP_H
 
+#include <tqtimer.h>
 #include <kuniqueapplication.h>
 
 class KRandRSystemTray;
@@ -32,8 +33,12 @@
 
 	virtual bool x11EventFilter(XEvent * e);
 
+private slots:
+	void handleX11ConfigChangeEvent();
+
 private:
 	KRandRSystemTray*	m_tray;
+	TQTimer			m_eventMergingTimer;
 };
 
 #endif