Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 focuswriter (1.5.0-1) unstable; urgency=medium
 .
   * New upstream release
     - switched some libraries
     - supports qt5
   * Compile against qt5
   * Track upstream maintenance branch
     git merge --no-edit upstream/release-1.5
     git log --oneline -4 upstream/release-1.5 | tac
     - 2a14309 FIXED: Regression where menubar was not shown in Ubuntu.
     - 120d9af FIXED: Regression with default cursor width on Windows.
     - 7a80d49 FIXED: Missing libraries on Windows.
     - 392c386 FIXED: Compile issues with Qt 4.6.
Author: Barak A. Pearlmutter <bap@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- focuswriter-1.5.0.orig/resources/windows/installer.nsi
+++ focuswriter-1.5.0/resources/windows/installer.nsi
@@ -184,6 +184,9 @@ Section "install"
 	SetOutPath $INSTDIR\accessible
 	File $%QTDIR%\plugins\accessible\qtaccessiblewidgets.dll
 
+	SetOutPath $INSTDIR\audio
+	File $%QTDIR%\plugins\audio\qtaudio_windows.dll
+
 	SetOutPath $INSTDIR\bearer
 	File $%QTDIR%\plugins\bearer\qgenericbearer.dll
 	File $%QTDIR%\plugins\bearer\qnativewifibearer.dll
@@ -209,9 +212,16 @@ Section "install"
 	File $%QTDIR%\plugins\imageformats\qwbmp.dll
 	File $%QTDIR%\plugins\imageformats\qwebp.dll
 
+	SetOutPath $INSTDIR\mediaservice
+	File $%QTDIR%\plugins\mediaservice\dsengine.dll
+	File $%QTDIR%\plugins\mediaservice\qtmedia_audioengine.dll
+
 	SetOutPath $INSTDIR\platforms
 	File $%QTDIR%\plugins\platforms\qwindows.dll
 
+	SetOutPath $INSTDIR\printsupport
+	File $%QTDIR%\plugins\printsupport\windowsprintersupport.dll
+
 	SetOutPath $INSTDIR\sounds
 	File ..\sounds\*.wav
 
@@ -295,11 +305,14 @@ Section "Uninstall"
 	Delete $INSTDIR\ReadMe.txt
 	Delete $INSTDIR\*.dll
 	Delete $INSTDIR\accessible\*.dll
+	Delete $INSTDIR\audio\*.dll
 	Delete $INSTDIR\bearer\*.dll
 	Delete $INSTDIR\dictionaries\*\*\*
 	Delete $INSTDIR\icons\hicolor\*\*
 	Delete $INSTDIR\imageformats\*.dll
+	Delete $INSTDIR\mediaservice\*.dll
 	Delete $INSTDIR\platforms\qwindows.dll
+	Delete $INSTDIR\printsupport\*.dll
 	Delete $INSTDIR\sounds\*.wav
 	Delete $INSTDIR\themes\*\*
 	Delete $INSTDIR\translations\*.qm
@@ -310,9 +323,12 @@ Section "Uninstall"
 	RMDir /r $INSTDIR\icons
 	RMDir /r $INSTDIR\themes
 	RMDir $INSTDIR\accessible
+	RMDir $INSTDIR\audio
 	RMDir $INSTDIR\bearer
 	RMDir $INSTDIR\imageformats
+	RMDir $INSTDIR\mediaservice
 	RMDir $INSTDIR\platforms
+	RMDir $INSTDIR\printsupport
 	RMDir $INSTDIR\sounds
 	RMDir $INSTDIR\translations
 	RMDir $INSTDIR
--- focuswriter-1.5.0.orig/src/document.cpp
+++ focuswriter-1.5.0/src/document.cpp
@@ -69,6 +69,23 @@
 #include <algorithm>
 #include <ctime>
 
+#ifdef Q_OS_WIN
+#include <windows.h>
+#endif
+
+//-----------------------------------------------------------------------------
+
+static inline int cursorWidth()
+{
+#ifdef Q_OS_WIN
+	DWORD width = 1;
+	if (SystemParametersInfo(SPI_GETCARETWIDTH, 0, &width, 0))
+		return int(width);
+	else
+#endif
+		return -1;
+}
+
 //-----------------------------------------------------------------------------
 
 namespace
@@ -733,7 +750,7 @@ void Document::loadTheme(const Theme& th
 		QEvent e(QEvent::FontChange);
 		QApplication::sendEvent(m_text, &e);
 	}
-	m_text->setCursorWidth(!m_block_cursor ? style()->pixelMetric(QStyle::PM_TextCursorWidth) : m_text->fontMetrics().averageCharWidth());
+	m_text->setCursorWidth(!m_block_cursor ? cursorWidth() : m_text->fontMetrics().averageCharWidth());
 
 	int padding = theme.foregroundPadding();
 	m_layout->setRowMinimumHeight(0, padding);
@@ -797,7 +814,7 @@ void Document::loadPreferences()
 	}
 
 	m_block_cursor = Preferences::instance().blockCursor();
-	m_text->setCursorWidth(!m_block_cursor ? style()->pixelMetric(QStyle::PM_TextCursorWidth) : m_text->fontMetrics().averageCharWidth());
+	m_text->setCursorWidth(!m_block_cursor ? cursorWidth() : m_text->fontMetrics().averageCharWidth());
 	QFont font = m_text->font();
 	font.setStyleStrategy(Preferences::instance().smoothFonts() ? QFont::PreferAntialias : QFont::NoAntialias);
 	m_text->setFont(font);
--- focuswriter-1.5.0.orig/src/locale_dialog.cpp
+++ focuswriter-1.5.0/src/locale_dialog.cpp
@@ -125,8 +125,10 @@ void LocaleDialog::loadTranslator(const
 	translator.load(m_appname + current, m_path);
 	QCoreApplication::installTranslator(&translator);
 
+#if (QT_VERSION >= (QT_VERSION_CHECK(5,0,0)))
 	// Work around bug in Qt 5 where text direction is not loaded
 	QApplication::setLayoutDirection(QLocale(current).textDirection());
+#endif
 }
 
 //-----------------------------------------------------------------------------
--- focuswriter-1.5.0.orig/src/session_manager.cpp
+++ focuswriter-1.5.0/src/session_manager.cpp
@@ -40,6 +40,8 @@
 #include <QMessageBox>
 #include <QPushButton>
 
+#include <algorithm>
+
 //-----------------------------------------------------------------------------
 
 SessionManager::SessionManager(Window* parent)
--- focuswriter-1.5.0.orig/src/stack.cpp
+++ focuswriter-1.5.0/src/stack.cpp
@@ -696,7 +696,7 @@ void Stack::updateBackground()
 	QRect foreground = m_theme.foregroundRect(size());
 
 	QImage image(size(), QImage::Format_ARGB32_Premultiplied);
-	image.fill(m_theme.loadColor());
+	image.fill(m_theme.loadColor().rgb());
 	{
 		QPainter painter(&image);
 		QColor color = m_theme.foregroundColor();
--- focuswriter-1.5.0.orig/src/theme.cpp
+++ focuswriter-1.5.0/src/theme.cpp
@@ -259,7 +259,7 @@ QImage Theme::render(const QSize& backgr
 {
 	// Create image
 	QImage image(background, QImage::Format_ARGB32_Premultiplied);
-	image.fill(backgroundColor());
+	image.fill(backgroundColor().rgb());
 
 	QPainter painter(&image);
 	painter.setPen(Qt::NoPen);
@@ -321,7 +321,7 @@ QImage Theme::render(const QSize& backgr
 		QImage copy = image.copy(foreground);
 
 		QImage shadow(background, QImage::Format_ARGB32_Premultiplied);
-		shadow.fill(Qt::transparent);
+		shadow.fill(0);
 
 		QPainter shadow_painter(&shadow);
 		shadow_painter.setRenderHint(QPainter::Antialiasing);
--- focuswriter-1.5.0.orig/src/theme_dialog.cpp
+++ focuswriter-1.5.0/src/theme_dialog.cpp
@@ -56,7 +56,7 @@ static QColor averageImage(const QString
 	}
 
 	QImage image(reader.size(), QImage::Format_ARGB32_Premultiplied);
-	image.fill(color);
+	image.fill(color.rgb());
 	{
 		QPainter painter(&image);
 		painter.drawImage(0, 0, reader.read());
--- focuswriter-1.5.0.orig/src/window.cpp
+++ focuswriter-1.5.0/src/window.cpp
@@ -115,7 +115,11 @@ Window::Window(const QStringList& comman
 	new ActionManager(this);
 
 	// Create window contents first so they stack behind documents
+#ifndef Q_OS_MAC
+	menuBar()->setNativeMenuBar(false);
+#else
 	menuBar();
+#endif
 	m_toolbar = new QToolBar(this);
 	m_toolbar->setFloatable(false);
 	m_toolbar->setMovable(false);
--- focuswriter-1.5.0.orig/windows_deploy.bat
+++ focuswriter-1.5.0/windows_deploy.bat
@@ -57,6 +57,9 @@ MKDIR %APP%\accessible
 XCOPY /Q /S /Y %QTDIR%\plugins\accessible %APP%\accessible >nul
 DEL %APP%\accessible\*d.dll >nul
 
+MKDIR %APP%\audio
+COPY %QTDIR%\plugins\audio\qtaudio_windows.dll %APP%\audio >nul
+
 MKDIR %APP%\bearer
 XCOPY /Q /S /Y %QTDIR%\plugins\bearer %APP%\bearer >nul
 DEL %APP%\bearer\*d.dll >nul
@@ -68,6 +71,13 @@ MKDIR %APP%\imageformats
 XCOPY /Q /S /Y %QTDIR%\plugins\imageformats %APP%\imageformats >nul
 DEL %APP%\imageformats\*d.dll >nul
 
+MKDIR %APP%\mediaservice
+XCOPY /Q /S /Y %QTDIR%\plugins\mediaservice %APP%\mediaservice >nul
+DEL %APP%\mediaservice\*d.dll >nul
+
+MKDIR %APP%\printsupport
+COPY %QTDIR%\plugins\printsupport\windowsprintersupport.dll %APP%\printsupport >nul
+
 ECHO Making portable
 MKDIR %APP%\Data
 
