From d876b387647e3b23185decd3e332945ae8195075 Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Tue, 24 May 2011 09:32:26 +0200 Subject: [PATCH] Fixed issue Sankore-31 --- src/core/UBApplication.cpp | 7 ++++++- src/desktop/UBDesktopAnnotationController.cpp | 1 - src/frameworks/UBPlatformUtils_mac.mm | 4 +++- src/gui/UBKeyboardPalette.cpp | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp index b532386b..b3e8582d 100644 --- a/src/core/UBApplication.cpp +++ b/src/core/UBApplication.cpp @@ -62,6 +62,9 @@ const QString UBApplication::mimeTypeUniboardPage = QString("application/vnd.mne const QString UBApplication::mimeTypeUniboardPageItem = QString("application/vnd.mnemis-uniboard-page-item"); const QString UBApplication::mimeTypeUniboardPageThumbnail = QString("application/vnd.mnemis-uniboard-thumbnail"); +#ifdef Q_WS_MAC +bool bIsMinimized = false; +#endif QObject* UBApplication::staticMemoryCleaner = 0; @@ -308,6 +311,7 @@ int UBApplication::exec(const QString& pFileToImport) void UBApplication::showMinimized() { mainWindow->hide(); + bIsMinimized = true; } #endif @@ -496,8 +500,9 @@ bool UBApplication::eventFilter(QObject *obj, QEvent *event) } #ifdef Q_WS_MAC - if (event->type() == QEvent::ApplicationActivate){ + if (bIsMinimized && event->type() == QEvent::ApplicationActivate){ if (mainWindow->isHidden()) mainWindow->show(); + bIsMinimized = false; } #endif return result; diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 1073e431..60ab2150 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -114,7 +114,6 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) if (UBPlatformUtils::hasVirtualKeyboard()) { mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView); - connect(mKeyboardPalette, SIGNAL(keyboardActivated(bool)), mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); } diff --git a/src/frameworks/UBPlatformUtils_mac.mm b/src/frameworks/UBPlatformUtils_mac.mm index e760ff17..b97bf821 100644 --- a/src/frameworks/UBPlatformUtils_mac.mm +++ b/src/frameworks/UBPlatformUtils_mac.mm @@ -211,7 +211,9 @@ void UBPlatformUtils::disableShadow(QWidget *widget) widget->winId(); ChangeWindowAttributes(qt_mac_window_for(widget), kWindowNoShadowAttribute, kWindowNoAttributes); #else - Q_UNUSED(widget); + NSView* view = (NSView*)widget->winId(); + NSWindow* window = [view window]; + [window setHasShadow:NO]; #endif } diff --git a/src/gui/UBKeyboardPalette.cpp b/src/gui/UBKeyboardPalette.cpp index d195046b..3a6dc992 100644 --- a/src/gui/UBKeyboardPalette.cpp +++ b/src/gui/UBKeyboardPalette.cpp @@ -53,8 +53,8 @@ UBKeyboardPalette* UBKeyboardPalette::create(QWidget *parent) instances.append(instance); instance->setKeyButtonSize(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize->get().toString()); - instance->setAutoMinimize(UBSettings::settings()->boardKeyboardPaletteAutoMinimize->get().toBool()); - instance->setVisible(false); + instance->setAutoMinimize(UBSettings::settings()->boardKeyboardPaletteAutoMinimize->get().toBool()); + instance->setVisible(false); connect(UBSettings::settings()->boardKeyboardPaletteAutoMinimize , SIGNAL(changed(QVariant)), instance, SLOT(keyboardPaletteAutoMinimizeChanged(QVariant))); connect(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize, SIGNAL(changed(QVariant)), instance, SLOT(keyboardPaletteButtonSizeChanged(QVariant)));