diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-03-22 01:51:54 -0500 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2013-05-05 05:09:55 +0200 |
commit | 1f3e144261a1715b4fbec072d9b4b57aeabddbf1 (patch) | |
tree | 2c6f63d6bfce697e5c0d36d0a89aed9a811cffdc | |
parent | 52b8af3d7975010b98ebf728ab1b6b47f6031580 (diff) | |
download | tdebase-1f3e144261a1715b4fbec072d9b4b57aeabddbf1.tar.gz tdebase-1f3e144261a1715b4fbec072d9b4b57aeabddbf1.zip |
Enable ARGB support in kdesktop_lock
(cherry picked from commit 7db006210bee765e4c21cc195e5795499a09c080)
-rw-r--r-- | kdesktop/lock/lockprocess.cc | 66 | ||||
-rw-r--r-- | kdesktop/lock/lockprocess.h | 2 | ||||
-rw-r--r-- | kdesktop/lock/main.cc | 13 |
3 files changed, 48 insertions, 33 deletions
diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc index 1872b9ec8..578cabc44 100644 --- a/kdesktop/lock/lockprocess.cc +++ b/kdesktop/lock/lockprocess.cc @@ -222,6 +222,7 @@ LockProcess::LockProcess() mHackDelayStartupTimer(NULL), mHackDelayStartupTimeout(0), mHackStartupEnabled(true), + mOverrideHackStartupEnabled(false), mResizingDesktopLock(false), m_rootPixmap(NULL), mBackingStartupDelayTimer(0), @@ -687,6 +688,7 @@ void LockProcess::slotDeadTimePassed() bool LockProcess::defaultSave() { mLocked = false; + mOverrideHackStartupEnabled = true; if (startSaver()) { if (mLockGrace >= 0) TQTimer::singleShot(mLockGrace, this, TQT_SLOT(startLock())); @@ -857,16 +859,19 @@ void LockProcess::configure() if (mSaver.isEmpty() || mUseBlankOnly) { mSaver = "KBlankscreen.desktop"; } - if (KDesktopSettings::screenSaverEnabled() == false) { - mSaver = ""; - mSaverExec = ""; + if (!trinity_desktop_lock_use_system_modal_dialogs) { + if (KDesktopSettings::screenSaverEnabled() == false) { + mSaver = ""; + mSaverExec = ""; + } } readSaver(); mPlugins = KDesktopSettings::pluginsUnlock(); - if (mPlugins.isEmpty()) + if (mPlugins.isEmpty()) { mPlugins = TQStringList("classic"); + } mPluginOptions = KDesktopSettings::pluginOptions(); } @@ -1108,7 +1113,7 @@ void LockProcess::desktopResized() // Black out the background widget to hide ugly resize tiling artifacts if (argb_visual) { - setErasePixmap(TQPixmap()); + setTransparentBackgroundARGB(); } else { setBackgroundColor(black); @@ -1360,17 +1365,10 @@ void LockProcess::ungrabInput() //--------------------------------------------------------------------------- // -// Start the screen saver. +// Set a fully transparent ARGB background image. // -bool LockProcess::startSaver() +void LockProcess::setTransparentBackgroundARGB() { - if (!child_saver && !grabInput()) - { - kdWarning(1204) << "LockProcess::startSaver() grabInput() failed!!!!" << endl; - return false; - } - mBusy = false; - // eliminate nasty flicker on first show TQImage m_grayImage = TQImage( TQApplication::desktop()->width(), TQApplication::desktop()->height(), 32 ); m_grayImage = m_grayImage.convertDepth(32); @@ -1385,6 +1383,23 @@ bool LockProcess::startSaver() p.drawImage( 0, 0, m_grayImage ); p.end(); setBackgroundPixmap( m_root ); +} + +//--------------------------------------------------------------------------- +// +// Start the screen saver. +// +bool LockProcess::startSaver() +{ + if (!child_saver && !grabInput()) + { + kdWarning(1204) << "LockProcess::startSaver() grabInput() failed!!!!" << endl; + return false; + } + mBusy = false; + + // eliminate nasty flicker on first show + setTransparentBackgroundARGB(); saveVRoot(); @@ -1406,9 +1421,9 @@ bool LockProcess::startSaver() slotPaintBackground(rootWinSnapShot); } - if (((!(trinity_desktop_lock_delay_screensaver_start && trinity_desktop_lock_forced)) && (!trinity_desktop_lock_in_sec_dlg)) && mHackStartupEnabled) { + if (((!(trinity_desktop_lock_delay_screensaver_start && trinity_desktop_lock_forced)) && (!trinity_desktop_lock_in_sec_dlg)) && (mHackStartupEnabled || mOverrideHackStartupEnabled)) { if (argb_visual) { - setErasePixmap(TQPixmap()); + setTransparentBackgroundARGB(); } else { if (backingPixmap.isNull()) { @@ -1428,7 +1443,8 @@ bool LockProcess::startSaver() if (mHackStartupEnabled) mHackDelayStartupTimer->start(mHackDelayStartupTimeout, TRUE); } else { - if (mHackStartupEnabled == true) { + if (mHackStartupEnabled || mOverrideHackStartupEnabled) { + mOverrideHackStartupEnabled = false; startHack(); } else { @@ -1575,7 +1591,7 @@ void LockProcess::repaintRootWindowIfNeeded() if (trinity_desktop_lock_use_system_modal_dialogs) { if (!mHackProc.isRunning()) { if (argb_visual) { - setErasePixmap(TQPixmap()); + setTransparentBackgroundARGB(); erase(); } else { @@ -1608,7 +1624,7 @@ bool LockProcess::startHack() { // no resuming with dialog visible or when not visible if (argb_visual) { - setErasePixmap(TQPixmap()); + setTransparentBackgroundARGB(); } else { if (backingPixmap.isNull()) { @@ -1661,7 +1677,7 @@ bool LockProcess::startHack() if (trinity_desktop_lock_use_system_modal_dialogs) { // Make sure we have a nice clean display to start with! if (argb_visual) { - setErasePixmap(TQPixmap()); + setTransparentBackgroundARGB(); } else { if (backingPixmap.isNull()) { @@ -1701,7 +1717,7 @@ bool LockProcess::startHack() TQApplication::syncX(); if (!trinity_desktop_lock_use_system_modal_dialogs) { if (argb_visual) { - setErasePixmap(TQPixmap()); + setTransparentBackgroundARGB(); } else { if (backingPixmap.isNull()) { @@ -1713,7 +1729,7 @@ bool LockProcess::startHack() } } if (argb_visual) { - setErasePixmap(TQPixmap()); + setTransparentBackgroundARGB(); erase(); } else { @@ -1763,7 +1779,7 @@ void LockProcess::hackExited(KProcess *) TQApplication::syncX(); if (!trinity_desktop_lock_use_system_modal_dialogs) { if (argb_visual) { - setErasePixmap(TQPixmap()); + setTransparentBackgroundARGB(); } else { if (backingPixmap.isNull()) { @@ -1775,7 +1791,7 @@ void LockProcess::hackExited(KProcess *) } } if (argb_visual) { - setErasePixmap(TQPixmap()); + setTransparentBackgroundARGB(); } else { if (backingPixmap.isNull()) { @@ -1863,7 +1879,7 @@ void LockProcess::resume( bool force ) // no resuming with dialog visible or when not visible if (trinity_desktop_lock_use_system_modal_dialogs) { if (argb_visual) { - setErasePixmap(TQPixmap()); + setTransparentBackgroundARGB(); } else { if (backingPixmap.isNull()) { diff --git a/kdesktop/lock/lockprocess.h b/kdesktop/lock/lockprocess.h index e4c17eff9..bac71823e 100644 --- a/kdesktop/lock/lockprocess.h +++ b/kdesktop/lock/lockprocess.h @@ -110,6 +110,7 @@ private: void saveVRoot(); void setVRoot(Window win, Window rw); void removeVRoot(Window win); + void setTransparentBackgroundARGB(); bool grabKeyboard(); bool grabMouse(); bool grabInput(); @@ -195,6 +196,7 @@ private: int mHackDelayStartupTimeout; bool mHackStartupEnabled; + bool mOverrideHackStartupEnabled; bool mResizingDesktopLock; TQPixmap backingPixmap; diff --git a/kdesktop/lock/main.cc b/kdesktop/lock/main.cc index 66d4ec313..b920399c2 100644 --- a/kdesktop/lock/main.cc +++ b/kdesktop/lock/main.cc @@ -307,15 +307,12 @@ int main( int argc, char **argv ) } } -// FIXME -// Composite should be enabled where possible, however using ARGB visuals seems to cause problems -// with XScreenSaver hacks (they do not display). -// #ifdef COMPOSITE -// MyApp app(KApplication::openX11RGBADisplay()); -// argb_visual = app.isX11CompositionAvailable(); -// #else +#ifdef COMPOSITE + MyApp app(KApplication::openX11RGBADisplay()); + argb_visual = app.isX11CompositionAvailable(); +#else MyApp app; -// #endif +#endif kdDebug() << "app " << kdesktop_screen_number << " " << starting_screen << " " << child << " " << child_sockets.count() << " " << parent_connection << endl; app.disableSessionManagement(); |