Skip to content

Commit

Permalink
fix: descale dock rect for windowed frame position
Browse files Browse the repository at this point in the history
修复小窗口 launcher 位置跑偏的问题

Log:
  • Loading branch information
BLumia committed Aug 25, 2023
1 parent 6c15f5c commit a737da4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ ApplicationWindow {
}
}

function descaledRect(rect) {
let ratio = Screen.devicePixelRatio
return Qt.rect(rect.left / ratio, rect.top / ratio, rect.width / ratio, rect.height / ratio)
}

function launchApp(desktopId) {
if (DebugHelper.avoidLaunchApp) {
DTK.sendSystemMessage("dde-launchpad (debug)",
Expand Down Expand Up @@ -91,7 +96,7 @@ ApplicationWindow {
let x = 0
let y = 0

let dockGeometry = DesktopIntegration.dockGeometry
let dockGeometry = descaledRect(DesktopIntegration.dockGeometry)
if (dockGeometry.width > 0 && dockGeometry.height > 0) {
// console.log(114514, dockGeometry)
switch (DesktopIntegration.dockPosition) {
Expand Down

0 comments on commit a737da4

Please sign in to comment.