napari / napari-plugin-manager

napari plugin manager to provide a graphical user interface for installing napari plugins.
https://napari.org/napari-plugin-manager
BSD 3-Clause "New" or "Revised" License
5 stars 5 forks source link

`QXcbConnection` warning when closing Plugin Manager dialogue #27

Closed lucyleeow closed 2 months ago

lucyleeow commented 11 months ago

πŸ› Bug Report

When opening the Plugin Manager (via plugin menu) then enable/disable a plugin then closing the dialogue I get the following warning:

WARNING: QXcbConnection: XCB error: 3 (BadWindow), sequence: 1614, resource id: 13471940, major code: 40 (TranslateCoords), minor code: 0
13:14:46 : WARNING : MainThread : QXcbConnection: XCB error: 3 (BadWindow), sequence: 1614, resource id: 13471940, major code: 40 (TranslateCoords), minor code: 0

πŸ’‘ Steps to Reproduce

  1. Plugins -> Plugin Manager
  2. enable/disable a plugin (may have to do a enable close dialogue, open dialogue disable cycle)
  3. Close Plugin manager

πŸ’‘ Expected Behavior

No warning

🌎 Environment

napari: 0.5.0a2.dev418+ga7a67f4d Platform: Linux-5.15.0-84-generic-x86_64-with-glibc2.35 System: Ubuntu 22.04.3 LTS Python: 3.9.16 | packaged by conda-forge | (main, Feb 1 2023, 21:39:03) [GCC 11.3.0] Qt: 5.15.2 PyQt5: 5.15.9 NumPy: 1.22.0 SciPy: 1.11.1 Dask: 2023.6.1 VisPy: 0.12.2 magicgui: 0.7.2 superqt: 0.5.3 in-n-out: 0.1.7 app-model: 0.2.2 npe2: 0.7.0

OpenGL:

Plugins:

πŸ’‘ Additional Context

This may be isolated to my system. If others cannot reproduce happy to close.

I got a similar warning when working on napari/napari#4865 (3rd to last bullet point https://github.com/napari/napari/pull/4865#issuecomment-1285035203), which was solved by using _QtMainWindow.close_window from https://github.com/napari/napari/pull/4820

goanpeca commented 4 months ago

I am taking a look a this one @lucyleeow, I cannot reproduce on my system, but I will try to reproduce it on a more specific linux box

goanpeca commented 4 months ago

Just to double check @lucyleeow, can you still reproduce the error?

lucyleeow commented 4 months ago

Yes. Not a great video but here:

https://github.com/napari/napari-plugin-manager/assets/23182829/e0f1c846-aed5-4049-b261-7025fd40efa7

lucyleeow commented 4 months ago

I also accept that this may be specific to me, in which case I am happy to close

Czaki commented 4 months ago

It looks similar to things that may happen if the dialog is closed before loading all plugins to it.

lucyleeow commented 4 months ago

Ah so if I wait a bit before closing the dialog it wouldn't error? I will try this

lucyleeow commented 4 months ago

Okay I waited, until all available plugins were loaded (is this what you meant @Czaki ?) and I did not see the warning (tried 2x).

However, I did have to wait ~1-2min for all to load (is my internet too slow?) and this does not seem user friendly? Of course the warning is also not causing any problems.

Czaki commented 4 months ago

However, I did have to wait ~1-2min for all to load (is my internet too slow?) and this does not seem user friendly? Of course the warning is also not causing any problems.

No. This is a well-known problem of current implementation. I cannot find the issue now, but @goanpeca should know it.

lucyleeow commented 4 months ago

@Czaki close if you don't think this is a problem, I.e. this warning only appearing if plugins have not been loaded makes it not a problem.

Czaki commented 4 months ago

I'm not sure. In general, some sort of clean hanging thread on the close of a dialog may be useful, as solving performance problems only masks the source of the problem with the pending thread.

dalthviz commented 2 months ago

Give this a check over an Ubuntu VM I have but I was unable to reproduce πŸ€” Checking the video I saw that the plugin being enabled/disabled is some sort of dummy plugin so I even tried installing what I think is the source of that plugin from https://github.com/napari/dummy-test-plugin/tree/npe1 but I got a different error when relaunching napari with that plugin disabled (something about a KeyError)

Also, gave a general check to the warning/error message and found this Qt bug report: https://bugreports.qt.io/browse/QTBUG-87141 where, from what I understand, the message is just a warning that can be ignored for the most part and is related with the window manager being used?

Anyhow, just to be sure, are you still able to reproduce this @lucyleeow ?

lucyleeow commented 2 months ago

I had another go and I could re-produce on current main but only after playing for it for a bit.

(I can share a video later if you wish)

I am also happy to just close this, especially as you say the warning can be ignored for the most part. Happy to let others decide

dalthviz commented 2 months ago

I had another go and I could re-produce on current main but only after playing for it for a bit.

Thanks for checking! Will keep trying to reproduce this then :+1:

lucyleeow commented 2 months ago

If you can't reproduce I am happy to close (especially if it does not occur on mac or windows). It may very well just be my system.

dalthviz commented 2 months ago

Checked a little bit more but still unable to reproduce this :/ Searching for more info about the message I found another Qt bug report: https://bugreports.qt.io/browse/QTBUG-56893. Particulary a comment there seems to explain why this kind of error/warning message could appear in detail.

Not sure what version of PyQt5-Qt5 you are using (if you installed PyQt5 with pip) but maybe updating PyQt5-Qt5 could be worthy since seems like at some point a patch was done to show the message only if you are running things in debug mode.

lucyleeow commented 2 months ago

Thanks for all your digging. I updated pyqt5 and could not re-produce. Will close this, thanks for looking into it!

lucyleeow commented 2 months ago

(Bugreport was very interesting read, makes sense in terms of when it arises on mouse click release. Though no idea why it initially doesn't warn but does later).