From 65171c0d60c0846affe796b9e22d4f005ef82bee Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 15 Jun 2022 15:33:12 +0300 Subject: CDlgBase::m_bFixedSize - flag added not to apply hidpi patch to dialogs --- include/m_gui.h | 1 + src/mir_core/src/Windows/CDlgBase.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/m_gui.h b/include/m_gui.h index 3728037ab4..e217c6ba15 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -490,6 +490,7 @@ protected: bool m_isModal = false; bool m_bInitialized = false; bool m_forceResizable = false; + bool m_bFixedSize = false; bool m_bSucceeded = false; // was IDOK pressed or not bool m_bExiting = false; // window received WM_CLOSE and gonna die soon diff --git a/src/mir_core/src/Windows/CDlgBase.cpp b/src/mir_core/src/Windows/CDlgBase.cpp index b8b0d5ce11..91b5237884 100644 --- a/src/mir_core/src/Windows/CDlgBase.cpp +++ b/src/mir_core/src/Windows/CDlgBase.cpp @@ -102,14 +102,20 @@ void CDlgBase::Close() void CDlgBase::Create() { - mir_ptr pDlgTemplate(LoadThemedDialogTemplate(MAKEINTRESOURCE(m_idDialog), GetInst())); - CreateDialogIndirectParam(GetInst(),pDlgTemplate,m_hwndParent,GlobalDlgProc,(LPARAM)this); + if (!m_bFixedSize) { + mir_ptr pDlgTemplate(LoadThemedDialogTemplate(MAKEINTRESOURCE(m_idDialog), GetInst())); + CreateDialogIndirectParam(GetInst(), pDlgTemplate, m_hwndParent, GlobalDlgProc, (LPARAM)this); + } + else CreateDialogParam(GetInst(), MAKEINTRESOURCE(m_idDialog), m_hwndParent, GlobalDlgProc, (LPARAM)this); } int CDlgBase::DoModal() { m_isModal = true; + if (m_bFixedSize) + return DialogBoxParam(GetInst(), MAKEINTRESOURCE(m_idDialog), m_hwndParent, GlobalDlgProc, (LPARAM)this); + mir_ptr pDlgTemplate(LoadThemedDialogTemplate(MAKEINTRESOURCE(m_idDialog), GetInst())); return DialogBoxIndirectParam(GetInst(), pDlgTemplate, m_hwndParent, GlobalDlgProc, (LPARAM)this); } -- cgit v1.2.3