Browse Source

Allow sharing files with guest using UI, even with custom profile (#702)

The 9p filesystem is always accessible by the guest, even if the UI is hidden. This will make the file picker UI be shown when needed
hello-smile6 1 year ago
parent
commit
b96665285b
2 changed files with 8 additions and 0 deletions
  1. 1 0
      lib/9p.js
  2. 7 0
      src/browser/main.js

+ 1 - 0
lib/9p.js

@@ -733,6 +733,7 @@ Virtio9p.prototype.ReceiveRequest = async function (bufchain) {
             marshall.Marshall(["Q"], [inode.qid], this.replybuffer, 7);
             this.BuildReply(id, tag, 13);
             this.SendReply(bufchain);
+            this.bus.send("9p-attach");
             break;
 
         case 108: // tflush

+ 7 - 0
src/browser/main.js

@@ -1268,6 +1268,13 @@
         {
             init_filesystem_panel(emulator);
         }
+        else
+        {
+            emulator.add_listener("9p-attach", function()
+            {
+                init_filesystem_panel(emulator);
+            });
+        }
 
         $("run").onclick = function()
         {