-
Notifications
You must be signed in to change notification settings - Fork 524
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
HyperLinkCtrl breaks layout of panel containing multiple sizers #2686
Comments
@arigit look ok on Windows as well |
I tested in a Fedora 41 VM, with the same wxpython version. python3-wxpython4-0:4.2.1-9.fc41.x86_64
And here it works well: It's gtk 3.24 in both (minor versions differ) , slightly newer python in fedora (3.13, vs 3.12 in ubuntu) |
I tested also in a ubuntu VM, 24.04LTS running wayland, same as my main PC minus the Nvidia proprietary driver, and it works well there too. Same versions of everything, in this case. So the problem only manifests on Wayland with the Nvidia proprietary driver (I use for OpenCL/CUDA acceleration mainly). Weirdly enough, it only impacts this particular widget. When this widget is present in the window (it doesn't matter what other widgets are in the same window), they layout breaks, the border becomes transparent etc. |
Out of curiosity, does it happen also with the C++ version of HyperLinkCtrl (under wx.adv)? |
The test I ran previously was on an all AMD PC. I have just run the example code on a PC that has an NVIDIA GeForce RTX 3060 Ti graphics card and is using NVIDIA driver 550.120. The display from the example looks identical to what I got on the AMD PC. The PC with NVIDIA is running the same versions of Python, wxPython and Mint as the AMD PC. Both PCs have GTK 3.24.41 |
@infinity77 the wx.adv version works! with
it works well. With it breaks. This is in my original setup with the nvidia proprietary driver: It's a desktop card and the 565 has been working really well. Prior drivers had some basic issues with wayland. Next I will downgrade the driver to 550 and retest. |
@reticulatus I tested with: NVIDIA-SMI 550.144.03 Driver Version: 550.144.03 CUDA Version: 12.4 the version that installs when I do The result is the same as above,
Same GTK version:
So no difference vs. nvidia version 565 |
@arigit if the functionality required is covered by https://docs.python.org/3/library/webbrowser.html then it would be the preferred choice: no jumping in & out of different libraries ! |
@da-dada since I needed this to run in linux PCs I do not manage nor know details in advance, I opted for using the below construct that I hope has more chances to 'just work' anywhere:
|
@arigit yes, but you should give it a try with the exception webbrowser.Error since you are going to the outside |
Great recco, thanks @da-dada ! adopted. I need a bit more guidance on this,
this is to attempt to get |
@arigit No, it would just be a hint for @infinity77 where the problem comes from |
@da-dada I tried the change in my ubuntu 24.04 installation, the file is here:
I can confirm it worked - magic! Thanks! |
I can submit a PR for this if it helps |
While this seems to fix the issue on your machine, I believe we have to see whether the change to GenStaticText to wx.StaticText does not mess up things on Windows. wx.StaticText is kind of a special beast, as it’s not a real control on Linux machines - it’s just a label drawn by its parent. On Windows it is a real widget and a native one, so it’s possible that some methods that are currently inherited from GenStaticText (OnPaint, DoGetBestSize, etc…) may misbehave. If everything works all right on Windows (and on Mac, since we’re here), then by all means go ahead 😊. |
@infinity77 Tested in Windows11: Before the change: After the change: No issue. After: |
In this simple scenario,
the resulting window shows:
which is totally broken (the window border shows transparent, window controls disappear, the window title shows below the hyperlink.
When using any other widget, for example a StaticText,
then the layout is as correct, as expected:
I ran into this while trying to use HyperLinkCtrl in an complex GUI and it completely broke it.
Environment:
Ubuntu 24.01.1 / LTS using Wayland
apt show python3-wxgtk4.0
Package: python3-wxgtk4.0
Version: 4.2.1+dfsg-3build2
python3 --version
Python 3.12.3
gtk-launch --version
3.24.41
The text was updated successfully, but these errors were encountered: