From 424dc1d89dec2aab75adb49b679eb6ae5ae85650 Mon Sep 17 00:00:00 2001
From: Claudio Valerio <claudio@sente.ch>
Date: Mon, 5 Sep 2011 13:57:29 +0200
Subject: [PATCH] Fixed bug on linux: after maximazing the palette doesn't
 update the mask. Fixed issue: http://188.165.53.52/jira/browse/SANKORE-117

---
 src/desktop/UBDesktopAnnotationController.cpp |  1 +
 src/desktop/UBDesktopPalette.cpp              | 13 +++++++++----
 src/desktop/UBDesktopPalette.h                |  5 ++++-
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp
index d4f95361..ca70f989 100644
--- a/src/desktop/UBDesktopAnnotationController.cpp
+++ b/src/desktop/UBDesktopAnnotationController.cpp
@@ -104,6 +104,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
         connect(mKeyboardPalette, SIGNAL(keyboardActivated(bool)), mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); 
 #ifdef Q_WS_X11
         connect(mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask()));
+        connect(mDesktopPalette,SIGNAL(refreshMask()), this, SLOT(refreshMask()));
 #endif
     }
 
diff --git a/src/desktop/UBDesktopPalette.cpp b/src/desktop/UBDesktopPalette.cpp
index ba88e3b4..d3641157 100644
--- a/src/desktop/UBDesktopPalette.cpp
+++ b/src/desktop/UBDesktopPalette.cpp
@@ -136,8 +136,11 @@ void UBDesktopPalette::minimizeMe(eMinimizedLocation location)
     actions << mMaximizeAction;
     setActions(actions);
 
-    QSize newSize = preferredSize();
-    this->resize(newSize);
+    adjustSizeAndPosition();
+
+#ifdef Q_WS_X11
+        emit refreshMask();
+#endif
 }
 
 //  Called when the user wants to maximize the palette
@@ -161,11 +164,13 @@ void UBDesktopPalette::maximizeMe()
 
     setActions(actions);
 
-    QSize newSize = preferredSize();
-    this->resize(newSize);
+    adjustSizeAndPosition();
 
     // Notify that the maximization has been done
     emit maximized();
+#ifdef Q_WS_X11
+        emit refreshMask();
+#endif
 }
 
 void UBDesktopPalette::showEvent(QShowEvent *event)
diff --git a/src/desktop/UBDesktopPalette.h b/src/desktop/UBDesktopPalette.h
index 83c01eab..cd22d43e 100644
--- a/src/desktop/UBDesktopPalette.h
+++ b/src/desktop/UBDesktopPalette.h
@@ -33,7 +33,10 @@ class UBDesktopPalette : public UBActionPalette
         void customClick();
         void windowClick();
         void screenClick();
-//        void showVirtualKeyboard(bool);
+
+#ifdef Q_WS_X11
+        void refreshMask();
+#endif
 
     public slots: