workspace-indicator: Account for monitor offset in window previews

Windows' frame rects are in screen coordinates, while the workspace
thumbnails are based on the monitor work area. Unless we account
for the difference, previews end up mispositioned in multi-monitor
setups.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/142>
This commit is contained in:
Florian Müllner
2020-10-21 20:24:18 +02:00
parent 893d3b0473
commit 6949a5d075
+2 -2
View File
@@ -97,8 +97,8 @@ class WorkspaceLayout extends Clutter.LayoutManager {
Math.round(Math.min(frameRect.width, workArea.width) * hscale),
Math.round(Math.min(frameRect.height, workArea.height) * vscale));
childBox.set_origin(
Math.round(frameRect.x * hscale),
Math.round(frameRect.y * vscale));
Math.round((frameRect.x - workArea.x) * hscale),
Math.round((frameRect.y - workArea.y) * vscale));
child.allocate(childBox);
}
}