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

PySide6 backend causes application to flash on creation of opengl context #2489

Open
hmaarrfk opened this issue May 22, 2023 · 4 comments
Open

Comments

@hmaarrfk
Copy link
Contributor

OS: Ubuntu 23.04
Desktop Backend: Wayland
Qt6 backend: X11

Upon creation of a scene, it seems that the main window gets destroyed before getting recreated with the scene.

Maybe I'm passing in the wrong object?

Screencast.from.2023-05-21.21-17-36.webm
mamba list
# packages in environment at /home/mark/mambaforge/envs/vispy:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
alsa-lib                  1.2.8                h166bdaf_0    conda-forge
attr                      2.5.1                h166bdaf_1    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
ca-certificates           2023.5.7             hbcca054_0    conda-forge
cairo                     1.16.0            h35add3b_1015    conda-forge
cython                    0.29.34         py310heca2aa9_0    conda-forge
dbus                      1.13.6               h5008d03_3    conda-forge
double-conversion         3.2.0                h27087fc_1    conda-forge
expat                     2.5.0                hcb278e6_1    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.2               h14ed4e7_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
freetype                  2.12.1               hca18f0e_1    conda-forge
freetype-py               2.4.0                    pypi_0    pypi
gettext                   0.21.1               h27087fc_0    conda-forge
glib                      2.76.2               hfc55251_0    conda-forge
glib-tools                2.76.2               hfc55251_0    conda-forge
graphite2                 1.3.13            h58526e2_1001    conda-forge
gst-plugins-base          1.22.0               h4243ec0_2    conda-forge
gstreamer                 1.22.0               h25f0c4b_2    conda-forge
harfbuzz                  7.3.0                hdb3a94d_0    conda-forge
hsluv                     5.0.3                    pypi_0    pypi
icu                       72.1                 hcb278e6_0    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
kiwisolver                1.4.4                    pypi_0    pypi
krb5                      1.20.1               h81ceb04_0    conda-forge
lame                      3.100             h166bdaf_1003    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libblas                   3.9.0           16_linux64_openblas    conda-forge
libcap                    2.67                 he9d0100_0    conda-forge
libcblas                  3.9.0           16_linux64_openblas    conda-forge
libclang                  15.0.7          default_h7634d5b_2    conda-forge
libclang13                15.0.7          default_h9986a30_2    conda-forge
libcups                   2.3.3                h36d4200_3    conda-forge
libdeflate                1.18                 h0b41bf4_0    conda-forge
libdrm                    2.4.114              h166bdaf_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libexpat                  2.5.0                hcb278e6_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libflac                   1.4.2                h27087fc_0    conda-forge
libgcc-ng                 12.2.0              h65d4601_19    conda-forge
libgcrypt                 1.10.1               h166bdaf_0    conda-forge
libgfortran-ng            12.2.0              h69a702a_19    conda-forge
libgfortran5              12.2.0              h337968e_19    conda-forge
libglib                   2.76.2               hebfc3b9_0    conda-forge
libgomp                   12.2.0              h65d4601_19    conda-forge
libgpg-error              1.46                 h620e276_0    conda-forge
libiconv                  1.17                 h166bdaf_0    conda-forge
libjpeg-turbo             2.1.5.1              h0b41bf4_0    conda-forge
liblapack                 3.9.0           16_linux64_openblas    conda-forge
libllvm15                 15.0.7               hadd5161_1    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.21          pthreads_h78a6416_3    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpciaccess              0.17                 h166bdaf_0    conda-forge
libpng                    1.6.39               h753d276_0    conda-forge
libpq                     15.3                 hbcd7760_1    conda-forge
libsndfile                1.2.0                hb75c966_0    conda-forge
libsqlite                 3.42.0               h2797004_0    conda-forge
libstdcxx-ng              12.2.0              h46fd767_19    conda-forge
libsystemd0               253                  h8c4010b_1    conda-forge
libtiff                   4.5.0                ha587672_6    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libwebp-base              1.3.0                h0b41bf4_0    conda-forge
libxcb                    1.13              h7f98852_1004    conda-forge
libxkbcommon              1.5.0                h79f4944_1    conda-forge
libxml2                   2.10.4               hfdac1af_0    conda-forge
libxslt                   1.1.37               h873f0b0_0    conda-forge
libzlib                   1.2.13               h166bdaf_4    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
mpg123                    1.31.3               hcb278e6_0    conda-forge
mysql-common              8.0.32               hf1915f5_2    conda-forge
mysql-libs                8.0.32               hca2cd23_2    conda-forge
ncurses                   6.3                  h27087fc_1    conda-forge
numpy                     1.24.3          py310ha4c1d20_0    conda-forge
openssl                   3.1.0                hd590300_3    conda-forge
packaging                 23.1               pyhd8ed1ab_0    conda-forge
pcre2                     10.40                hc3806b6_0    conda-forge
pip                       23.1.2             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h36c2ea0_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
pulseaudio-client         16.1                 h5195f5e_3    conda-forge
pyside6                   6.5.0           py310hc900f1c_1    conda-forge
python                    3.10.11         he550d4f_0_cpython    conda-forge
python_abi                3.10                    3_cp310    conda-forge
qt6-main                  6.5.0                hae41e4f_6    conda-forge
qtpy                      2.3.1              pyhd8ed1ab_0    conda-forge
readline                  8.2                  h8228510_1    conda-forge
setuptools                67.7.2             pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
vispy                     0.0.0                    pypi_0    pypi
wheel                     0.40.0             pyhd8ed1ab_0    conda-forge
xcb-util                  0.4.0                h516909a_0    conda-forge
xcb-util-cursor           0.1.4                hd590300_0    conda-forge
xcb-util-image            0.4.0                h166bdaf_0    conda-forge
xcb-util-keysyms          0.4.0                h516909a_0    conda-forge
xcb-util-renderutil       0.3.9                h166bdaf_0    conda-forge
xcb-util-wm               0.4.1                h516909a_0    conda-forge
xkeyboard-config          2.38                 h0b41bf4_0    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.0.10               h7f98852_0    conda-forge
xorg-libsm                1.2.3             hd9c2040_1000    conda-forge
xorg-libx11               1.8.4                h0b41bf4_0    conda-forge
xorg-libxau               1.0.11               hd590300_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h0b41bf4_2    conda-forge
xorg-libxrender           0.9.10            h7f98852_1003    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h0b41bf4_1003    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
zlib                      1.2.13               h166bdaf_4    conda-forge
zstd                      1.5.2                h3eb15da_6    conda-forge

After installing: qt6-wayland adwaita-qt6 qgnomeplatform6 for better integration with wayland, the problem still persists:
Screencast from 2023-05-21 21-21-39.webm

I guess the problem "goes away" if you create the scene as part of the __init__ for the main window.

I haven't done an exhaustive search, but I'm pretty sure the problem doesn't appear if PySide2 is used mostly because I observed this when trying to see if we were ready for pyside6.

@djhoese
Copy link
Member

djhoese commented May 22, 2023

Can you try creating the app instance like this in the main function:

    app = use_app("pyside6")
    app.create()

That would obviously be the vispy version of the app which I think is a wrapper around the native Qt/PySide app. I see you keep a handle on it in the __init__ but don't use it in this example. Maybe try removing that regardless for debugging purposes?

@hmaarrfk
Copy link
Contributor Author

sorry for my very late reply.
By using the vispy app:

def main():
    from vispy.app import use_app
    app = use_app('pyside6')
    app.create()

    main_window = MainWin(app)
    main_window.show()

    return app.run()

Whether or not I keep a reference of the app doesn't seem to change the behavior.

Screencast.from.2023-06-17.09-43-44.webm

@hmaarrfk
Copy link
Contributor Author

Tracking things with ipdb I can catch the flash happening on this line of code:
https://github.com/vispy/vispy/blob/main/vispy/app/backends/_qt.py#L840

@hmaarrfk
Copy link
Contributor Author

@hmaarrfk hmaarrfk changed the title PySide6 + Wayland backend causes application to flash on creation of opengl context PySide6 backend causes application to flash on creation of opengl context Dec 6, 2023
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