udevbe / greenfield

HTML5 Wayland compositor :seedling:
GNU Affero General Public License v3.0
913 stars 28 forks source link

qt app freezes #55

Closed jschueller closed 3 years ago

jschueller commented 3 years ago

Hello,

I'm trying to run a qt app through greenfield instead of the demo gtk app unfortunately it seems to freeze after a few actions. As it runs fine via weston it seems to indicate a problem with greenfield.

However i dont know how I could debug this. I tried to set the DEBUG env var in the app-endpoint-server container with no success.

Zubnix commented 3 years ago

Any app in particular (so I know which one to try) or does it happen with all Qt applications?

Zubnix commented 3 years ago

I tried with kwrite and it seems to be ok aside from some quirky mouse input behavior.

You could try to debug by setting the WAYLAND_DEBUG=client env var when launching the app. This will show you the protocol communication from the apps point of view.

jschueller commented 3 years ago

its a particular qt app, as I tried simpler qt examples

here's how I modified the containers to use it, to reproduce you can download it at https://we.tl/t-jrOIgtHgoE and put it at the root of the greenfield project:

diff --git a/app-endpoint-server/config.json5 b/app-endpoint-server/config.json5
index 1337b57..155598e 100644
--- a/app-endpoint-server/config.json5
+++ b/app-endpoint-server/config.json5
@@ -46,7 +46,7 @@
     apps: {
       'remote-gtk3-demo': {
         // The full path of the executable binary. Can also be a symlink.
-        bin: "/usr/bin/gtk3-demo",
+        bin: "/tmp/squashfs-root/AppRun",
         // Arguments passed to the binary
         args: [],
       },
diff --git a/environments/local/containers/app-endpoint-server/Dockerfile b/environments/local/containers/app-endpoint-server/Dockerfile
index 7da0c3c..569abc9 100644
--- a/environments/local/containers/app-endpoint-server/Dockerfile
+++ b/environments/local/containers/app-endpoint-server/Dockerfile
@@ -32,6 +32,14 @@ COPY app-endpoint-server app-endpoint-server
 # Enter application directory
 WORKDIR /app/app-endpoint-server
 RUN npm install && npm run generate && npm run build
+ADD persalys-10.0dev-x86_64.AppImage /tmp
+RUN chmod a+rx /tmp/persalys-10.0dev-x86_64.AppImage
+#RUN apt-get install -y libfuse2
+
+RUN cd /tmp && ./persalys-10.0dev-x86_64.AppImage --appimage-extract
+# RUN apt-get install -y libxt-dev
+# ENV QT_DEBUG_PLUGINS=1 WAYLAND_DEBUG=1 DEBUG=1
+ENV WAYLAND_DEBUG=client

 # Start server
 CMD npm run start

then if I click on "new study" button, then it stalls: I cannot click on "symbolic model" with WAYLAND_DEBUG=client I can see that it's still alive

Zubnix commented 3 years ago

I created a branch with the setup & using your app. It's based on the XWayland branch and seems to work fine-ish. Might be that the XWayland branch has fixes not present in current master. Can you confirm it works on this branch? https://github.com/udevbe/greenfield/commit/d8bf06fb3b42a8130e66df6ccd9f978b3cfaaf1d

If it works, I'll fix the input handling in qt (menu's don't seem to be clickable) & make new compositor-module release.

Make sure to: cd compositor-module yarn install yarn build yarn link cd .. cd compositor-demo yarn install yarn link compositor-module yarn start open a browser on localhost:8080

jschueller commented 3 years ago

isnt it "yarn link greenfield-compositor" instead of "yarn link compositor-module" ? only the webshm app launches, with the others the screen stays gray as the command you gave do not involve docker, I have to populate /tmp/squashfs-root/AppRun in my host right ? did it work on your side ?

upya4ko commented 3 years ago

Confirm, only app works, also docker demo return 502 after accept cert.

Zubnix commented 3 years ago

Yes it worked on my end. Indeed there was a small error in my setup instructions previously.

From the branch 55-qt-app-freezes from the root of the git repo:

Running latest code locally

app-endpoint server

compositor-demo

I've tested it on a clean git clone on my end, can you confirm it works for you too?

jschueller commented 3 years ago

it works now, thanks! you were right about the menus: they drop down but they're not clickable

Zubnix commented 3 years ago

@jschueller I'll make it a priority to fix them.

@upya4ko I'll see if I can improve the docker container demo workflow & update the https://greenfield-preview.web.app/ site with the qt fixes as the code running there is now almost a year old.

jschueller commented 3 years ago

about "https://greenfield-preview.web.app/", is the code for this site available ? my idea was to customize it and provide use it through a docker image like the demo does

Zubnix commented 3 years ago

@jschueller you can find it here: https://github.com/udevbe/greenfield-webshell

jschueller commented 3 years ago

thanks a lot

upya4ko commented 3 years ago

@Zubnix i try get working "wayland of Xwayland" app in browser on top of docker, i try demo-site https://greenfield-preview.web.app/ and try run GTK3 demo to get error Remote GTK3 Demo failed to launch. Remote connection failed.

Ok, i try run docker demo, get 502 error, then try make my own docker demo image. For now i stuck on error: XDG_RUNTIME_DIR not set in the environment I think it need some X11 server part. WebGL and WebSHM work fine.

I think be a good for starters make simple docker demo "How to launch xterm/xeyes in browser" to help understand how greenfield may be implemented in infrastructure.

Sorry if i wrong understand propose of greenfield.

Zubnix commented 3 years ago

@jschueller I updated master & the test branch with your app. Menus should work now. Can you confirm?

jschueller commented 3 years ago

yes, everything is ok, many thanks!

Zubnix commented 3 years ago

Ok great to hear!

@upya4ko I've moved your questions to a separate topic