Skip to content

Commit

Permalink
Fix multi-screen menu pop-up location
Browse files Browse the repository at this point in the history
According to f8cf17166c9af147f0b8fea72f5b4a8a6098a5d7

When QT_SCALE_FACTOR is greater than 1, the Popup menu pops up
incorrectly on the second screen.

Replace the toNativePixels with toNativeLocalPosition.

Issue: linuxdeepin/developer-center#9747
  • Loading branch information
Dami-star authored and Zeno-sole committed Aug 20, 2024
1 parent 0f24a11 commit 98f4c12
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
qt6-declarative (6.6.1+dfsg-1deepin7) unstable; urgency=medium

* Fix multi-screen menu pop-up location
- deepin-0008-Fix-multi-screen-menu-popup-location.patch

-- Lu YaNing <[email protected]> Mon, 19 Aug 2024 19:51:25 +0800

qt6-declarative (6.6.1+dfsg-1deepin6) unstable; urgency=medium

* Import patch from upstream:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From 39ee31cc09ce1f0084f84aaa0596adb2d578af3b Mon Sep 17 00:00:00 2001
From: Lu YaNing <[email protected]>
Date: Fri, 09 Aug 2024 17:42:02 +0800
Subject: [PATCH] Fix multi-screen menu pop-up location

According to f8cf17166c9af147f0b8fea72f5b4a8a6098a5d7

When QT_SCALE_FACTOR is greater than 1, the Popup menu pops up
incorrectly on the second screen.

Replace the toNativePixels with toNativeLocalPosition.

Fixes: QTBUG-127906
Pick-to: 6.5 6.7 6.8
Change-Id: Id320063afccfd3a391426bc6419cbe8855c57b98

Index: qt6-declarative-6.6.1+dfsg/src/labs/platform/qquicklabsplatformmenu.cpp
===================================================================
--- qt6-declarative-6.6.1+dfsg.orig/src/labs/platform/qquicklabsplatformmenu.cpp
+++ qt6-declarative-6.6.1+dfsg/src/labs/platform/qquicklabsplatformmenu.cpp
@@ -695,7 +695,7 @@ void QQuickLabsPlatformMenu::open(QQmlV4
#endif
}
m_handle->showPopup(window,
- QHighDpi::toNativePixels(targetRect, window),
+ QHighDpi::toNativeLocalPosition(targetRect, window),
menuItem ? menuItem->handle() : nullptr);
}

1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ deepin-0006-QQuickItemGrabResult-Grab-with-window-devicePixelRatio.patch
# https://github.com/qt/qtdeclarative/commit/62014e9cecc633a046754e5f76cae66f052ae17b
# https://github.com/linuxdeepin/developer-center/issues/10004
deepin-0007-Remove-bounding-behavior-of-popup-for-negative-margins.patch
deepin-0008-Fix-multi-screen-menu-popup-location.patch

0 comments on commit 98f4c12

Please sign in to comment.