fix crash on windows
This commit is contained in:
parent
4694696c5d
commit
8ecff5763b
@ -654,6 +654,12 @@ if(QT_VERSION_MAJOR EQUAL 6)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
target_link_libraries(rssguard PUBLIC
|
||||||
|
Qt${QT_VERSION_MAJOR}::GuiPrivate
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(USE_WEBENGINE)
|
if(USE_WEBENGINE)
|
||||||
target_link_libraries(rssguard PUBLIC
|
target_link_libraries(rssguard PUBLIC
|
||||||
Qt${QT_VERSION_MAJOR}::WebEngineWidgets
|
Qt${QT_VERSION_MAJOR}::WebEngineWidgets
|
||||||
|
@ -54,6 +54,15 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
|
#if QT_VERSION_MAJOR == 5
|
||||||
|
#include <QtPlatformHeaders/QWindowsWindowFunctions>
|
||||||
|
#else
|
||||||
|
#include <QWindow>
|
||||||
|
#include <QtGui/qpa/qplatformwindow_p.h>
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
#include <ShObjIdl.h>
|
#include <ShObjIdl.h>
|
||||||
|
|
||||||
@ -623,13 +632,25 @@ void Application::showTrayIcon() {
|
|||||||
if (SystemTrayIcon::isSystemTrayAreaAvailable()) {
|
if (SystemTrayIcon::isSystemTrayAreaAvailable()) {
|
||||||
qWarningNN << LOGSEC_GUI << "Tray icon is available, showing now.";
|
qWarningNN << LOGSEC_GUI << "Tray icon is available, showing now.";
|
||||||
trayIcon()->show();
|
trayIcon()->show();
|
||||||
|
|
||||||
offerChanges();
|
|
||||||
offerPolls();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_feedReader->feedsModel()->notifyWithCounts();
|
m_feedReader->feedsModel()->notifyWithCounts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: Below things have to be performed after tray icon is (if enabled)
|
||||||
|
// initialized.
|
||||||
|
offerChanges();
|
||||||
|
offerPolls();
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
|
#if QT_VERSION_MAJOR == 6
|
||||||
|
// NOTE: Fixes https://github.com/martinrotter/rssguard/issues/953 for Qt 6.
|
||||||
|
using QWindowsWindow = QNativeInterface::Private::QWindowsWindow;
|
||||||
|
if (auto w_w = qApp->mainForm()->windowHandle()->nativeInterface<QWindowsWindow>()) {
|
||||||
|
w_w->setHasBorderInFullScreen(true);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -28,12 +28,6 @@ if(QT_VERSION_MAJOR EQUAL 6)
|
|||||||
target_link_libraries(app PUBLIC
|
target_link_libraries(app PUBLIC
|
||||||
Qt${QT_VERSION_MAJOR}::Core5Compat
|
Qt${QT_VERSION_MAJOR}::Core5Compat
|
||||||
)
|
)
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
target_link_libraries(app PUBLIC
|
|
||||||
Qt${QT_VERSION_MAJOR}::GuiPrivate
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
#include <QtPlatformHeaders/QWindowsWindowFunctions>
|
#include <QtPlatformHeaders/QWindowsWindowFunctions>
|
||||||
#else
|
#else
|
||||||
#include <QWindow>
|
#include <QWindow>
|
||||||
#include <QtGui/qpa/qplatformwindow_p.h>
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -118,15 +117,5 @@ int main(int argc, char* argv[]) {
|
|||||||
qApp
|
qApp
|
||||||
->parseCmdArgumentsFromOtherInstance(qApp->cmdParser()->positionalArguments().join(QSL(ARGUMENTS_LIST_SEPARATOR)));
|
->parseCmdArgumentsFromOtherInstance(qApp->cmdParser()->positionalArguments().join(QSL(ARGUMENTS_LIST_SEPARATOR)));
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
|
||||||
#if QT_VERSION_MAJOR == 6
|
|
||||||
// NOTE: Fixes https://github.com/martinrotter/rssguard/issues/953 for Qt 6.
|
|
||||||
using QWindowsWindow = QNativeInterface::Private::QWindowsWindow;
|
|
||||||
if (auto w_w = main_window.windowHandle()->nativeInterface<QWindowsWindow>()) {
|
|
||||||
w_w->setHasBorderInFullScreen(true);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return Application::exec();
|
return Application::exec();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user