Desktop Environment (if applicable):
KDE Plasma but also a problem on Gnome
Problem Description:
This concerns an application written in PyQt6.
I did not write this application; I am a user but I have access to its source code. There is a small community of users who use this program and I try to be helpful to the developer, who is not, primarily, a programmer. He is very active in making improvements and he does accept git pull requests if he likes them.
I am a retired developer with some but not vast experience in python. Not much with PyQt.
Here is my question:
This application uses several different kinds of windows. There is the main window. Others are dialogs, inheriting from QDialog. Others, the ones I am concerned about, are inherited from QWidget. The problem I have with these windows is that they are not recognized by the system as “windows”. I see this in two ways.
the system PrintScreen function (implemented on my system as the “Spectacle” application) does not consider these windows as windows, when the “Active Window” is selected to be captured as a screen shot. If I select “Active Window” that is assumed to be the main window. If I want to capture just this window, I must use the “rectangular region” option, which I used in the screenshot below. This is not the case with the dialogs. If one of them is active, then it is the active window.
The system settings have settings for window borders and other such adornments. When I modify these, the setting change is applied to the main window, to dialogs, but NOT to these “mere QWidget” windows.
So here are two questions:
Is this a linux-related issue or would similar issues apply under Windows, MacOS. etc.?
It there some PyQt enhancement that could be applied to such windows in a relatively pain-free manner that would allow these windows to be recognized by the system as windows?
Relevant System Information:
Screenshots or Error Messages:
A “borderless” window: system settings re borders do not affect this.
If possible, maybe share a segment of the code that is relevant to the specific issue, along with comments related to the specific segment which is presenting you with challenges.
Also, if you could share the output of the following with the Community, someone might be able to give some specific advice:
That sounds like an object property inheritance not propagated/shared by Python side with the Qt side, or vice-versa. So that would be a more global API-specific issue, whether the API has a mechanism for that sharing/propagation, within the custom-coded libraries/interfaces.
If you do the AltPrtSc, for the desired window, do you get what you wanted in the “sample box” with the actions offered?
Or are you trying to somehow only have the Starfield viewport selected for print?
Is it possible that one of the following discussions covers the issue you are tying to deal with?
Now that’s interesting, maybe? The python is PyQt6, but Qt6 isn’t installed? Does that matter?
Yeah, this feels like a more system-level issue. But I don’t know enough about the PyQt toolkit to understand this.
You mean just PrtSc, not AltPrtSc, right?
No, I would like capture the whole window, not just the starfield. If I wanted just the starfield, then I realize I would have to use the “rectangular region” option, not the “active window” option. But if the window is active, I would like “active window” to capture it. Instead it captures the main window and everything in it which includes this image display window.
On my system, PrtSc brings up the “Spectacle” app which offers all the different screenshot options, while AltPrtSc doesn’t appear to do anything.
Thanks. I just watched a YouTube video where they run the same program on Windows. The same issues with window borders that I see under Ubuntu are visible there as well. I guess this is a Qt6 or PyQt6 issue, and not anything specific to my system or to Ubuntu. But thanks for your explanations.