Restore smooth follow auto-focus logic, update uninstall for missed virtualdisplay script cleanup, update setup warning for python error ignore
This commit is contained in:
parent
94cd703db3
commit
cc910349dd
|
|
@ -42,6 +42,7 @@ rm -f $XDG_DATA_HOME/applications/com.xronlinux.BreezyDesktop.desktop
|
|||
rm -f $XDG_DATA_HOME/icons/hicolor/*/apps/com.xronlinux.BreezyDesktop.png
|
||||
rm -f $XDG_DATA_HOME/locale/*/LC_MESSAGES/breezydesktop.mo
|
||||
rm -f $XDG_BIN_HOME/breezydesktop
|
||||
rm -f $XDG_BIN_HOME/virtualdisplay
|
||||
|
||||
if [ -e "$XDG_BIN_HOME/xr_driver_uninstall" ]; then
|
||||
[ "$for_install" -eq 0 ] && echo "Uninstalling XRLinuxDriver"
|
||||
|
|
|
|||
|
|
@ -22,14 +22,14 @@ check_command "python" "python3"
|
|||
PYTHON_GI_CHECK="import gi; gi.require_version('Gtk', '4.0'); gi.require_version('Adw', '1'); gi.require_version('Gio', '2.0'); gi.require_version('GLib', '2.0'); gi.require_version('GObject', '2.0'); gi.require_version('Gst', '1.0'); from gi.repository import Gtk, Adw, Gio, GLib, GObject, Gst"
|
||||
|
||||
if ! { python3 -c "$PYTHON_GI_CHECK" 2>/dev/null || python -c "$PYTHON_GI_CHECK" 2>/dev/null; }; then
|
||||
printf "\033[1;31mERROR:\033[0m Python GObject libraries are missing\n"
|
||||
printf "Please install the required Python GObject dependencies: GTK4, libadwaita, and GStreamer libraries:\n"
|
||||
printf "If you're using a Python installation from a package manager, you may need to install the following packages:\n"
|
||||
printf "\tFor Debian/Ubuntu: sudo apt install python3-gi gir1.2-gtk-4.0 libadwaita-1-0 gir1.2-adw-1 gir1.2-glib-2.0 gir1.2-gobject-2.0 gir1.2-gstreamer-1.0\n"
|
||||
printf "\tFor Fedora: sudo dnf install python3-gobject python3-gstreamer1 gtk4 libadwaita\n"
|
||||
printf "\tFor Arch Linux: sudo pacman -S python-gobject gst-python gtk4 libadwaita\n"
|
||||
printf "\nIf you continue to have issues, rerun the setup with BREEZY_IGNORE_PYTHON_ERRORS=1 to skip this check.\n\n"
|
||||
if [ -z "$BREEZY_IGNORE_PYTHON_ERRORS" ]; then
|
||||
printf "\033[1;31mERROR:\033[0m Python GObject libraries are missing\n"
|
||||
printf "Please install the required Python GObject dependencies: GTK4, libadwaita, and GStreamer libraries:\n"
|
||||
printf "If you're using a Python installation from a package manager, you may need to install the following packages:\n"
|
||||
printf "\tFor Debian/Ubuntu: sudo apt install python3-gi gir1.2-gtk-4.0 libadwaita-1-0 gir1.2-adw-1 gir1.2-glib-2.0 gir1.2-gobject-2.0 gir1.2-gstreamer-1.0\n"
|
||||
printf "\tFor Fedora: sudo dnf install python3-gobject python3-gstreamer1 gtk4 libadwaita\n"
|
||||
printf "\tFor Arch Linux: sudo pacman -S python-gobject gst-python gtk4 libadwaita\n"
|
||||
printf "\nIf you continue to have issues, rerun the setup with BREEZY_IGNORE_PYTHON_ERRORS=1 to skip this check.\n\n"
|
||||
exit 1
|
||||
else
|
||||
printf "\033[1;33mWARNING:\033[0m Ignoring Python dependency failures. "
|
||||
|
|
|
|||
|
|
@ -54,11 +54,12 @@ function getMonitorDistance(fovDetails, lookUpPixels, lookWestPixels, monitorVec
|
|||
* @param {number[][]} monitorVectors - Array of monitor vectors [x, y, z] to search from
|
||||
* @param {number} currentFocusedIndex - Index of the currently focused monitor
|
||||
* @param {number} focusedMonitorDistance - Distance to the focused monitor, < 1.0 if zoomed in
|
||||
* @param {boolean} smoothFollowEnabled - If true, always keep the current monitor in focus or choose the closest
|
||||
* @param {Object} fovDetails - Contains reference widthPixels, heightPixels, horizontal and vertical radians, and pixel distance to the center of the screen
|
||||
* @param {Object[]} monitorsDetails - Contains x, y, width, height (coordinates from top-left) for each monitor
|
||||
* @returns {number} Index of the closest vector, if it surpasses the previous closest index by a certain margin, otherwise the previous index
|
||||
*/
|
||||
function findFocusedMonitor(quaternion, monitorVectors, currentFocusedIndex, focusedMonitorDistance, fovDetails, monitorsDetails) {
|
||||
function findFocusedMonitor(quaternion, monitorVectors, currentFocusedIndex, focusedMonitorDistance, smoothFollowEnabled, fovDetails, monitorsDetails) {
|
||||
const lookVector = [1.0, 0.0, 0.0]; // NWU vector pointing to the center of the screen
|
||||
const rotatedLookVector = applyQuaternionToVector(lookVector, quaternion);
|
||||
|
||||
|
|
@ -96,7 +97,7 @@ function findFocusedMonitor(quaternion, monitorVectors, currentFocusedIndex, foc
|
|||
westConversionFns.angleToLength
|
||||
) * focusedMonitorDistance;
|
||||
|
||||
if (focusedDistance < UNFOCUS_THRESHOLD) return currentFocusedIndex;
|
||||
if (smoothFollowEnabled || focusedDistance < UNFOCUS_THRESHOLD) return currentFocusedIndex;
|
||||
}
|
||||
|
||||
// find the vector closest to the rotated look vector
|
||||
|
|
@ -119,7 +120,7 @@ function findFocusedMonitor(quaternion, monitorVectors, currentFocusedIndex, foc
|
|||
}
|
||||
});
|
||||
|
||||
if (closestDistance < FOCUS_THRESHOLD) return closestIndex;
|
||||
if (smoothFollowEnabled || closestDistance < FOCUS_THRESHOLD) return closestIndex;
|
||||
|
||||
// neither the current nor the closest will take focus, unfocus all displays
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue