$NetBSD: patch-ae,v 1.1 2010/10/02 10:08:31 wiz Exp $

commit 7dbec1171386f182be77942ae43dc3684a96cfc4
Author: Mark Kretschmann <kretschmann@kde.org>
Date:   Sat Oct 2 09:06:11 2010 +0200

    Better workaround for wrong applet size on startup.

    This version also works in the case that Amarok was hidden to
    tray before starting, and it does not produce a jerking motion
    when starting in fullscreen mode.
    Thanks to Felix Geyer <debfx-pkg@fobos.de> for the idea.

    It might worth to include this patch in Amarok packages.

--- src/MainWindow.cpp.orig	2010-09-15 21:24:11.000000000 +0000
+++ src/MainWindow.cpp
@@ -506,6 +506,13 @@ MainWindow::showEvent(QShowEvent* e)
     if (!m_layoutEverRestored)
         restoreLayout();
 
+    static bool windowEverShown = false;
+    if ( !windowEverShown )
+    {
+        windowEverShown = true;
+        QTimer::singleShot( 250, this, SLOT( resizeWindowHack() ) );
+    }
+
     QWidget::showEvent(e);
 }
 
@@ -1704,4 +1711,14 @@ MainWindow::isWaitingForCd() const
     return m_waitingForCd;
 }
 
+void
+MainWindow::resizeWindowHack()
+{
+    // HACK
+    // This code works around a bug in KDE 4.5, which causes our Plasma applets to show
+    // with a wrong initial size. Remove when this bug is fixed in Plasma.
+    resize( width(), height() - 1 );
+    resize( width(), height() + 1 );
+}
+
 #include "MainWindow.moc"
