flameshot-org / flameshot

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:
https://flameshot.org
GNU General Public License v3.0
23.92k stars 1.52k forks source link

Scaling do not work correctly when taking screenshot in Plasma6/Wayland #3614

Open dhay3 opened 1 month ago

dhay3 commented 1 month ago

Flameshot Version

Flameshot v12.1.0 (-)
Compiled with Qt 5.15.10
linux: 6.9.0-1-MANJARO
manjaro: unknown

Installation Type

Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)

Installed via pacman.

Operating System type and version

6.9.0-1-MANJARO

Description

In KDE Plasma5/Wayland, flameshot works without any unexpected behaviors when scaling is enabled that is not the default. But after updating to KDE Plasma6/Wayland, flameshot seems do not obey the scaling when taking screenshots. It leaves the screen to be taken as floating in the black background(zoom out), while the selection region with the normal action and size, same as the saved pictures.

Things I have tried:

  1. Use command env QT_AUTO_SCREEN_SCALE_FACTOR="1.25" QT_SCREEN_SCALE_FACTORS="" flameshot gui, not work.
  2. Use command env QT_SCREEN_SCALE_FACTORS="1;1" flameshot gui, not work.
  3. Use command env XDG_SESSION_TYPE=x11 flameshot gui, works, but keystrokes will never be read when Legacy X11 App Support is set to Never.
  4. Use command env QT_QPA_PLATFORM=xcb flameshot gui, works, same as X11.
  5. Set Kwin rules follow the instruction of issue#3073 , not work.
  6. Set display scaling to 100%, works.
  7. Use appimage version, not work.

It seems like a duplicate of #3566, but no resolutions yet.

For the temporary using, I make flameshot starts as an X11 app.

Steps to reproduce

  1. Set the display scaling to 125% or 150%.
  2. Run flameshot gui or click the take screenshot button in GUI.

Screenshots or screen recordings

The following screenshot was taken by Spectacle when flameshot gui is activated.

image

And the output of flameshot gui in konsole.(Not for sure, those errors will be taken in count.)

QFont::fromString: Invalid description 'Hack Nerd Font,12,-1,5,900,0,0,0,0,0,0,0,0,0,0,1,Regular'
QFont::fromString: Invalid description 'Hack Nerd Font,12,-1,5,900,0,0,0,0,0,0,0,0,0,0,1,Regular'
QFont::fromString: Invalid description 'Hack Nerd Font,12,-1,5,900,0,0,0,0,0,0,0,0,0,0,1,Regular'
QFont::fromString: Invalid description 'Hack Nerd Font,12,-1,5,900,0,0,0,0,0,0,0,0,0,0,1,Regular'
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
flameshot: info: Screenshot aborted.

Also here is a video if the picture do not describe the question clearly.

https://github.com/flameshot-org/flameshot/assets/62749885/a27e6af8-34c9-416c-9eed-94be7b768fb1

System Information

Display Configuration:

image

Hardware & Display Server:

$ inxi -xxG
Graphics:
  Device-1: NVIDIA AD107M [GeForce RTX 4060 Max-Q / Mobile]
    vendor: Micro-Star MSI driver: nvidia v: 550.78 arch: Lovelace pcie:
    speed: 2.5 GT/s lanes: 2 ports: active: none empty: DP-1, DP-2, HDMI-A-1,
    eDP-1 bus-ID: 01:00.0 chip-ID: 10de:28a0
  Device-2: AMD Raphael vendor: Micro-Star MSI driver: amdgpu v: kernel
    arch: RDNA-2 pcie: speed: 16 GT/s lanes: 16 ports: active: eDP-2 empty: DP-3,
    DP-4, DP-5, Writeback-1 bus-ID: 06:00.0 chip-ID: 1002:164e temp: 46.0 C
  Device-3: Bison HD Webcam driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 5-1.1:3 chip-ID: 5986:211c
  Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 23.2.6
    compositor: kwin_wayland driver: X: loaded: amdgpu,nvidia dri: radeonsi
    gpu: nvidia,amdgpu display-ID: 0
  Monitor-1: eDP-2 res: 2048x1152 size: N/A
  API: EGL v: 1.5 platforms: device: 0 drv: nvidia device: 2 drv: radeonsi
    device: 3 drv: swrast gbm: drv: nvidia surfaceless: drv: nvidia wayland:
    drv: radeonsi x11: drv: radeonsi inactive: device-1
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: amd mesa v: 24.0.6-manjaro1.1
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon Graphics (radeonsi
    raphael_mendocino LLVM 17.0.6 DRM 3.57 6.9.0-1-MANJARO)
    device-ID: 1002:164e display-ID: :1.0
  API: Vulkan v: 1.3.279 surfaces: xcb,xlib,wayland device: 0
    type: discrete-gpu driver: nvidia device-ID: 10de:28a0 device: 1
    type: integrated-gpu driver: mesa radv device-ID: 1002:164e

DE Version:

$ pacman -Qs plasma-desktop
local/plasma-desktop 6.0.4-1 (plasma)
    KDE Plasma Desktop
jack9603301 commented 1 month ago

Flameshot Version

Flameshot v12.1.0 (-) Compiled with Qt 5.15.10 linux: 6.9.0-1-MANJARO manjaro: unknown

Installation Type

Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)

Operating System type and version

6.9.0-1-MANJARO

Description

In KDE Plasma5/Wayland, flameshot works without any unexpect behaviors when scalling is enabled that is not the default. But after updating to KDE Plasma6/Wayland, flameshot seems do not obey the scalling when taking screenhosts.

Things I tried:

1. env QT_AUTO_SCREEN_SCALE_FACTOR="1.25" QT_SCREEN_SCALE_FACTORS=""
   flameshot gui, not work.
2. env QT_SCREEN_SCALE_FACTORS="1;1" flameshot gui, not work.
3. env XDG_SESSION_TYPE=x11 flameshot gui, works.
4. Set display scaling to 100%, works.

Steps to reproduce

1. run flameshot gui

Screenshots or screen recordings

[1]https://github.com/flameshot-org/flameshot/assets/62749885/a27e6af8-34c9-416c-9eed-94be7b768fb1

System Information

$ inxi -G Graphics: Device-1: NVIDIA AD107M [GeForce RTX 4060 Max-Q / Mobile] driver: nvidia v: 550.78 Device-2: AMD Raphael driver: amdgpu v: kernel Device-3: Bison HD Webcam driver: uvcvideo type: USB Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 23.2.6 compositor: kwin_wayland driver: X: loaded: amdgpu,nvidia dri: radeonsi gpu: nvidia,amdgpu resolution: 2048x1152 API: EGL v: 1.5 drivers: nvidia,radeonsi,swrast platforms: gbm,wayland,x11,surfaceless,device API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: amd mesa v: 24.0.6-manjaro1.1 renderer: AMD Radeon Graphics (radeonsi raphael_mendocino LLVM 17.0.6 DRM 3.57 6.9.0-1-MANJARO) API: Vulkan v: 1.3.279 drivers: nvidia,radv surfaces: xcb,xlib,wayland

— Reply to this email directly, [2]view it on GitHub, or [3]unsubscribe. You are receiving this because you are subscribed to this thread.[4][IMG]Message ID: @.***>

Links:

  1. https://github.com/flameshot-org/flameshot/assets/62749885/a27e6af8-34c9-416c-9eed-94be7b768fb1
  2. https://github.com/flameshot-org/flameshot/issues/3614
  3. https://github.com/notifications/unsubscribe-auth/ACFAZDGEV6N346UYXZH6PMLZDGB6RAVCNFSM6AAAAABH7BU7SWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGMYDKMJRGIYDONI
  4. Image: https://github.com/notifications/beacon/ACFAZDCA7N32WBAPWBSV2KTZDGB6RA5CNFSM6AAAAABH7BU7SWWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHISZJYBM.gif

What is your wayland environment? Is it KDE? It seems so, but I don't understand why?

dhay3 commented 1 month ago

@jack9603301 Yes my DE is KDE Plasma6 ship with Wayland 1.22.0

jack9603301 commented 1 month ago

@jack9603301 Yes my DE is KDE Plasma6 ship with Wayland 1.22.0

Flameshot's screenshot actually comes from the image returned by the operating system's screenshot protocol. Why is it incorrect?

dhay3 commented 1 month ago

@jack9603301 Yes my DE is KDE Plasma6 ship with Wayland 1.22.0

Flameshot's screenshot actually comes from the image returned by the operating system's screenshot protocol. Why is it incorrect?

@jack9603301 I update the OP with more information. Is there a way to debug it, if that is a protocol. It will be highly appreciated if some hints.