Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
2.1.7 release
Browse files Browse the repository at this point in the history
Signed-off-by: Yuhang Zhao <[email protected]>
  • Loading branch information
wangwenx190 committed Jun 25, 2022
1 parent 75f1921 commit a89f19a
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 43 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
cmake_minimum_required(VERSION 3.20)

project(FramelessHelper
VERSION 2.1.1.0
VERSION 2.1.7.0
DESCRIPTION "Cross-platform window customization framework for Qt Widgets and Qt Quick."
HOMEPAGE_URL "https://github.com/wangwenx190/framelesshelper/"
LANGUAGES CXX
Expand Down
9 changes: 9 additions & 0 deletions examples/quick/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ int main(int argc, char *argv[])
#endif

const QUrl mainUrl(FRAMELESSHELPER_STRING_LITERAL("qrc:///Demo/qml/MainWindow.qml"));

#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed, &application,
[](const QUrl &url){
qCritical() << "The QML engine failed to create component:" << url;
QCoreApplication::exit(-1);
}, Qt::QueuedConnection);
#else
const QMetaObject::Connection connection = QObject::connect(
&engine, &QQmlApplicationEngine::objectCreated, &application,
[&mainUrl, &connection](QObject *object, const QUrl &url) {
Expand All @@ -94,6 +102,7 @@ int main(int argc, char *argv[])
QCoreApplication::exit(-1);
}
}, Qt::QueuedConnection);
#endif

engine.load(mainUrl);

Expand Down
2 changes: 1 addition & 1 deletion include/FramelessHelper/Core/framelesshelpercore_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE

[[maybe_unused]] static constexpr const int FRAMELESSHELPER_VERSION_MAJOR = 2;
[[maybe_unused]] static constexpr const int FRAMELESSHELPER_VERSION_MINOR = 1;
[[maybe_unused]] static constexpr const int FRAMELESSHELPER_VERSION_PATCH = 1;
[[maybe_unused]] static constexpr const int FRAMELESSHELPER_VERSION_PATCH = 7;
[[maybe_unused]] static constexpr const int FRAMELESSHELPER_VERSION_TWEAK = 0;
[[maybe_unused]] static constexpr const int FRAMELESSHELPER_VERSION =
FRAMELESSHELPER_MAKE_VERSION(FRAMELESSHELPER_VERSION_MAJOR, FRAMELESSHELPER_VERSION_MINOR,
Expand Down
4 changes: 2 additions & 2 deletions src/core/framelesshelpercore.rc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,0,0
PRODUCTVERSION 2,1,1,0
PRODUCTVERSION 2,1,7,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
Expand All @@ -51,7 +51,7 @@ BEGIN
VALUE "OriginalFilename", "FramelessHelperCore.dll"
#endif
VALUE "ProductName", "FramelessHelper"
VALUE "ProductVersion", "2.1.1.0"
VALUE "ProductVersion", "2.1.7.0"
VALUE "InternalName", "FramelessHelperCore"
END
END
Expand Down
110 changes: 75 additions & 35 deletions src/core/utils_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,92 +160,132 @@ template<typename T>
quint32 x11_appRootWindow(const int screen)
#endif
{
if (!qApp)
if (!qApp) {
return 0;
}
QPlatformNativeInterface *native = qApp->platformNativeInterface();
if (!native)
if (!native) {
return 0;
QScreen *scr = screen == -1 ? QGuiApplication::primaryScreen() : x11_findScreenForVirtualDesktop(screen);
if (!scr)
}
QScreen *scr = ((screen == -1) ? QGuiApplication::primaryScreen() : x11_findScreenForVirtualDesktop(screen));
if (!scr) {
return 0;
}
return static_cast<xcb_window_t>(reinterpret_cast<quintptr>(native->nativeResourceForScreen(QByteArrayLiteral("rootwindow"), scr)));
}

[[maybe_unused]] [[nodiscard]] static inline int x11_appScreen()
{
if (!qApp)
if (!qApp) {
return 0;
}
QPlatformNativeInterface *native = qApp->platformNativeInterface();
if (!native)
if (!native) {
return 0;
}
return reinterpret_cast<qintptr>(native->nativeResourceForIntegration(QByteArrayLiteral("x11screen")));
}

[[maybe_unused]] [[nodiscard]] static inline quint32 x11_appTime()
{
if (!qApp)
if (!qApp) {
return 0;
}
QPlatformNativeInterface *native = qApp->platformNativeInterface();
if (!native)
if (!native) {
return 0;
}
QScreen *screen = QGuiApplication::primaryScreen();
if (!screen) {
return 0;
QScreen* screen = QGuiApplication::primaryScreen();
return static_cast<xcb_timestamp_t>(reinterpret_cast<quintptr>(native->nativeResourceForScreen("apptime", screen)));
}
return static_cast<xcb_timestamp_t>(reinterpret_cast<quintptr>(native->nativeResourceForScreen(QByteArrayLiteral("apptime"), screen)));
}

[[maybe_unused]] [[nodiscard]] static inline quint32 x11_appUserTime()
{
if (!qApp)
if (!qApp) {
return 0;
}
QPlatformNativeInterface *native = qApp->platformNativeInterface();
if (!native)
if (!native) {
return 0;
QScreen* screen = QGuiApplication::primaryScreen();
return static_cast<xcb_timestamp_t>(reinterpret_cast<quintptr>(native->nativeResourceForScreen("appusertime", screen)));
}
QScreen *screen = QGuiApplication::primaryScreen();
if (!screen) {
return 0;
}
return static_cast<xcb_timestamp_t>(reinterpret_cast<quintptr>(native->nativeResourceForScreen(QByteArrayLiteral("appusertime"), screen)));
}

[[maybe_unused]] [[nodiscard]] static inline quint32 x11_getTimestamp()
{
if (!qApp)
if (!qApp) {
return 0;
}
QPlatformNativeInterface *native = qApp->platformNativeInterface();
if (!native)
if (!native) {
return 0;
QScreen* screen = QGuiApplication::primaryScreen();
return static_cast<xcb_timestamp_t>(reinterpret_cast<quintptr>(native->nativeResourceForScreen("gettimestamp", screen)));
}
QScreen *screen = QGuiApplication::primaryScreen();
if (!screen) {
return 0;
}
return static_cast<xcb_timestamp_t>(reinterpret_cast<quintptr>(native->nativeResourceForScreen(QByteArrayLiteral("gettimestamp"), screen)));
}

[[maybe_unused]] [[nodiscard]] static inline QByteArray x11_nextStartupId()
{
if (!qApp)
return QByteArray();
if (!qApp) {
return {};
}
QPlatformNativeInterface *native = qApp->platformNativeInterface();
if (!native)
return QByteArray();
return static_cast<char *>(native->nativeResourceForIntegration("startupid"));
if (!native) {
return {};
}
return static_cast<char *>(native->nativeResourceForIntegration(QByteArrayLiteral("startupid")));
}

[[maybe_unused]] [[nodiscard]] static inline Display *x11_display()
{
if (!qApp)
if (!qApp) {
return nullptr;
QPlatformNativeInterface *native = qApp->platformNativeInterface();
if (!native)
}
#if (QT_VERSION >= QT_VERSION_CHECK(6, 2, 0))
using namespace QNativeInterface;
const auto native = qApp->nativeInterface<QX11Application>();
#else
const auto native = qApp->platformNativeInterface();
#endif
if (!native) {
return nullptr;

void *display = native->nativeResourceForIntegration(QByteArray("display"));
return reinterpret_cast<Display *>(display);
}
#if (QT_VERSION >= QT_VERSION_CHECK(6, 2, 0))
return native->display();
#else
return reinterpret_cast<Display *>(native->nativeResourceForIntegration(QByteArrayLiteral("display")));
#endif
}

[[maybe_unused]] [[nodiscard]] static inline xcb_connection_t *x11_connection()
{
if (!qApp)
if (!qApp) {
return nullptr;
QPlatformNativeInterface *native = qApp->platformNativeInterface();
if (!native)
}
#if (QT_VERSION >= QT_VERSION_CHECK(6, 2, 0))
using namespace QNativeInterface;
const auto native = qApp->nativeInterface<QX11Application>();
#else
const auto native = qApp->platformNativeInterface();
#endif
if (!native) {
return nullptr;

void *connection = native->nativeResourceForIntegration(QByteArray("connection"));
return reinterpret_cast<xcb_connection_t *>(connection);
}
#if (QT_VERSION >= QT_VERSION_CHECK(6, 2, 0))
return native->connection();
#else
return reinterpret_cast<xcb_connection_t *>(native->nativeResourceForIntegration(QByteArrayLiteral("connection")));
#endif
}

static inline void
Expand Down
4 changes: 2 additions & 2 deletions src/quick/framelesshelperquick.rc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,0,0
PRODUCTVERSION 2,1,1,0
PRODUCTVERSION 2,1,7,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
Expand All @@ -51,7 +51,7 @@ BEGIN
VALUE "OriginalFilename", "FramelessHelperQuick.dll"
#endif
VALUE "ProductName", "FramelessHelper"
VALUE "ProductVersion", "2.1.1.0"
VALUE "ProductVersion", "2.1.7.0"
VALUE "InternalName", "FramelessHelperQuick"
END
END
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/framelesshelperwidgets.rc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,0,0
PRODUCTVERSION 2,1,1,0
PRODUCTVERSION 2,1,7,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
Expand All @@ -51,7 +51,7 @@ BEGIN
VALUE "OriginalFilename", "FramelessHelperWidgets.dll"
#endif
VALUE "ProductName", "FramelessHelper"
VALUE "ProductVersion", "2.1.1.0"
VALUE "ProductVersion", "2.1.7.0"
VALUE "InternalName", "FramelessHelperWidgets"
END
END
Expand Down

0 comments on commit a89f19a

Please sign in to comment.