From 2c039597f03d66682ed0390a146ebb88c1a49c23 Mon Sep 17 00:00:00 2001 From: wingsummer <1326224942@qq.com> Date: Sun, 18 May 2025 23:58:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=A8=20wayland=20?= =?UTF-8?q?=E4=B8=8B=20dock=20=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/zh_CN/winghex_zh_CN.ts | 28 ++++++++++++++-------------- lang/zh_TW/winghex_zh_TW.ts | 28 ++++++++++++++-------------- main.cpp | 11 +++++++++++ src/control/editorview.cpp | 3 ++- 4 files changed, 41 insertions(+), 29 deletions(-) diff --git a/lang/zh_CN/winghex_zh_CN.ts b/lang/zh_CN/winghex_zh_CN.ts index a5f71b6..be3f233 100644 --- a/lang/zh_CN/winghex_zh_CN.ts +++ b/lang/zh_CN/winghex_zh_CN.ts @@ -410,72 +410,72 @@ EditorView - + Cut 剪切 - + CutHex 剪切(十六进制) - + Copy 复制 - + CopyHex 复制(十六进制) - + Paste 粘贴 - + PasteHex 粘贴(十六进制) - + Delete 删除 - + Find 查找 - + Goto 跳转 - + Fill 填充 - + MetaData 标注 - + BookMark 书签 - + Untitled 未命名 - + Not allowed operation in non-UI thread 该操作在非 UI 线程非法 diff --git a/lang/zh_TW/winghex_zh_TW.ts b/lang/zh_TW/winghex_zh_TW.ts index ebe5793..9d3087f 100644 --- a/lang/zh_TW/winghex_zh_TW.ts +++ b/lang/zh_TW/winghex_zh_TW.ts @@ -410,72 +410,72 @@ EditorView - + Cut 剪切 - + CutHex 剪切(十六進制) - + Copy 複製 - + CopyHex 複製(十六進制) - + Paste 粘貼 - + PasteHex 粘貼(十六進制) - + Delete 刪除 - + Find 查找 - + Goto 跳轉 - + Fill 填充 - + MetaData 標注 - + BookMark 書簽 - + Untitled 未命名 - + Not allowed operation in non-UI thread 該操作在非 UI 線程非法 diff --git a/main.cpp b/main.cpp index 959928e..e1cd487 100644 --- a/main.cpp +++ b/main.cpp @@ -20,6 +20,17 @@ int main(int argc, char *argv[]) { QApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); +#ifdef Q_OS_LINUX + // fix wayland issue (a workaround): floating dock not work + // reference: + // https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/ + // issues/714#issuecomment-2802752677 + if (qgetenv("XDG_SESSION_TYPE") + .compare(QByteArrayLiteral("wayland"), Qt::CaseInsensitive) == 0) { + qputenv("QT_QPA_PLATFORM", "xcb"); + } +#endif + QApplication::setApplicationName(APP_NAME); QApplication::setOrganizationName(APP_ORG); QApplication::setApplicationVersion(WINGHEX_VERSION); diff --git a/src/control/editorview.cpp b/src/control/editorview.cpp index 3abbda0..bd0c727 100644 --- a/src/control/editorview.cpp +++ b/src/control/editorview.cpp @@ -63,7 +63,8 @@ EditorView::EditorView(QWidget *parent) auto hexLayout = new QVBoxLayout(m_hexContainer); hexLayout->setSpacing(0); hexLayout->setContentsMargins(0, 0, 0, 0); - m_hex = new QHexView; + m_hex = new QHexView(this); + m_hex->setScaleRate(1); hexLayout->addWidget(m_hex, 1); m_goto = new GotoWidget(this); connect(m_goto, &GotoWidget::jumpToLine, this,