What Counts as a "Window" to the system?

Ubuntu Support Template

Ubuntu Version:
24.04.3 LTS

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.

  1. 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.

  2. 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:

  1. Is this a linux-related issue or would similar issues apply under Windows, MacOS. etc.?
  2. 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.

What I’ve Tried:
List the solutions or workarounds you’ve already attempted.

Before Posting:

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:

inxi -c2 -SGxxx

pyversions --installed

qtchooser -list-versions


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?

Thanks.

$ inxi -c2 -SGxxx
System:
  Host: aigas Kernel: 6.8.0-87-generic arch: x86_64 bits: 64 compiler: gcc
    v: 13.3.0 clocksource: tsc
  Desktop: KDE Plasma v: 5.27.12 tk: Qt v: 5.15.13 wm: kwin_x11 vt: 2 dm:
    1: GDM3 v: 46.2 2: SDDM Distro: Kubuntu 24.04.3 LTS (Noble Numbat)
    base: Ubuntu
Graphics:
  Device-1: Intel Raptor Lake-S UHD Graphics vendor: Lenovo driver: i915
    v: kernel arch: Gen-13 ports: active: eDP-1 empty: none bus-ID: 00:02.0
    chip-ID: 8086:a788 class-ID: 0300
  Device-2: NVIDIA AD104GLM [RTX 3500 Ada Generation Laptop GPU]
    vendor: Lenovo driver: nvidia v: 580.95.05 arch: Lovelace pcie:
    speed: 2.5 GT/s lanes: 16 ports: active: none off: HDMI-A-1
    empty: DP-1,DP-2 bus-ID: 01:00.0 chip-ID: 10de:27bb class-ID: 0300
  Device-3: Syntek Integrated Camera driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 1-4:3 chip-ID: 174f:181f class-ID: fe01
    serial: 200901010001
  Display: x11 server: X.Org v: 21.1.11 with: Xwayland v: 23.2.6
    compositor: kwin_x11 driver: X: loaded: modesetting,nvidia
    unloaded: fbdev,nouveau,vesa dri: iris
    gpu: i915,nv_platform,nvidia,nvidia-nvswitch display-ID: :0 screens: 1
  Screen-1: 0 s-res: 5120x1600 s-dpi: 96 s-size: 1353x423mm (53.27x16.65")
    s-diag: 1418mm (55.81")
  Monitor-1: HDMI-A-1 mapped: HDMI-1-0 note: disabled pos: right
    model: BenQ RD240Q serial: V3R03074019 res: 2560x1600 hz: 60 dpi: 126
    size: 518x324mm (20.39x12.76") diag: 611mm (24.1") modes: max: 2560x1600
    min: 640x480
  Monitor-2: eDP-1 pos: primary,left model: BOE Display 0x0ae0
    res: 2560x1600 hz: 165 dpi: 189 size: 344x215mm (13.54x8.46")
    diag: 406mm (16") modes: 2560x1600
  API: EGL v: 1.5 hw: drv: intel iris drv: nvidia nouveau drv: nvidia
    platforms: device: 0 drv: nvidia device: 1 drv: nouveau device: 2 drv: iris
    device: 3 drv: swrast gbm: drv: nvidia surfaceless: drv: nvidia x11:
    drv: iris inactive: wayland
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: intel mesa
    v: 25.0.7-0ubuntu0.24.04.2 glx-v: 1.4 direct-render: yes renderer: Mesa
    Intel Graphics (RPL-S) device-ID: 8086:a788
  API: Vulkan v: 1.3.275 layers: 5 surfaces: xcb,xlib device: 0
    type: integrated-gpu driver: N/A device-ID: 8086:a788 device: 1
    type: discrete-gpu driver: N/A device-ID: 10de:27bb device: 2 type: cpu
    driver: N/A device-ID: 10005:0000
scohen@aigas:~/setiastrosuitepro$ pyversions --installed
Command 'pyversions' not found, did you mean:
  command 'py3versions' from deb python3 (3.12.3-0ubuntu2.1)
Try: sudo apt install <deb name>
scohen@aigas:~/setiastrosuitepro$ py3versions --installed
python3.12
scohen@aigas:~/setiastrosuitepro$ qtchooser -list-versions
4
5
default
qt4-x86_64-linux-gnu
qt4
qt5-x86_64-linux-gnu
qt5

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.

I would definitely start by installing Qt6, but in a way that it can co-exist with Qt5, because

KDE Plasma version 5.27.12 uses the Qt 5.15 LTS series

That might repair some broken or missing object “channels”.


PrtSc prints the entire desktop, not the specific window that has the current “focus”.

AltPrtSc prints the “focused” window only, the last bordered window that you selected or clicked within.

On my system, PrtSc brings up the “Spectacle” app which offers all the different screenshot options, while AltPrtSc doesn’t appear to do anything.

How can this type of installation be achieved?

You just need to perform a regular install of the Qt6 bundle.

HOWEVER … I suggest you review the following before deciding how to proceed with your project:

Also note that

Porting guides like “Porting to Qt 6” exist because Qt is not backward compatible and applications need to be ported to use a newer version.

SOURCE: https://forum.puppylinux.com/viewtopic.php?t=14080



That seems to be very unique customization or distro configuration. Definitely not standard Linux treatment!

If you are inclined to do so, you could modify or add Key functions using the “Keyboard Shortcuts” Preferences panel:


Or you could use one of the reproduceable methods as outlined in the following discussion:

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.

1 Like