Fix GNOME issue where 6DoF isn't always enabled for 6DoF devices, update KWin setup Fedora instructions, v2.7.0
This commit is contained in:
parent
3c13552198
commit
dde9431fd4
|
|
@ -31,7 +31,7 @@ print_missing_dependencies() {
|
||||||
echo ""
|
echo ""
|
||||||
printf "\033[1;33mInstall the missing packages\033[0m with your package manager, then rerun this setup:\n"
|
printf "\033[1;33mInstall the missing packages\033[0m with your package manager, then rerun this setup:\n"
|
||||||
printf "\tDebian/Ubuntu:\tsudo apt-get update && sudo apt-get install -y extra-cmake-modules kwin-dev libkf6config-dev libkf6configwidgets-dev libkf6coreaddons-dev libkf6kcmutils-dev libkf6globalaccel-dev libkf6i18n-dev libkf6windowsystem-dev libkf6xmlgui-dev qt6-base-dev qt6-declarative-dev libdrm-dev && (sudo apt-get install -y qml6-module-qtquick3d-helpers || true)\n"
|
printf "\tDebian/Ubuntu:\tsudo apt-get update && sudo apt-get install -y extra-cmake-modules kwin-dev libkf6config-dev libkf6configwidgets-dev libkf6coreaddons-dev libkf6kcmutils-dev libkf6globalaccel-dev libkf6i18n-dev libkf6windowsystem-dev libkf6xmlgui-dev qt6-base-dev qt6-declarative-dev libdrm-dev && (sudo apt-get install -y qml6-module-qtquick3d-helpers || true)\n"
|
||||||
printf "\tFedora/RHEL:\tsudo dnf install -y cmake gc++ extra-cmake-modules kwin-devel kf6-kconfig-devel kf6-kconfigwidgets-devel kf6-kcoreaddons-devel kf6-kcmutils-devel kf6-kglobalaccel-devel kf6-ki18n-devel kf6-kwindowsystem-devel kf6-kxmlgui-devel qt6-qtbase-devel qt6-qttools-devel qt6-qtquick3d wayland-devel libepoxy-devel libdrm-devel\n"
|
printf "\tFedora/RHEL:\tsudo dnf install -y cmake gcc gcc-c++ extra-cmake-modules kwin-devel kf6-kconfig-devel kf6-kconfigwidgets-devel kf6-kcoreaddons-devel kf6-kcmutils-devel kf6-kglobalaccel-devel kf6-ki18n-devel kf6-kwindowsystem-devel kf6-kxmlgui-devel qt6-qtbase-devel qt6-qttools-devel qt6-qtquick3d wayland-devel libepoxy-devel libdrm-devel\n"
|
||||||
printf "\tArch:\t\tsudo pacman -S --needed extra-cmake-modules qt6-base qt6-declarative qt6-tools qt6-quick3d kconfig kconfigwidgets kcoreaddons kglobalaccel ki18n kcmutils kxmlgui kwindowsystem kwin\n"
|
printf "\tArch:\t\tsudo pacman -S --needed extra-cmake-modules qt6-base qt6-declarative qt6-tools qt6-quick3d kconfig kconfigwidgets kcoreaddons kglobalaccel ki18n kcmutils kxmlgui kwindowsystem kwin\n"
|
||||||
echo ""
|
echo ""
|
||||||
if [ -z "${BREEZY_DISTROBOX:-}" ]; then
|
if [ -z "${BREEZY_DISTROBOX:-}" ]; then
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,9 @@ export default class BreezyDesktopExtension extends Extension {
|
||||||
this._follow_threshold_connection = null;
|
this._follow_threshold_connection = null;
|
||||||
this._breezy_desktop_running_connection = null;
|
this._breezy_desktop_running_connection = null;
|
||||||
|
|
||||||
|
this._state_poll_timeout = null;
|
||||||
|
this._pose_has_position = null;
|
||||||
|
|
||||||
// "fresh" means the effect hasn't been enabled since breezy-desktop-running became true
|
// "fresh" means the effect hasn't been enabled since breezy-desktop-running became true
|
||||||
this._fresh_session = true;
|
this._fresh_session = true;
|
||||||
|
|
||||||
|
|
@ -231,6 +234,7 @@ export default class BreezyDesktopExtension extends Extension {
|
||||||
|
|
||||||
const state = this._read_state();
|
const state = this._read_state();
|
||||||
const pose_has_position = state['connected_device_pose_has_position'] === 'true';
|
const pose_has_position = state['connected_device_pose_has_position'] === 'true';
|
||||||
|
this._pose_has_position = pose_has_position;
|
||||||
|
|
||||||
Globals.logger.log_debug(
|
Globals.logger.log_debug(
|
||||||
`connected_device_pose_has_position=${pose_has_position}`
|
`connected_device_pose_has_position=${pose_has_position}`
|
||||||
|
|
@ -327,6 +331,8 @@ export default class BreezyDesktopExtension extends Extension {
|
||||||
this._add_settings_keybinding('toggle-follow-shortcut', this._toggle_follow_mode.bind(this));
|
this._add_settings_keybinding('toggle-follow-shortcut', this._toggle_follow_mode.bind(this));
|
||||||
this._add_settings_keybinding('cursor-to-focused-display-shortcut', this._cursor_to_focused_display.bind(this));
|
this._add_settings_keybinding('cursor-to-focused-display-shortcut', this._cursor_to_focused_display.bind(this));
|
||||||
|
|
||||||
|
this._start_state_poller();
|
||||||
|
|
||||||
this._fresh_session = false;
|
this._fresh_session = false;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Globals.logger.log(`[ERROR] BreezyDesktopExtension _effect_enable ${e.message}\n${e.stack}`);
|
Globals.logger.log(`[ERROR] BreezyDesktopExtension _effect_enable ${e.message}\n${e.stack}`);
|
||||||
|
|
@ -336,6 +342,44 @@ export default class BreezyDesktopExtension extends Extension {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_start_state_poller() {
|
||||||
|
if (this._state_poll_timeout) return;
|
||||||
|
|
||||||
|
this._state_poll_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 3000, () => {
|
||||||
|
if (!this._is_effect_running) {
|
||||||
|
this._state_poll_timeout = null;
|
||||||
|
return GLib.SOURCE_REMOVE;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const state = this._read_state();
|
||||||
|
const pose_has_position = state['connected_device_pose_has_position'] === 'true';
|
||||||
|
|
||||||
|
if (pose_has_position !== this._pose_has_position) {
|
||||||
|
this._pose_has_position = pose_has_position;
|
||||||
|
Globals.logger.log_debug(
|
||||||
|
`BreezyDesktopExtension state poll - connected_device_pose_has_position=${pose_has_position}`
|
||||||
|
);
|
||||||
|
|
||||||
|
if (this._virtual_displays_actor) {
|
||||||
|
this._virtual_displays_actor.set_property('pose-has-position', pose_has_position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
Globals.logger.log(`[ERROR] BreezyDesktopExtension _start_state_poller ${e.message}\n${e.stack}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return GLib.SOURCE_CONTINUE;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_stop_state_poller() {
|
||||||
|
if (!this._state_poll_timeout) return;
|
||||||
|
|
||||||
|
GLib.source_remove(this._state_poll_timeout);
|
||||||
|
this._state_poll_timeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
_add_settings_keybinding(settings_key, bind_to_function) {
|
_add_settings_keybinding(settings_key, bind_to_function) {
|
||||||
try {
|
try {
|
||||||
Main.wm.addKeybinding(
|
Main.wm.addKeybinding(
|
||||||
|
|
@ -536,12 +580,13 @@ export default class BreezyDesktopExtension extends Extension {
|
||||||
}
|
}
|
||||||
|
|
||||||
Globals.logger.log_debug(`BreezyDesktopExtension _toggle_xr_effect external_mode: ${stdout}`);
|
Globals.logger.log_debug(`BreezyDesktopExtension _toggle_xr_effect external_mode: ${stdout}`);
|
||||||
const enabled = stdout.trim() === 'breezy_desktop';
|
const was_enabled = stdout.trim() === 'breezy_desktop';
|
||||||
|
const should_enable = !was_enabled;
|
||||||
|
|
||||||
// use the CLI to change the external mode, avoid using disable/enable, otherwise the driver will
|
// use the CLI to change the external mode, avoid using disable/enable, otherwise the driver will
|
||||||
// shut down and recalibrate each time
|
// shut down and recalibrate each time
|
||||||
proc = Gio.Subprocess.new(
|
proc = Gio.Subprocess.new(
|
||||||
['bash', '-c', `${this._cli_file.get_path()} --${enabled ? 'disable-external' : 'breezy-desktop'}`],
|
['bash', '-c', `${this._cli_file.get_path()} ${should_enable ? '--enable --breezy-desktop' : '--disable-external'}`],
|
||||||
Gio.SubprocessFlags.STDOUT_PIPE | Gio.SubprocessFlags.STDERR_PIPE
|
Gio.SubprocessFlags.STDOUT_PIPE | Gio.SubprocessFlags.STDERR_PIPE
|
||||||
);
|
);
|
||||||
[success, stdout, stderr] = proc.communicate_utf8(null, null);
|
[success, stdout, stderr] = proc.communicate_utf8(null, null);
|
||||||
|
|
@ -577,6 +622,8 @@ export default class BreezyDesktopExtension extends Extension {
|
||||||
Globals.logger.log_debug('BreezyDesktopExtension _effect_disable');
|
Globals.logger.log_debug('BreezyDesktopExtension _effect_disable');
|
||||||
this._is_effect_running = false;
|
this._is_effect_running = false;
|
||||||
|
|
||||||
|
this._stop_state_poller();
|
||||||
|
|
||||||
if (Globals.data_stream.smooth_follow_enabled) this._toggle_follow_mode();
|
if (Globals.data_stream.smooth_follow_enabled) this._toggle_follow_mode();
|
||||||
|
|
||||||
Main.wm.removeKeybinding('recenter-display-shortcut');
|
Main.wm.removeKeybinding('recenter-display-shortcut');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue