summaryrefslogtreecommitdiffstats
path: root/redhat/kdebase/kdebase-3.5.13-fix_fancy_logout.patch
blob: 793334e241081110238929e63c3ffff6a6846df9 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
commit d2f8fca98e6d276f442f90dee48164be15d8e287
Author: Timothy Pearson <[email protected]>
Date:   1337223371 -0500

    Fix fancy logout not allowing interaction with save dialogs
    This closes Bug 922
    Fix desktop wallpaper export failing when triggered by krootbacking or ksmserver and konsole or kdesktop_lock not previously loaded

diff --git a/krootbacking/krootbacking.cpp b/krootbacking/krootbacking.cpp
index 8e41b50..fe8574a 100644
--- a/krootbacking/krootbacking.cpp
+++ b/krootbacking/krootbacking.cpp
@@ -54,6 +54,8 @@ public:
 KRootBacking::KRootBacking()
     : TQObject(KApplication::desktop(), "KRootBacking" ), m_Desk(0), m_timeout(0)
 {
+    enableExports();
+
     init();
 }
 
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp
index a4ca020..09cb2d7 100644
--- a/ksmserver/shutdown.cpp
+++ b/ksmserver/shutdown.cpp
@@ -189,24 +189,6 @@ void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm,
         // shall we save the session on logout?
         saveSession = ( config->readEntry( "loginMode", "restorePreviousLogout" ) == "restorePreviousLogout" );
 
-        if (showFancyLogout) {
-            KSMShutdownIPFeedback::showit(); // hide the UGLY logout process from the user
-            shutdownNotifierIPDlg = KSMShutdownIPDlg::showShutdownIP();
-            while (!KSMShutdownIPFeedback::ispainted()) {
-                tqApp->processEvents();
-            }
-        }
-
-        // synchronize any folders that were requested for shutdown sync
-        if (shutdownNotifierIPDlg) {
-            static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Synchronizing remote folders").append("..."));
-        }
-        KRsync krs(this, "");
-        krs.executeLogoutAutoSync();
-        if (shutdownNotifierIPDlg) {
-            static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Saving your settings..."));
-        }
-
         if ( saveSession )
             sessionGroup = TQString("Session: ") + SESSION_PREVIOUS_LOGOUT;
 
@@ -252,9 +234,9 @@ void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm,
             completeShutdownOrCheckpoint();
     }
     else {
-        if (showFancyLogout) {
-            KSMShutdownIPFeedback::stop();
-        }
+       if (showFancyLogout) {
+           KSMShutdownIPFeedback::stop();
+       }
     }
     dialogActive = false;
 }
@@ -502,6 +484,25 @@ void KSMServer::completeShutdownOrCheckpoint()
     if ( waitForPhase2 )
         return;
 
+    bool showFancyLogout = KConfigGroup(KGlobal::config(), "Logout").readBoolEntry("showFancyLogout", true);
+    if (showFancyLogout) {
+        KSMShutdownIPFeedback::showit(); // hide the UGLY logout process from the user
+        shutdownNotifierIPDlg = KSMShutdownIPDlg::showShutdownIP();
+        while (!KSMShutdownIPFeedback::ispainted()) {
+            tqApp->processEvents();
+        }
+    }
+
+    // synchronize any folders that were requested for shutdown sync
+    if (shutdownNotifierIPDlg) {
+        static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Synchronizing remote folders").append("..."));
+    }
+    KRsync krs(this, "");
+    krs.executeLogoutAutoSync();
+    if (shutdownNotifierIPDlg) {
+        static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Saving your settings..."));
+    }
+
     if ( saveSession )
         storeSession();
     else
diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp
index 163352a..35cae65 100644
--- a/ksmserver/shutdowndlg.cpp
+++ b/ksmserver/shutdowndlg.cpp
@@ -528,6 +528,11 @@ KSMShutdownIPFeedback::KSMShutdownIPFeedback()
 : TQWidget( 0L, "systemmodaldialogclass", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_StaysOnTop ), m_timeout(0), m_isPainted(false), m_sharedRootPixmap(NULL), mPixmapTimeout(0)
 
 {
+	setShown(false);
+	hide();
+
+	enableExports();
+
 	m_sharedRootPixmap = new KRootPixmap(this);
 	m_sharedRootPixmap->setCustomPainting(true);
 	connect(m_sharedRootPixmap, TQT_SIGNAL(backgroundUpdated(const TQPixmap &)), this, TQT_SLOT(slotSetBackgroundPixmap(const TQPixmap &)));
@@ -554,15 +559,36 @@ KSMShutdownIPFeedback::KSMShutdownIPFeedback()
 	setBackgroundPixmap( m_root );
 	setGeometry( TQApplication::desktop()->geometry() );
 	setBackgroundMode( TQWidget::NoBackground );
-
-	setShown(true);
 }
 
 void KSMShutdownIPFeedback::showNow()
 {
+	setShown(true);
+
 	TQTimer::singleShot( 0, this, SLOT(slotPaintEffect()) );
 }
 
+void KSMShutdownIPFeedback::enableExports()
+{
+#ifdef Q_WS_X11
+	kdDebug(270) << k_lineinfo << "activating background exports.\n";
+	DCOPClient *client = kapp->dcopClient();
+	if (!client->isAttached()) {
+		client->attach();
+	}
+	TQByteArray data;
+	TQDataStream args( data, IO_WriteOnly );
+	args << 1;
+	
+	TQCString appname( "kdesktop" );
+	int screen_number = DefaultScreen(qt_xdisplay());
+	if ( screen_number )
+	appname.sprintf("kdesktop-screen-%d", screen_number );
+	
+	client->send( appname, "KBackgroundIface", "setExport(int)", data );
+#endif
+}
+
 KSMShutdownIPFeedback::~KSMShutdownIPFeedback()
 {
 	if (m_sharedRootPixmap) {
diff --git a/ksmserver/shutdowndlg.h b/ksmserver/shutdowndlg.h
index db66c55..05ca991 100644
--- a/ksmserver/shutdowndlg.h
+++ b/ksmserver/shutdowndlg.h
@@ -97,6 +97,13 @@
     void slotSetBackgroundPixmap(const TQPixmap &);
 
 private:
+	/**
+	* Asks KDesktop to export the desktop background as a KSharedPixmap.
+	* This method uses DCOP to call KBackgroundIface/setExport(int).
+	*/
+	void enableExports();
+
+private:
     static KSMShutdownIPFeedback * s_pSelf;
     KSMShutdownIPFeedback();
     int m_currentY;