flameshot-org / flameshot

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

Plasma on Wayland Multi-monitor issue #2264

Open ryan77627 opened 2 years ago

ryan77627 commented 2 years ago

Flameshot Version

Flameshot v11.0.0 (fe30810e) Compiled with Qt 5.15.2

Installation Type

User repository (AUR)

Operating System type and version

Arch

Description

Running flameshot using Wayland under the latest Plasma (I have 5.23.5 installed right now) using two monitors causes one monitor to actually be captured and then that screenshot is displayed on the other screen. I've attached a recording of me taking a screenshot to show the issue.

Steps to reproduce

  1. Launch flameshot with mutli-monitors.
  2. Initiate a screenshot
  3. A slight freeze will happen, after which only one monitor will have the screenshot gui and will contain the contents of the other screen.

Screenshots or screen recordings

Screen recording of issue:

https://pad.ryan77627.xyz/file/#/2/file/ePz-aCLjJ5XOV+BKu+ajqvwU/

System Information

  1. Arch, fully updated
  2. https://i.imgur.com/GAyF4Ma.png
  3. Plasma and KWin using Wayland
borgmanJeremy commented 2 years ago

Wayland or x11?

Edit:nvm see in the image

borgmanJeremy commented 2 years ago

Did it used to work and it broke with this update?

ryan77627 commented 2 years ago

Yes-- It worked with v0.10.2 and this update happened to break it. I've been looking through some past commits and have a feeling I know what happened. I see that v0.10.2 used the xcb launch option to run under XWayland, which broke copying to the clipboard (which this update fixed) and keybindings (also fixed). I'm gonna do some testing to see if that's the case.

ryan77627 commented 2 years ago

Yup, launched using QT_QPA_PLATFORM=xcb flameshot and that indeed brings back the original (intended) behavior, with the unintended side effect of breaking the copy to clipboard feature and the keybindings again.

ryan77627 commented 2 years ago

Actually, for whatever reason, I can't get the clipboard to work as per #2276. I'm not sure why I thought it was working for me, sorry about the noise regarding that. If I get it to work I'll update, but the main purpose of the bug report (multi-monitor issue) is still valid when running under wayland and not xcb.

cmidkiff87 commented 2 years ago

I experience this issue too.

This might be related to an issue that I've been trying to solve with FreeRDP on wayland. Wayland (nor the xdg extensions) support a single wl_surface that full-screens across monitors (outputs). I dunno if Qt5 or Qt6 have solutions to this. If my guess is correct, the reason this works when you set the QT_QPA_PLATFORM=xcb is that it forces Flameshot to run in XWayland

I myself have no experience with Wayland, so I'm still messing about with the wayland docs.

Relevant wayland docs: https://wayland.app/protocols/fullscreen-shell-unstable-v1 https://wayland.app/protocols/xdg-shell#xdg_toplevel:request:set_fullscreen

Specs

Flameshot v11.0.0 (0fe55916) Compiled with Qt 5.15.2 Operating System: Arch Linux KDE Plasma Version: 5.23.5 KDE Frameworks Version: 5.90.0 Qt Version: 5.15.2 Kernel Version: 5.16.1-arch1-1 (64-bit) Graphics Platform: Wayland Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor Memory: 62.8 GiB of RAM Graphics Processor: AMD Radeon RX 6900 XT
mfzha commented 2 years ago

To keep track of this problem since it is a recurring issue, here is where this bug seemed to first be documented: https://github.com/flameshot-org/flameshot/issues/1755 (v 0.10.0), where setting the XCB (effectively running it against X, see https://doc.qt.io/qt-5/linux-requirements.html) will solve the issue: QT_QPA_PLATFORM=xcb /usr/bin/flameshot will launch across all monitors but shortcuts (e.g. copy to clipboard, save to file) won't work.

This propagated to v 0.10.1 as in another (currently open) ticket: https://github.com/flameshot-org/flameshot/issues/1938

Now this current ticket is finding the same problem. Let me try and clarify a little what @cmidkiff87 is saying, since I don't think this is very clear for newcomers. XWayland is an X11 server running inside a Wayland compositor, XCB is a library which allows us to interface with the X11 server. We can force applications to run in XWayland on KDE with QT_QPA_PLATFORM=xcb, see https://community.kde.org/KWin/Wayland#Forcing_KDE_apps_to_run_as_X11.

I have a sneaking suspicion that this is an upstream issue that will keep cropping up, and not something we can fix on a per-app basis. Maybe I'm wrong though.

avindra commented 2 years ago

I am having this problem on X11. one of the recent releases broke it. QT_QPA_PLATFORM=xcb /usr/bin/flameshot doesn't help in my case

mmahmoudian commented 2 years ago

@avindra the QT_QPA_PLATFORM=xcb is proposed for Wayland users and not X11 users. Please also confirm that you are using the latest KDE, otherwise if you are using something else this issue most probably is not the correct place to discuss your issue.

avindra commented 2 years ago

@mmahmoudian thanks for clarifying that QT_QPA_PLATFORM was for Wayland. I am not using KDE, I am only using the i3 window manager.

I watched the video from the OP and the symptoms are exactly the same on my end (only one monitor shows up).

I tested flameshot 0.10.2 and found there was no issue there. So the break is somewhere in the set of changes for v11.0.0.

borgmanJeremy commented 2 years ago

@avindra depending on your level of expertise do you mind finding the commit that introduced the bug using git bisect?

avindra commented 2 years ago

Today I try git bisect for the first time. It looks like #2003 is where it broke and #2142 is the last working rev.

borgmanJeremy commented 2 years ago

Thanks a lot for narrowing it the commit! That really helps

MrDiver commented 10 months ago

Any updates?

davigamer987 commented 8 months ago

This is still broken for me