Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

media player + gotk3 on WLS2( #84

Open
wunderbarb opened this issue Oct 25, 2021 · 2 comments
Open

media player + gotk3 on WLS2( #84

wunderbarb opened this issue Oct 25, 2021 · 2 comments

Comments

@wunderbarb
Copy link

I attempted to use the media player on GOTK3 with V3 using Ubuntu 20.04 under WSL2 (Windows Subsystem Linux)

During the realization phase, the following warning message appears on the terminal:

Gdk-WARNING **: xxxxx: ../../../../../gdk/x11/gdkwindow-x11.c:5633 drawable is not a native X11 window

Thus, the display of the video is in an automatically full screen created vlc window rather than the gtk.DrawingArea. I guess that it is due to the WSL2 X11 forwarding. Have you a hint on how to cope with the issue?

I am using the latest WSL2 version (insider program). Therefore, I do not use a X11emulator such as mobaxterm. Nevertheless, before WSLg, I used mobaxterm and other x11 viewers. I got the same behavior.

@adrg
Copy link
Owner

adrg commented Oct 26, 2021

Hi @wunderbarb. I haven't tried running the GTK3 media player sample application on WSL.
Do other GTK 3 applications work correctly (e.g. the screen recorder sample)?

Have you tried setting the GDK_BACKEND environment variable to x11 before running the application? It probably has no effect, but it's worth a try.

export GDK_BACKEND=x11

Thus, the display of the video is in an automatically full screen created vlc window rather than the gtk.DrawingArea. I guess that it is due to the WSL2 X11 forwarding.

Yes, it probably is due to WSL2 X11 forwarding.

Have you tried setting the DISPLAY environment variable, as suggested here?
Another possibly related post I found on Stack Overflow.

Anyway, I can try running the sample too when I get some free time (hopefully sometime this week).

EDIT: Maybe you need to install one of the preview drivers as well if you haven't done so already:
https://github.com/microsoft/wslg#pre-requisites

@wunderbarb
Copy link
Author

First of all, thanks for your lightning fast reaction. I tried the

export GDK_BACKEND=X11

The application did not launch and the warning message was cannot open display: 0

My WSL2 is running with the latest WSLg (Win11 build 22483 prerelease). With WSLg, there is no more need of defining some exports such as DISPLAY as we had to de before. I have numerous GOTK3 applications perfectly displayed with WSL2 (without video of course).
I forgot that state that I use go 1.16.4 and GOTK3 0.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants