Skip to content

Commit

Permalink
fix: existing wm titlebar
Browse files Browse the repository at this point in the history
  It's unload dxcb platform plugin, and it's an change for qt,
using `QDir().entryList()` to find plugin in qt6.2 before,
and using `QDirIterator()` to find in qt6.2 after.
QDir will sort result by name default, which is like `ls`,
and QDirIterator doesn't sort result, which is like `ls -U`.
  now we fix it in application temporarily.

Issue: linuxdeepin/developer-center#6686
  • Loading branch information
18202781743 committed Jan 5, 2024
1 parent 765ca90 commit fa8b8e9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ PRIVATE
target_link_libraries(${BIN_NAME} PRIVATE
${DTK_NS}::Core
${DTK_NS}::Gui
Qt::GuiPrivate
Qt::Qml
Qt::Quick
Qt::QuickControls2
Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Build-Depends:
# v-- to get systemduserunitdir from its pkg-config data
systemd,
qt6-base-dev,
qt6-base-private-dev,
qt6-svg-dev,
qt6-declarative-dev,
qt6-tools-dev,
Expand Down
14 changes: 14 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,28 @@
#include <launcherfoldericonprovider.h>
#include <blurhashimageprovider.h>
#include <multipagesortfilterproxymodel.h>
#include <qpa/qplatformintegrationfactory_p.h>

DCORE_USE_NAMESPACE
DGUI_USE_NAMESPACE

void tryUpdatePlatformPluginToDXcb()
{
if (qEnvironmentVariableIsSet("WAYLAND_DISPLAY"))
return;

const QByteArray dxcb = QByteArrayLiteral("dxcb");
if (QPlatformIntegrationFactory::keys().contains(dxcb)) {
qputenv("QT_QPA_PLATFORM", dxcb);
}
}

int main(int argc, char* argv[])
{
// workaround for https://github.com/linuxdeepin/dtk/issues/115
qputenv("D_POPUP_MODE", "embed");
// TODO qxcb is find firstly in qt6.4 later.
tryUpdatePlatformPluginToDXcb();

QGuiApplication app(argc, argv);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Expand Down

0 comments on commit fa8b8e9

Please sign in to comment.