hoffstadt / DearPyGui

Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
https://dearpygui.readthedocs.io/en/latest/
MIT License
12.94k stars 676 forks source link

App started from WSL with VcXsrv got glfwSetWindowPos error #1940

Open nickosh opened 1 year ago

nickosh commented 1 year ago

Version of Dear PyGui

Version: 1.8.0 Operating System: Windows 11 (WSL with Ubuntu 20.04.5 LTS)

My Issue/Question

Is DPG in 1.8.0 version supported run from WSL? I'm trying to run my DPG app with VcXsrv and got error:

Glfw Error 65543: GLX: Failed to create context: GLXBadFBConfig
python: /home/runner/work/DearPyGui/DearPyGui/thirdparty/glfw/src/window.c:533: glfwSetWindowPos: Assertion `window != NULL' failed.
Aborted

It will be very helpful for development if DPG app can be running from WSL, I think.

To Reproduce

1) Setup VcXsrv for WSL (https://wiki.ubuntu.com/WSL#Running_Graphical_Applications) 2) Run example DPG app from WSL env

Expected behavior

DPG windows must be rendered, the app works as expected.

Standalone, minimal, complete and verifiable example

Just standart example from documentation:

import dearpygui.dearpygui as dpg
import dearpygui.demo as demo

dpg.create_context()
dpg.create_viewport(title='Custom Title', width=600, height=600)

demo.show_demo()

dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
MisterOrange00 commented 1 year ago

WSL2 was updated to make the display forwarding easier. You no longer need to set the Host IP through your .bashrc or .profile. Make sure echo $DISPLAY returns :0, otherwise hunt down where you override the DISPLAY variable. See https://github.com/microsoft/wslg/wiki/Diagnosing-%22cannot-open-display%22-type-issues-with-WSLg#display-environment-variable