Remove unnecessary package installs from Dockerfile, improve findFocusedMonitor logic

This commit is contained in:
wheaney 2025-08-28 10:45:04 -07:00
parent 843f7907e7
commit 72b6b32c58
4 changed files with 8 additions and 21 deletions

View File

@ -30,9 +30,6 @@ RUN pacman -Sy --noconfirm --needed \
kwindowsystem \
kwin \
&& pacman -Scc --noconfirm
RUN pacman -Sy --noconfirm --needed \
python \
&& pacman -Scc --noconfirm
WORKDIR /source

View File

@ -31,9 +31,6 @@ RUN pacman -Sy --noconfirm --needed \
kwindowsystem \
kwin \
&& pacman -Scc --noconfirm
RUN pacman -Sy --noconfirm --needed \
python \
&& pacman -Scc --noconfirm
WORKDIR /source

View File

@ -83,9 +83,6 @@ Node {
const focusedDisplay = focusedIndex !== -1 ? breezyDesktop.displayAtIndex(focusedIndex) : null;
if (focusedIndex !== breezyDesktop.focusedMonitorIndex) {
// zoomOutAnimation.stop();
// zoomInAnimation.stop();
// zoomOnFocusSequence.stop();
if (focusedDisplay === null) {
zoomOutAnimation.target = breezyDesktop.displayAtIndex(breezyDesktop.focusedMonitorIndex);
zoomOutAnimation.target.targetDistance = zoomOutAnimation.to;

View File

@ -306,11 +306,8 @@ QtObject {
return monitorPlacements;
}
// returns how far the look vector is from the center of the monitor, as a percentage of the monitor's width
// returns how far the look vector is from the center of the monitor, as a percentage of the monitor's dimensions
function getMonitorDistance(fovDetails, lookUpPixels, lookWestPixels, monitorVector, monitorDetails, upAngleToLength, westAngleToLength) {
var monitorAspectRatio = monitorDetails.width / monitorDetails.height;
// weight the up distance by the aspect ratio
var vectorUpPixels = upAngleToLength(
fovDetails.defaultDistanceVerticalRadians,
fovDetails.heightPixels,
@ -318,7 +315,7 @@ QtObject {
monitorVector.z,
monitorVector.x
);
var upDeltaPixels = (lookUpPixels - vectorUpPixels) * monitorAspectRatio;
var upPercentage = Math.abs(lookUpPixels - vectorUpPixels) / monitorDetails.height;
var vectorWestPixels = westAngleToLength(
fovDetails.defaultDistanceHorizontalRadians,
@ -327,11 +324,10 @@ QtObject {
monitorVector.y,
monitorVector.x
);
var westDeltaPixels = lookWestPixels - vectorWestPixels;
var totalDeltaPixels = Math.sqrt(upDeltaPixels * upDeltaPixels + westDeltaPixels * westDeltaPixels);
var westPercentage = Math.abs(lookWestPixels - vectorWestPixels) / monitorDetails.width;
// threshold is a percentage of width, and height was already properly weighted
return totalDeltaPixels / monitorDetails.width;
// how close we are to any edge is the largest of the two percentages
return Math.max(upPercentage, westPercentage);
}
function findFocusedMonitor(quaternion, monitorVectors, currentFocusedIndex, smoothFollowEnabled, fovDetails, monitorsDetails) {
@ -356,9 +352,6 @@ QtObject {
rotatedLookVector.x
);
var closestIndex = -1;
var closestDistance = Number.POSITIVE_INFINITY;
// Check current focused monitor first
if (currentFocusedIndex !== -1) {
var focusedDistance = getMonitorDistance(
@ -375,6 +368,9 @@ QtObject {
return currentFocusedIndex;
}
var closestIndex = -1;
var closestDistance = Number.POSITIVE_INFINITY;
// Find the closest monitor
for (var i = 0; i < monitorVectors.length; ++i) {
if (i === currentFocusedIndex)