Make kdesktop_lock and ksmserver ARGB screen blanking more efficient and improve multi-head support in same

Fix kdesktop_lock busy cursor appearing over active screen saver after GUI-driven VT switch and delayed return to original VT
Repair kdesktop_lock invalid password delay bypass with Cancel button
pull/2/head
Timothy Pearson 10 years ago
parent 87136458b4
commit da8993ffb2

@ -349,6 +349,7 @@ void PasswordDlg::timerEvent(TQTimerEvent *ev)
mUnlockingFailed = false; mUnlockingFailed = false;
updateLabel(); updateLabel();
ok->setEnabled(true); ok->setEnabled(true);
if (cancel) cancel->setEnabled(true);
mNewSessButton->setEnabled( true ); mNewSessButton->setEnabled( true );
greet->revive(); greet->revive();
greet->start(); greet->start();
@ -463,6 +464,7 @@ void PasswordDlg::reapVerify()
updateLabel(); updateLabel();
mFailedTimerId = startTimer(1500); mFailedTimerId = startTimer(1500);
ok->setEnabled(false); ok->setEnabled(false);
if (cancel) cancel->setEnabled(false);
mNewSessButton->setEnabled( false ); mNewSessButton->setEnabled( false );
return; return;
case AuthAbort: case AuthAbort:

@ -359,6 +359,7 @@ void LockProcess::init(bool child, bool useBlankOnly)
XGetWindowAttributes(tqt_xdisplay(), RootWindow(tqt_xdisplay(), tqt_xscreen()), &rootAttr); XGetWindowAttributes(tqt_xdisplay(), RootWindow(tqt_xdisplay(), tqt_xscreen()), &rootAttr);
mRootWidth = rootAttr.width; mRootWidth = rootAttr.width;
mRootHeight = rootAttr.height; mRootHeight = rootAttr.height;
generateBackingImages();
// Connect all signals // Connect all signals
connect( mForceContinualLockDisplayTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(displayLockDialogIfNeeded()) ); connect( mForceContinualLockDisplayTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(displayLockDialogIfNeeded()) );
@ -988,6 +989,7 @@ void LockProcess::desktopResized()
} }
mRootWidth = rootAttr.width; mRootWidth = rootAttr.width;
mRootHeight = rootAttr.height; mRootHeight = rootAttr.height;
generateBackingImages();
mBusy = true; mBusy = true;
mHackDelayStartupTimer->stop(); mHackDelayStartupTimer->stop();
@ -1279,6 +1281,21 @@ void LockProcess::ungrabInput()
unlockXF86(); unlockXF86();
} }
//---------------------------------------------------------------------------
//
// Generate requisite backing images for ARGB mode
//
void LockProcess::generateBackingImages()
{
if (argb_visual) {
mArgbTransparentBackgroundPixmap.resize(mRootWidth, mRootHeight);
TQPainter p;
p.begin( &mArgbTransparentBackgroundPixmap );
p.fillRect( 0, 0, mArgbTransparentBackgroundPixmap.width(), mArgbTransparentBackgroundPixmap.height(), TQBrush(tqRgba(0, 0, 0, 0)) );
p.end();
}
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// Set a fully transparent ARGB background image. // Set a fully transparent ARGB background image.
@ -1286,19 +1303,7 @@ void LockProcess::ungrabInput()
void LockProcess::setTransparentBackgroundARGB() void LockProcess::setTransparentBackgroundARGB()
{ {
// eliminate nasty flicker on first show // eliminate nasty flicker on first show
TQImage m_grayImage = TQImage( TQApplication::desktop()->width(), TQApplication::desktop()->height(), 32 ); setBackgroundPixmap( mArgbTransparentBackgroundPixmap );
m_grayImage = m_grayImage.convertDepth(32);
m_grayImage.setAlphaBuffer(false);
m_grayImage.fill(0); // Set the alpha buffer to 0 (fully transparent)
m_grayImage.setAlphaBuffer(true);
TQPixmap m_root;
m_root.resize(mRootWidth, mRootHeight);
TQPainter p;
p.begin( &m_root );
m_grayImage.setAlphaBuffer(false);
p.drawImage( 0, 0, m_grayImage );
p.end();
setBackgroundPixmap( m_root );
} }
void LockProcess::saverReadyIfNeeded() void LockProcess::saverReadyIfNeeded()
@ -1635,6 +1640,7 @@ bool LockProcess::startHack()
mSuspended = false; mSuspended = false;
} }
XChangeActivePointerGrab( tqt_xdisplay(), GRABEVENTS, TQCursor(tqblankCursor).handle(), CurrentTime);
if (mHackProc.start() == true) if (mHackProc.start() == true)
{ {
#ifdef HAVE_SETPRIORITY #ifdef HAVE_SETPRIORITY
@ -1965,8 +1971,7 @@ int LockProcess::execDialog( TQDialog *dlg )
if (mDialogs.isEmpty()) if (mDialogs.isEmpty())
{ {
suspend(); suspend();
XChangeActivePointerGrab( tqt_xdisplay(), GRABEVENTS, XChangeActivePointerGrab( tqt_xdisplay(), GRABEVENTS, TQCursor(tqarrowCursor).handle(), CurrentTime);
TQCursor(tqarrowCursor).handle(), CurrentTime);
} }
mDialogs.prepend( dlg ); mDialogs.prepend( dlg );
fakeFocusIn( dlg->winId()); fakeFocusIn( dlg->winId());
@ -1996,8 +2001,7 @@ int LockProcess::execDialog( TQDialog *dlg )
else { else {
cursorHandle = TQCursor(tqbusyCursor).handle(); cursorHandle = TQCursor(tqbusyCursor).handle();
} }
XChangeActivePointerGrab( tqt_xdisplay(), GRABEVENTS, XChangeActivePointerGrab( tqt_xdisplay(), GRABEVENTS, cursorHandle, CurrentTime);
cursorHandle, CurrentTime);
if (trinity_desktop_lock_use_system_modal_dialogs) { if (trinity_desktop_lock_use_system_modal_dialogs) {
// Slight delay before screensaver resume to allow the dialog window to fully disappear // Slight delay before screensaver resume to allow the dialog window to fully disappear
if (hackResumeTimer == NULL) { if (hackResumeTimer == NULL) {

@ -157,6 +157,7 @@ private:
void windowAdded( WId window, bool managed ); void windowAdded( WId window, bool managed );
void resume( bool force ); void resume( bool force );
static TQVariant getConf(void *ctx, const char *key, const TQVariant &dflt); static TQVariant getConf(void *ctx, const char *key, const TQVariant &dflt);
void generateBackingImages();
void fullyOnline(); void fullyOnline();
bool mLocked; bool mLocked;
@ -228,6 +229,7 @@ private:
TQPixmap backingPixmap; TQPixmap backingPixmap;
KRootPixmap *m_rootPixmap; KRootPixmap *m_rootPixmap;
int mBackingStartupDelayTimer; int mBackingStartupDelayTimer;
TQPixmap mArgbTransparentBackgroundPixmap;
KSMModalDialog* m_startupStatusDialog; KSMModalDialog* m_startupStatusDialog;

@ -543,17 +543,17 @@ KSMShutdownIPFeedback::KSMShutdownIPFeedback()
system("krootbacking &"); system("krootbacking &");
} }
m_screenGeometry = TQApplication::desktop()->geometry();
// eliminate nasty flicker on first show // eliminate nasty flicker on first show
m_root.resize( kapp->desktop()->width(), kapp->desktop()->height() ); m_root.resize(m_screenGeometry.width(), m_screenGeometry.height());
TQImage blendedImage = TQImage( kapp->desktop()->width(), kapp->desktop()->height(), 32 );
TQPainter p; TQPainter p;
p.begin( &m_root ); p.begin( &m_root );
blendedImage.setAlphaBuffer(false); p.fillRect( 0, 0, m_root.width(), m_root.height(), TQBrush(tqRgba(0, 0, 0, 0)) );
p.drawImage( 0, 0, blendedImage );
p.end(); p.end();
setBackgroundPixmap( m_root ); setBackgroundPixmap( m_root );
setGeometry( TQApplication::desktop()->geometry() ); setGeometry( m_screenGeometry );
setBackgroundMode( TQWidget::NoBackground ); setBackgroundMode( TQWidget::NoBackground );
} }

Loading…
Cancel
Save