DPI Scaling Related ContextMenu Drawing Problem |
Post Reply |
Author | |
mschumi_41
Newbie Joined: 06 July 2022 Status: Offline Points: 4 |
Post Options
Thanks(0)
Posted: 16 March 2023 at 11:35am |
Hello Codejock Team, we encountered a context menu drawing problem. We are currently the Xtreme Toolkit Pro version 20.3.0. Here is the reproduction: - Occurs only in a multi-monitor setup; monitor resolution does not matter (both monitors can have the same display resolution; in my case 1920 x 1080) - The scaling (the percentage value "size of text, apps, and other items) must be set different to reproduce the problem (in my setup: main monitor 100%, secondary monitor 125%). - Start the program; it is opened on the main monitor - Open a dialog where a context menu can be shown when the right mouse button is clicked upon the dialog - Drag the dialog to the secondary monitor; as soon as more than half the dialog is dragged to the other monitor, it enlarges (because secondary monitor's scaling is on 125%) - Now right-click on the dialog - Here finally comes the problem - the context menu's shadows (right and bottom) are drawn in the correct place and size - however, the context menu's contents is drawn more to the upper left and in a smaller size that matches the main monitor's scaling I checked what is called and found the following: - our code looks as follows with pCommandBars= nullptr or the MainFrame's command bars: CXTPPopupBar* pPopup = CXTPPopupBar::CreatePopupBar(pCommandBars); pPopup.LoadMenu(pMenu) CXTPCommandBars::TrackPopupMenu(pPopup, flags, inX, inY, /*pWnd=*/nullptr, /*rcExclude=*/nullptr, /*pWndOwner=*/nullptr); - on the XTP side is called: - CXTPPopupBar::Popup(CXTPControlPopup* pControlPopup) with - Animate (here something goes wrong) paintDC.BitBlt(0, 0, rcClient.Width(), rcClient.Height(), pDC, rcWindow.left, rcWindow.top, SRCCOPY); ... GetPaintManager()->Animate(&paintDC, &animationDC, rcClient, animationType); - and for the Shadows (works correctly) pPaintManager->GetShadowManager()->SetShadow(this, m_rcExclude, m_bRecursePopup ? 1 : 0); - I changed one of the Codejock sample programs (CommandBars\HelpContext) and made the AboutDlg to have such a context menu. This reproduces the problem. - I can send you the modified HelpContext sources if it is needed That is all for the moment; is this a bug or am I doing something wrong? Thank you in advance and best regards, Michael
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |