tuanchris 4 luni în urmă
părinte
comite
ed198db5ad
3 a modificat fișierele cu 39 adăugiri și 3 ștergeri
  1. 13 1
      dune-weaver-touch/main.py
  2. 13 0
      dune-weaver-touch/qml/main.qml
  3. 13 2
      dune-weaver-touch/run.sh

+ 13 - 1
dune-weaver-touch/main.py

@@ -12,9 +12,21 @@ from models.pattern_model import PatternModel
 from models.playlist_model import PlaylistModel
 
 def main():
+    # Check for kiosk mode flag
+    kiosk_mode = '--kiosk' in sys.argv or os.environ.get('KIOSK_MODE', '0') == '1'
+
+    if kiosk_mode:
+        # Set Qt platform for fullscreen framebuffer mode
+        os.environ['QT_QPA_PLATFORM'] = 'eglfs'
+        os.environ['QT_QPA_EGLFS_ALWAYS_SET_MODE'] = '1'
+        print("🖥️  Running in KIOSK MODE (fullscreen)")
+    else:
+        print("🪟 Running in WINDOWED MODE (development)")
+        print("   Use --kiosk flag or set KIOSK_MODE=1 for fullscreen")
+
     # Enable virtual keyboard
     os.environ['QT_IM_MODULE'] = 'qtvirtualkeyboard'
-    
+
     app = QGuiApplication(sys.argv)
     
     # Setup async event loop

+ 13 - 0
dune-weaver-touch/qml/main.qml

@@ -12,6 +12,19 @@ ApplicationWindow {
     width: 800
     height: 480
     title: "Dune Weaver Touch"
+
+    // Auto-detect kiosk mode from environment or platform
+    // EGLFS platform automatically goes fullscreen, but we can also set visibility
+    Component.onCompleted: {
+        // Check if we're running in kiosk mode (eglfs platform)
+        var isKiosk = Qt.platform.pluginName === "eglfs" || Qt.platform.pluginName === "linuxfb"
+        if (isKiosk) {
+            console.log("🖥️  Kiosk mode detected - platform:", Qt.platform.pluginName)
+            visibility = Window.FullScreen
+        } else {
+            console.log("🪟 Desktop mode - platform:", Qt.platform.pluginName)
+        }
+    }
     
     property int currentPageIndex: 0
     property alias stackView: stackView

+ 13 - 2
dune-weaver-touch/run.sh

@@ -41,13 +41,24 @@ if [ $ATTEMPT -eq $MAX_ATTEMPTS ]; then
     exit 1
 fi
 
+# Parse command line arguments
+KIOSK_FLAG=""
+if [ "$1" == "--kiosk" ] || [ "$1" == "-k" ]; then
+    KIOSK_FLAG="--kiosk"
+fi
+
 # Run the application using the virtual environment
 echo ""
-echo "🚀 Starting Dune Weaver Touch (development mode)"
+if [ -n "$KIOSK_FLAG" ]; then
+    echo "🚀 Starting Dune Weaver Touch (KIOSK MODE - fullscreen)"
+else
+    echo "🚀 Starting Dune Weaver Touch (development mode - windowed)"
+    echo "   💡 Use './run.sh --kiosk' for fullscreen mode"
+fi
 echo "   Using virtual environment: $SCRIPT_DIR/venv"
 echo "   Connected to backend: $BACKEND_URL"
 echo "   Press Ctrl+C to stop"
 echo ""
 
 cd "$SCRIPT_DIR"
-exec ./venv/bin/python main.py
+exec ./venv/bin/python main.py $KIOSK_FLAG