From 5e9ef0f08644b18efe82cbae031b8c1fef6fef5f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 25 Sep 2010 21:30:31 +0000 Subject: Fixed logout UI glitch Improved appearance of KDM O2 Enterprise theme git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1179564 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdm/kfrontend/themes/o2_enterprise/Dialog.png | Bin 5098 -> 4167 bytes kicker/kicker/ui/k_mnu.cpp | 34 ++++++++++++++++++++++++++ kicker/kicker/ui/k_mnu.h | 3 +++ ksmserver/shutdowndlg.cpp | 14 +++++++---- ksmserver/shutdowndlg.h | 1 + 5 files changed, 47 insertions(+), 5 deletions(-) diff --git a/kdm/kfrontend/themes/o2_enterprise/Dialog.png b/kdm/kfrontend/themes/o2_enterprise/Dialog.png index 440bf6f43..d38a35983 100644 Binary files a/kdm/kfrontend/themes/o2_enterprise/Dialog.png and b/kdm/kfrontend/themes/o2_enterprise/Dialog.png differ diff --git a/kicker/kicker/ui/k_mnu.cpp b/kicker/kicker/ui/k_mnu.cpp index 9328a8586..0506201f5 100644 --- a/kicker/kicker/ui/k_mnu.cpp +++ b/kicker/kicker/ui/k_mnu.cpp @@ -33,6 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include #include +#include #include #include @@ -115,6 +116,39 @@ void PanelKMenu::slotServiceStartedByStorageId(TQString starter, } } +void PanelKMenu::hideMenu() +{ + hide(); + + // Try to redraw the area under the menu + // Qt makes this surprisingly difficult to do in a timely fashion! + while (isShown() == true) + kapp->eventLoop()->processEvents(1000); + TQTimer *windowtimer = new TQTimer( this ); + connect( windowtimer, SIGNAL(timeout()), this, SLOT(windowClearTimeout()) ); + windowTimerTimedOut = false; + windowtimer->start( 0, TRUE ); // Wait for all window system events to be processed + while (windowTimerTimedOut == false) + kapp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput, 1000); + + // HACK + // The K Menu takes an unknown amount of time to disappear, and redrawing + // the underlying window(s) also takes time. This should allow both of those + // events to occur (unless you're on a 200MHz Pentium 1 or similar ;-)) + // thereby removing a bad shutdown screen artifact while still providing + // a somewhat snappy user interface. + TQTimer *delaytimer = new TQTimer( this ); + connect( delaytimer, SIGNAL(timeout()), this, SLOT(windowClearTimeout()) ); + windowTimerTimedOut = false; + delaytimer->start( 100, TRUE ); // Wait for 100 milliseconds + while (windowTimerTimedOut == false) + kapp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput, 1000); +} + +void PanelKMenu::windowClearTimeout() +{ + windowTimerTimedOut = true; +} bool PanelKMenu::loadSidePixmap() { diff --git a/kicker/kicker/ui/k_mnu.h b/kicker/kicker/ui/k_mnu.h index 6dedec4c9..16655bdd6 100644 --- a/kicker/kicker/ui/k_mnu.h +++ b/kicker/kicker/ui/k_mnu.h @@ -50,6 +50,7 @@ class PanelKMenu : public PanelServiceMenu, public DCOPObject k_dcop: void slotServiceStartedByStorageId(TQString starter, TQString desktopPath); + void hideMenu(); public: PanelKMenu(); @@ -86,6 +87,7 @@ protected slots: virtual void configChanged(); void updateRecent(); void repairDisplay(); + void windowClearTimeout(); protected: TQRect sideImageRect(); @@ -117,6 +119,7 @@ private: static const int searchLineID; TQTimer *displayRepairTimer; bool displayRepaired; + bool windowTimerTimedOut; }; #endif diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp index f6295a158..0c7211efd 100644 --- a/ksmserver/shutdowndlg.cpp +++ b/ksmserver/shutdowndlg.cpp @@ -1,6 +1,7 @@ /***************************************************************** ksmserver - the KDE session management server +Copyright (C) 2010 Timothy Pearson Copyright (C) 2000 Matthias Ettrich ******************************************************************/ @@ -27,6 +28,7 @@ Copyright (C) 2000 Matthias Ettrich #include #include #include +#include #include #include @@ -72,10 +74,12 @@ KSMShutdownFeedback::KSMShutdownFeedback() m_unfadedImage(), m_grayImage(), m_fadeTime(), - m_pmio() + m_pmio(), + m_greyImageCreated( FALSE ) { - m_grayImage = TQImage::TQImage(); + DCOPRef("kicker", "KMenu").call("hideMenu"); // Make sure the K Menu is completely removed from the screen before taking a snapshot... + m_grayImage = TQPixmap::grabWindow(qt_xrootwin(), 0, 0, TQApplication::desktop()->width(), TQApplication::desktop()->height()).convertToImage(); m_unfadedImage = TQImage::TQImage(); resize(0, 0); setShown(true); @@ -110,13 +114,13 @@ void KSMShutdownFeedback::slotPaintEffect() // if slotPaintEffect() is called first time, we have to initialize the gray image // we also could do that in the constructor, but then the displaying of the // logout-UI would be too much delayed... - if ( m_grayImage.isNull() ) + if ( m_greyImageCreated == false ) { + m_greyImageCreated = true; setBackgroundMode( TQWidget::NoBackground ); setGeometry( TQApplication::desktop()->geometry() ); m_root.resize( width(), height() ); // for the default logout - m_grayImage = TQPixmap::grabWindow(qt_xrootwin(), 0, 0, TQApplication::desktop()->width(), TQApplication::desktop()->height()).convertToImage(); m_unfadedImage = m_grayImage.copy(); register uchar * r = m_grayImage.bits(); register uchar * g = m_grayImage.bits() + 1; @@ -266,7 +270,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent, { TQVBoxLayout* vbox = new TQVBoxLayout( this ); - + TQFrame* frame = new TQFrame( this ); frame->setFrameStyle( TQFrame::StyledPanel | TQFrame::Raised ); diff --git a/ksmserver/shutdowndlg.h b/ksmserver/shutdowndlg.h index 79ee8ca37..65081e1c3 100644 --- a/ksmserver/shutdowndlg.h +++ b/ksmserver/shutdowndlg.h @@ -66,6 +66,7 @@ private: TQTime m_fadeTime; int m_rowsDone; KPixmapIO m_pmio; + bool m_greyImageCreated; }; -- cgit v1.2.3