From e6f6f2e32306cc119b1d61744cf3106b2221fa92 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Fri, 6 May 2016 08:38:03 +0200 Subject: [PATCH 1/9] Fix for bad positioning of some objects (text boxes) after duplication --- src/board/UBBoardController.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index b04e5303..6ebe8ee5 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -62,6 +62,7 @@ #include "domain/UBGraphicsTextItem.h" #include "domain/UBPageSizeUndoCommand.h" #include "domain/UBGraphicsGroupContainerItem.h" +#include "domain/UBGraphicsStrokesGroup.h" #include "domain/UBItem.h" #include "board/UBFeaturesController.h" @@ -589,6 +590,10 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item) itemPos = commonItem->pos() + QPointF(shifting,shifting); itemSize = commonItem->boundingRect().size(); commonItem->setSelected(false); + + UBGraphicsStrokesGroup *stroke = dynamic_cast(commonItem); + if (stroke) + itemPos = QPointF(shifting, shifting); } UBMimeType::Enum itemMimeType; @@ -691,8 +696,7 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item) { mActiveScene->addItem(gitem); - // Translate the new object a bit - gitem->setPos(20, 20); + gitem->setPos(itemPos); mLastCreatedItem = gitem; gitem->setSelected(true); From 5f97b1cf6223589b87ccb64d8ec3a5d6a960520b Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Fri, 6 May 2016 12:25:34 +0200 Subject: [PATCH 2/9] Fixed indexing of control and display screens Caused problems e.g with podcast mode, where if the control and display views were swapped in the preferences, the wrong screen would be recorded when switching to desktop mode during recording of the podcast. This happened even if only one screen was plugged in, so a black screen was recorded in that case (at least on OS X 10.10) --- src/core/UBApplication.cpp | 15 +++++++++++++++ src/core/UBApplication.h | 3 +++ src/core/UBDisplayManager.cpp | 4 ++-- src/desktop/UBDesktopAnnotationController.cpp | 2 +- src/gui/UBScreenMirror.cpp | 2 +- src/podcast/UBPodcastController.cpp | 4 ++-- src/web/browser/WBBrowserWindow.cpp | 2 +- 7 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp index 494feff8..9e08461b 100644 --- a/src/core/UBApplication.cpp +++ b/src/core/UBApplication.cpp @@ -670,3 +670,18 @@ bool UBApplication::isFromWeb(QString url) return res; } + +QScreen* UBApplication::controlScreen() +{ + QList screenList = screens(); + if (screenList.size() == 1) + return screenList.first(); + + return screenList[controlScreenIndex()]; +} + + +int UBApplication::controlScreenIndex() +{ + return applicationController->displayManager()->controleScreenIndex(); +} diff --git a/src/core/UBApplication.h b/src/core/UBApplication.h index ccb8f605..848b96d3 100644 --- a/src/core/UBApplication.h +++ b/src/core/UBApplication.h @@ -100,6 +100,9 @@ class UBApplication : public QtSingleApplication static QString urlFromHtml(QString html); static bool isFromWeb(QString url); + static QScreen* controlScreen(); + static int controlScreenIndex(); + signals: public slots: diff --git a/src/core/UBDisplayManager.cpp b/src/core/UBDisplayManager.cpp index 21cb706d..89a80b96 100644 --- a/src/core/UBDisplayManager.cpp +++ b/src/core/UBDisplayManager.cpp @@ -71,7 +71,7 @@ void UBDisplayManager::initScreenIndexes() if (screenCount > 0) { mControlScreenIndex = mDesktop->primaryScreen(); - if (UBSettings::settings()->swapControlAndDisplayScreens->get().toBool()) + if (mDesktop->screenCount() > 1 && UBSettings::settings()->swapControlAndDisplayScreens->get().toBool()) { mControlScreenIndex = mControlScreenIndex^1; } @@ -118,7 +118,7 @@ int UBDisplayManager::numScreens() { if (mUseMultiScreen) { - return mDesktop->numScreens(); + return mDesktop->screenCount(); } else { diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 4f7a0a76..f34fb7b5 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -500,7 +500,7 @@ void UBDesktopAnnotationController::screenCapture() QPixmap UBDesktopAnnotationController::getScreenPixmap() { QDesktopWidget *desktop = QApplication::desktop(); - QScreen * screen = QApplication::primaryScreen(); + QScreen * screen = UBApplication::controlScreen(); QRect rect = desktop->screenGeometry(QCursor::pos()); diff --git a/src/gui/UBScreenMirror.cpp b/src/gui/UBScreenMirror.cpp index a8bc0f37..e9fd0020 100644 --- a/src/gui/UBScreenMirror.cpp +++ b/src/gui/UBScreenMirror.cpp @@ -99,7 +99,7 @@ void UBScreenMirror::grabPixmap() // this is the case we are showing the desktop but the is no widget and we use the last widget rectagle to know // what we have to grab. Not very good way of doing QDesktopWidget * desktop = QApplication::desktop(); - QScreen * screen = QApplication::primaryScreen(); + QScreen * screen = UBApplication::controlScreen(); mLastPixmap = screen->grabWindow(desktop->effectiveWinId(), mRect.x(), mRect.y(), mRect.width(), mRect.height()); } diff --git a/src/podcast/UBPodcastController.cpp b/src/podcast/UBPodcastController.cpp index b588ca96..9ac2fc1d 100644 --- a/src/podcast/UBPodcastController.cpp +++ b/src/podcast/UBPodcastController.cpp @@ -762,8 +762,8 @@ void UBPodcastController::timerEvent(QTimerEvent *event) && mSourceWidget == qApp->desktop()) { QDesktopWidget * dtop = QApplication::desktop(); - QRect dtopRect = dtop->screenGeometry(); - QScreen * screen = QApplication::primaryScreen(); + QRect dtopRect = dtop->screenGeometry(UBApplication::controlScreenIndex()); + QScreen * screen = UBApplication::controlScreen(); QPixmap desktop = screen->grabWindow(dtop->effectiveWinId(), dtopRect.x(), dtopRect.y(), dtopRect.width(), dtopRect.height()); diff --git a/src/web/browser/WBBrowserWindow.cpp b/src/web/browser/WBBrowserWindow.cpp index 8cba1382..520b861e 100644 --- a/src/web/browser/WBBrowserWindow.cpp +++ b/src/web/browser/WBBrowserWindow.cpp @@ -182,7 +182,7 @@ WBHistoryManager *WBBrowserWindow::historyManager() QSize WBBrowserWindow::sizeHint() const { - QRect desktopRect = QApplication::desktop()->screenGeometry(); + QRect desktopRect = QApplication::desktop()->screenGeometry(UBApplication::controlScreenIndex()); QSize size = desktopRect.size() * qreal(0.9); return size; } From 6593b22e5ef2821d905b0dd8827d77c7140b049e Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Fri, 6 May 2016 15:46:03 +0200 Subject: [PATCH 3/9] Updated Google Maps widget --- .../applications/GoogleMap.wgt/index.html | 187 ++++++++---------- 1 file changed, 81 insertions(+), 106 deletions(-) diff --git a/resources/library/applications/GoogleMap.wgt/index.html b/resources/library/applications/GoogleMap.wgt/index.html index 6f17c525..4a67c99e 100644 --- a/resources/library/applications/GoogleMap.wgt/index.html +++ b/resources/library/applications/GoogleMap.wgt/index.html @@ -1,116 +1,91 @@ - - + + Google Maps - - - - - - -
- + +
+ + From b1c2d010c134196bed739937c5b434fe8436ca92 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Mon, 9 May 2016 14:48:54 +0200 Subject: [PATCH 4/9] Removed remaining occurences of Q_WS_* --- src/core/UBApplicationController.cpp | 8 +------- src/frameworks/UBFileSystemUtils.cpp | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index f1cfa729..eb3d858b 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -67,7 +67,7 @@ -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC #include #endif @@ -121,12 +121,6 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, networkAccessManager = new QNetworkAccessManager (this); QTimer::singleShot (1000, this, SLOT (checkAtLaunch())); - - -#ifdef Q_WS_X11 - mMainWindow->setStyleSheet("QToolButton { font-size: 11px}"); -#endif - } diff --git a/src/frameworks/UBFileSystemUtils.cpp b/src/frameworks/UBFileSystemUtils.cpp index ec625841..1be67088 100644 --- a/src/frameworks/UBFileSystemUtils.cpp +++ b/src/frameworks/UBFileSystemUtils.cpp @@ -57,7 +57,7 @@ UBFileSystemUtils::~UBFileSystemUtils() QString UBFileSystemUtils::removeLocalFilePrefix(QString input) { -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN if(input.startsWith("file:///")) return input.mid(8); else From d52e45f4c1e87c363e546e48d0af9190dc208f79 Mon Sep 17 00:00:00 2001 From: Craig Date: Tue, 10 May 2016 15:33:48 +0200 Subject: [PATCH 5/9] Added missing Qt libs and plugins (fixes web widgets not working on Ubuntu 14.04) --- release_scripts/linux/package.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/release_scripts/linux/package.sh b/release_scripts/linux/package.sh index 1bdf72db..f64ddec3 100755 --- a/release_scripts/linux/package.sh +++ b/release_scripts/linux/package.sh @@ -199,6 +199,7 @@ if $BUNDLE_QT; then notifyProgress "Copying and stripping Qt plugins" mkdir -p $QT_PLUGINS_DEST_PATH copyQtPlugin audio + copyQtPlugin bearer copyQtPlugin generic copyQtPlugin iconengines copyQtPlugin imageformats @@ -232,6 +233,7 @@ if $BUNDLE_QT; then copyQtLibrary libQt5WebChannel copyQtLibrary libQt5WebKit copyQtLibrary libQt5WebKitWidgets + copyQtLibrary libQt5WebSockets copyQtLibrary libQt5Widgets copyQtLibrary libQt5XcbQpa copyQtLibrary libQt5Xml @@ -353,9 +355,11 @@ echo -n ", onboard" >> "$CONTROL_FILE" if $BUNDLE_QT; then # Listing some dependencies manually; ideally we should use dpkg -p recursively # to get the dependencies of the bundled shared libs & plugins. Or use static libs. - echo -n ", libxcb-render-util0" >> "$CONTROL_FILE" + echo -n ", libxcb1" >> "$CONTROL_FILE" echo -n ", libxcb-icccm4" >> "$CONTROL_FILE" echo -n ", libxcb-xkb1" >> "$CONTROL_FILE" + echo -n ", libxcb-image0" >> "$CONTROL_FILE" + echo -n ", libxcb-render-util0" >> "$CONTROL_FILE" else echo -n ", libqt5multimedia5-plugins" >> "$CONTROL_FILE" fi From 70b2fd960b0676552706df4ac341f1cb767cfd4a Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Wed, 11 May 2016 16:23:25 +0200 Subject: [PATCH 6/9] Fix for desktop mode partial screen capture taking an offset image of the desktop --- src/desktop/UBDesktopAnnotationController.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index f34fb7b5..a5b8e0aa 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -334,7 +334,8 @@ void UBDesktopAnnotationController::showWindow() #ifndef Q_OS_LINUX UBPlatformUtils::showFullScreen(mTransparentDrawingView); #else - // this is necessary to avoid unity to hide the panels + // this is necessary to avoid hiding the panels on Unity and Cinnamon + // if finer control is necessary, use qgetenv("XDG_CURRENT_DESKTOP") mTransparentDrawingView->show(); #endif UBPlatformUtils::setDesktopMode(true); @@ -431,7 +432,7 @@ void UBDesktopAnnotationController::customCapture() // need to show the window before execute it to avoid some glitch on windows. #ifndef Q_OS_WIN // Working only without this call on win32 desktop mode - customCaptureWindow.show(); + UBPlatformUtils::showFullScreen(&customCaptureWindow); #endif if (customCaptureWindow.execute(getScreenPixmap()) == QDialog::Accepted) From 81ad100610c7542f7cf6ecd690d442d06116e7f5 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Wed, 11 May 2016 17:13:38 +0200 Subject: [PATCH 7/9] Fix for window being placed badly on the screen when returning to board mode from desktop mode on some environments --- src/core/UBApplicationController.cpp | 2 +- src/desktop/UBDesktopAnnotationController.cpp | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index eb3d858b..daee10dd 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -375,7 +375,7 @@ void UBApplicationController::showBoard() mUninoteController->hideWindow(); - mMainWindow->show(); + UBPlatformUtils::showFullScreen(mMainWindow); emit mainModeChanged(Board); diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index a5b8e0aa..1fb97835 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -411,13 +411,7 @@ void UBDesktopAnnotationController::hideWindow() void UBDesktopAnnotationController::goToUniboard() { - onToolClicked(); - hideWindow(); - - UBPlatformUtils::setDesktopMode(false); - UBDrawingController::drawingController()->setInDestopMode(false); - - emit restoreUniboard(); + UBApplication::applicationController->showBoard(); } From 798dfb113fc2627cb7c4c52f898fc3d0518dbfc8 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Wed, 11 May 2016 17:36:22 +0200 Subject: [PATCH 8/9] Don't antialias bitmap images (=> screenshots now look quite a bit better) --- src/domain/UBGraphicsPixmapItem.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/domain/UBGraphicsPixmapItem.cpp b/src/domain/UBGraphicsPixmapItem.cpp index a2191321..522a9cb6 100644 --- a/src/domain/UBGraphicsPixmapItem.cpp +++ b/src/domain/UBGraphicsPixmapItem.cpp @@ -120,12 +120,16 @@ void UBGraphicsPixmapItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + painter->setRenderHint(QPainter::Antialiasing, false); + // Never draw the rubber band, we draw our custom selection with the DelegateFrame QStyleOptionGraphicsItem styleOption = QStyleOptionGraphicsItem(*option); styleOption.state &= ~QStyle::State_Selected; QGraphicsPixmapItem::paint(painter, &styleOption, widget); Delegate()->postpaint(painter, option, widget); + + painter->setRenderHint(QPainter::Antialiasing, true); } From 699e8ae1843f00001d9d7513d4ed8a5a67723853 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Thu, 12 May 2016 16:41:55 +0200 Subject: [PATCH 9/9] Bumped version to 1.3.1 --- OpenBoard.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenBoard.pro b/OpenBoard.pro index 4558b666..50ea777a 100644 --- a/OpenBoard.pro +++ b/OpenBoard.pro @@ -10,7 +10,7 @@ CONFIG += debug_and_release \ VERSION_MAJ = 1 VERSION_MIN = 3 -VERSION_PATCH = 0 +VERSION_PATCH = 1 VERSION_TYPE = r # a = alpha, b = beta, rc = release candidate, r = release, other => error VERSION_BUILD = 0