feat: extend Force TV mode to desktop for home-theater setups
Initialize TvDetectionService on every platform so the existing force_tv_mode setting drives the 10-foot TV interface on Windows, macOS, and Linux, and surface the toggle in appearance settings there. Desktop keeps real-mouse behavior in TV mode: InputModeTracker still flips between pointer and keyboard modes (cursor hidden while keyboard-driven), segmented controls keep their hover affordance, and the settings backup section stays available (only Android TV lacks a document picker). Adds PlatformDetector.debugSetIsDesktopOSOverride so TV-device simulations in widget tests don't inherit the desktop test host's platform. close #1409
This commit is contained in:
@@ -117,8 +117,10 @@ class _InputModeTrackerState extends State<InputModeTracker> {
|
||||
Widget build(BuildContext context) {
|
||||
// On Android TV, don't switch to pointer mode from pointer events
|
||||
// as D-pad can generate synthetic pointer events that would incorrectly
|
||||
// trigger pointer mode and show a cursor instead of D-pad focus navigation
|
||||
if (TvDetectionService.isTVSync()) {
|
||||
// trigger pointer mode and show a cursor instead of D-pad focus navigation.
|
||||
// Desktop is exempt even in force-TV mode: its pointer events come from a
|
||||
// real mouse, which should keep flipping modes (and the cursor) as usual.
|
||||
if (TvDetectionService.isTVSync() && !PlatformDetector.isDesktopOS()) {
|
||||
return _InputModeProvider(mode: _mode, child: widget.child);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user