summaryrefslogtreecommitdiffstats
path: root/klipper/toplevel.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-07-08 08:27:10 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-07-08 08:27:10 -0500
commit745063fab8573daad8f3a174809c2da5d98f4fa6 (patch)
tree932719ae5f8d33c1a894c8c6f85677823d8811e2 /klipper/toplevel.cpp
parent6ee99456cc9fbcf6a6f61e4dd293a6cf438075a5 (diff)
downloadtdebase-745063fab8573daad8f3a174809c2da5d98f4fa6.tar.gz
tdebase-745063fab8573daad8f3a174809c2da5d98f4fa6.zip
Avoid excessively long Klipper startup time due to oversized tray icon creation when icon widget has not yet been shown
Diffstat (limited to 'klipper/toplevel.cpp')
-rw-r--r--klipper/toplevel.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/klipper/toplevel.cpp b/klipper/toplevel.cpp
index b30d551c1..ba4b255b6 100644
--- a/klipper/toplevel.cpp
+++ b/klipper/toplevel.cpp
@@ -198,12 +198,21 @@ KlipperWidget::KlipperWidget( TQWidget *parent, TDEConfig* config )
if ( isApplet() ) {
m_pixmap = KSystemTray::loadIcon( "klipper" );
+ m_iconOrigWidth = width();
+ m_iconOrigHeight = height();
}
else {
- m_pixmap = KSystemTray::loadSizedIcon( "klipper", width() );
+ if (isShown()) {
+ m_pixmap = KSystemTray::loadSizedIcon( "klipper", width() );
+ m_iconOrigWidth = width();
+ m_iconOrigHeight = height();
+ }
+ else {
+ m_pixmap = KSystemTray::loadIcon( "klipper" );
+ m_iconOrigWidth = m_pixmap.width();
+ m_iconOrigHeight = m_pixmap,height();
+ }
}
- m_iconOrigWidth = width();
- m_iconOrigHeight = height();
adjustSize();
globalKeys = new TDEGlobalAccel(TQT_TQOBJECT(this));