summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-05-03 15:55:11 -0500
committerSlávek Banko <slavek.banko@axis.cz>2013-05-05 05:09:57 +0200
commit20180a433681e96f62b7fae29800b0cdd560e775 (patch)
tree29a9f64a00513891b29cc2d02098b177435b7e3c
parent1f8bdc6151e34f22dbcf4c863a67636451f48dfb (diff)
downloadtdebase-20180a433681e96f62b7fae29800b0cdd560e775.tar.gz
tdebase-20180a433681e96f62b7fae29800b0cdd560e775.zip
Properly fix task tray background glitches
Ensure session is fully locked before switching to new VT when lock is requested (cherry picked from commit 3cce16c2543ebd7441477b466b35c89333eef28c)
-rw-r--r--kdesktop/lock/lockprocess.cc19
-rw-r--r--kdesktop/lock/lockprocess.h2
-rw-r--r--kdesktop/lock/main.cc5
-rw-r--r--kicker/applets/systemtray/systemtrayapplet.cpp24
-rw-r--r--kicker/applets/systemtray/systemtrayapplet.h2
-rw-r--r--kicker/kicker/ui/k_mnu.cpp12
6 files changed, 39 insertions, 25 deletions
diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc
index a0d8b781e..ff12d2059 100644
--- a/kdesktop/lock/lockprocess.cc
+++ b/kdesktop/lock/lockprocess.cc
@@ -173,6 +173,7 @@ extern bool trinity_desktop_lock_hide_active_windows;
extern bool trinity_desktop_lock_forced;
extern bool argb_visual;
+extern pid_t kdesktop_pid;
extern TQXLibWindowList trinity_desktop_lock_hidden_window_list;
@@ -224,6 +225,7 @@ LockProcess::LockProcess()
mHackStartupEnabled(true),
mOverrideHackStartupEnabled(false),
mResizingDesktopLock(false),
+ mFullyOnlineSent(false),
m_rootPixmap(NULL),
mBackingStartupDelayTimer(0),
m_startupStatusDialog(NULL),
@@ -1091,6 +1093,8 @@ void LockProcess::createSaverWindow()
}
}
+ fullyOnline();
+
kdDebug(1204) << "Saver window Id: " << winId() << endl;
}
@@ -2751,4 +2755,19 @@ void LockProcess::slotMouseActivity(XEvent *event)
}
}
+void LockProcess::fullyOnline() {
+ if (!mFullyOnlineSent) {
+ if (kdesktop_pid > 0) {
+ if (kill(kdesktop_pid, SIGUSR2) < 0) {
+ // The controlling kdesktop process probably died. Commit suicide...
+ // Exit uncleanly
+ exit(1);
+ }
+ else {
+ mFullyOnlineSent = true;
+ }
+ }
+ }
+}
+
#include "lockprocess.moc"
diff --git a/kdesktop/lock/lockprocess.h b/kdesktop/lock/lockprocess.h
index bac71823e..1630d3a78 100644
--- a/kdesktop/lock/lockprocess.h
+++ b/kdesktop/lock/lockprocess.h
@@ -133,6 +133,7 @@ private:
void windowAdded( WId window, bool managed );
void resume( bool force );
static TQVariant getConf(void *ctx, const char *key, const TQVariant &dflt);
+ void fullyOnline();
bool mLocked;
int mLockGrace;
@@ -198,6 +199,7 @@ private:
bool mHackStartupEnabled;
bool mOverrideHackStartupEnabled;
bool mResizingDesktopLock;
+ bool mFullyOnlineSent;
TQPixmap backingPixmap;
KRootPixmap *m_rootPixmap;
diff --git a/kdesktop/lock/main.cc b/kdesktop/lock/main.cc
index b920399c2..74b7b7f26 100644
--- a/kdesktop/lock/main.cc
+++ b/kdesktop/lock/main.cc
@@ -78,6 +78,7 @@ bool signalled_run;
bool in_internal_mode = FALSE;
bool argb_visual = FALSE;
+pid_t kdesktop_pid = -1;
static void sigusr1_handler(int)
{
@@ -449,8 +450,8 @@ int main( int argc, char **argv )
return ret;
}
else {
- pid_t kdesktop_pid = atoi(args->getOption( "internal" ));
- if (kill(kdesktop_pid, SIGUSR2) < 0) {
+ kdesktop_pid = atoi(args->getOption( "internal" ));
+ if (kill(kdesktop_pid, 0) < 0) {
// The controlling kdesktop process probably died. Commit suicide...
return 12;
}
diff --git a/kicker/applets/systemtray/systemtrayapplet.cpp b/kicker/applets/systemtray/systemtrayapplet.cpp
index 1a96a9372..2042f65b9 100644
--- a/kicker/applets/systemtray/systemtrayapplet.cpp
+++ b/kicker/applets/systemtray/systemtrayapplet.cpp
@@ -1130,10 +1130,8 @@ void SystemTrayApplet::setBackground()
TrayEmbed::TrayEmbed( bool kdeTray, TQWidget* parent )
- : QXEmbed( parent ), kde_tray( kdeTray ), m_ensureBackgroundSetTimerCount(0)
+ : QXEmbed( parent ), kde_tray( kdeTray )
{
- m_ensureBackgroundSetTimer = new TQTimer();
- connect(m_ensureBackgroundSetTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(ensureBackgroundSet()));
hide();
m_scaledWidget = new TQWidget(parent);
m_scaledWidget->hide();
@@ -1141,7 +1139,7 @@ TrayEmbed::TrayEmbed( bool kdeTray, TQWidget* parent )
TrayEmbed::~TrayEmbed()
{
- delete m_ensureBackgroundSetTimer;
+ //
}
void TrayEmbed::getIconSize(int defaultIconSize)
@@ -1164,20 +1162,19 @@ void TrayEmbed::setBackground()
{
const TQPixmap *pbg = parentWidget()->backgroundPixmap();
- if (pbg)
- {
+ if (pbg) {
TQPixmap bg(width(), height());
bg.fill(parentWidget(), pos());
setPaletteBackgroundPixmap(bg);
setBackgroundOrigin(WidgetOrigin);
}
- else
+ else {
unsetPalette();
+ }
if (!isHidden())
{
XClearArea(x11Display(), embeddedWinId(), 0, 0, 0, 0, True);
- m_ensureBackgroundSetTimerCount = 0;
ensureBackgroundSet();
}
}
@@ -1211,8 +1208,7 @@ void TrayEmbed::ensureBackgroundSet()
int g = int( tqGreen( l ) );
int b = int( tqBlue( l ) );
int a = int( tqAlpha( l ) );
- ls[x] = tqRgba( r, g, b, a );
- XSetForeground(x11Display(), gc, (r << 16) | (g << 8) | b );
+ XSetForeground(x11Display(), gc, (a << 24) | (r << 16) | (g << 8) | b );
XDrawPoint(x11Display(), argbpixmap, gc, x, y);
}
}
@@ -1223,13 +1219,5 @@ void TrayEmbed::ensureBackgroundSet()
// Repaint
XClearArea(x11Display(), embeddedWinId(), 0, 0, 0, 0, True);
-
- // HACK
- // Clear background artifacts in first available timeslot after initial icon display
- if (m_ensureBackgroundSetTimerCount < 1) {
- m_ensureBackgroundSetTimerCount++;
- m_ensureBackgroundSetTimer->stop();
- m_ensureBackgroundSetTimer->start(0, TRUE);
- }
}
}
diff --git a/kicker/applets/systemtray/systemtrayapplet.h b/kicker/applets/systemtray/systemtrayapplet.h
index 84ee06ecb..d554a810e 100644
--- a/kicker/applets/systemtray/systemtrayapplet.h
+++ b/kicker/applets/systemtray/systemtrayapplet.h
@@ -135,8 +135,6 @@ public:
private:
bool kde_tray;
TQWidget *m_scaledWidget;
- TQTimer* m_ensureBackgroundSetTimer;
- int m_ensureBackgroundSetTimerCount;
private slots:
void ensureBackgroundSet();
};
diff --git a/kicker/kicker/ui/k_mnu.cpp b/kicker/kicker/ui/k_mnu.cpp
index 651d19204..950eaae1b 100644
--- a/kicker/kicker/ui/k_mnu.cpp
+++ b/kicker/kicker/ui/k_mnu.cpp
@@ -448,9 +448,14 @@ extern int kicker_screen_number;
void PanelKMenu::slotLock()
{
TQCString appname( "kdesktop" );
- if ( kicker_screen_number )
+ if ( kicker_screen_number ) {
appname.sprintf("kdesktop-screen-%d", kicker_screen_number);
- kapp->dcopClient()->send(appname, "KScreensaverIface", "lock()", TQString(""));
+ }
+ TQCString replyType;
+ TQByteArray replyData;
+ // Block here until lock is complete
+ // If this is not done the desktop of the locked session will be shown after VT switch until the lock fully engages!
+ kapp->dcopClient()->call(appname, "KScreensaverIface", "lock()", TQCString(""), replyType, replyData);
}
void PanelKMenu::slotLogout()
@@ -520,8 +525,9 @@ void PanelKMenu::doNewSession( bool lock )
if (result==KMessageBox::Cancel)
return;
- if (lock)
+ if (lock) {
slotLock();
+ }
DM().startReserve();
}