Skip to content
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

In KDE Plasma Wayland with multiple vertically-stacked displays, the Flameshot GUI is shown only on the bottom display and shows content from the top display, truncating the rest of the viewport #3761

Open
AlexFolland opened this issue Oct 23, 2024 · 10 comments
Labels
Unconfirmed Bug The bug is not confirmed by anyone else. Wayland Wayland specific issues

Comments

@AlexFolland
Copy link

Flameshot Version

Flameshot 12.1.0

Installation Type

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

Operating System type and version

Manjaro

Description

In KDE Plasma Wayland with multiple vertically-stacked displays, the Flameshot GUI is shown only on the bottom display and shows content from the top display, truncating the rest of the viewport. The content from the bottom display is not fully shown, so screenshots can't be captured from there. The top display is left unused.

Additionally, the following output is displayed in the terminal after running flameshot gui.

Unable to get current screen, starting to use primary screen. It may be a cause of logical error and working with a wrong screen.
Unable to get current screen, starting to use primary screen. It may be a cause of logical error and working with a wrong screen.
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Unable to get current screen, starting to use primary screen. It may be a cause of logical error and working with a wrong screen.
Unable to get current screen, starting to use primary screen. It may be a cause of logical error and working with a wrong screen.
flameshot: info: Screenshot aborted.

Steps to reproduce

  1. Have multiple vertically-stacked displays attached to the computer.
  2. Run KDE Plasma Wayland.
  3. Click the Flameshot system tray icon or run flameshot gui from a terminal.

Screenshots or screen recordings

Here's a video made with my phone because I can't capture the issue clearly from the computer itself. I transcoded the video to AV1 with CRF 59 to allow in-browser playback and fit the 10 MiB github upload limit, so if the video isn't playing for you, you'll need to enable AV1 video playback in your browser.

2024-10-23.flameshot.kde.wayland.issue.mp4

System Information

KDE Plasma Wayland

@AlexFolland AlexFolland added the Unconfirmed Bug The bug is not confirmed by anyone else. label Oct 23, 2024
@FelixJochems
Copy link

FelixJochems commented Oct 27, 2024

This is because flameshot is unable to find what screen to capture, then spawns the screen capture on the screen where your mouse currently is, squishing your bottom screen.

You could set a window rule that forces flameshot to be fullscreen so that it will cover the entire screen that it's spawned on. Due to how flameshot is programmed right now it's hard to make it display on both screens at once, WLR layers could fix this in the future but is a big undertaking.

The easiest fix right now would be to install with the USE_WAYLAND_GRIM flag and set a windowrule to force flameshot into a fullscreen. This will start capture on the screen where your mouse currently is.

@AlexFolland
Copy link
Author

AlexFolland commented Oct 27, 2024

Thanks for the workaround. I'll try it soon and report whether it temporarily works around the bug.

@AlexFolland
Copy link
Author

AlexFolland commented Oct 27, 2024

KWin doesn't seem to properly apply all window rules for this. I realized that Flameshot's initial placement needs to be in the top-left corner of the total screen area, which is off any physical screen since my monitors have different resolutions. Position (0,0) in the top-left corner is outside the screen area (in the black area in flameshot's preview, as can be seen in my video). KWin needs to allow Flameshot to be placed there so that it's positioned perfectly, but I think KWin is preventing initial placement outside the physical screen space in the top-left corner.

@FelixJochems
Copy link

Ah yeah that is pretty dang annoying, I'm currently in the process of developing a fork targeted at wayland displays, especially because weird situations like these pop up way too often.

I'm not familiar with KWin/KDE Plasma so I don't know if there are other windowrules to force it somewhere else. The last option I can think of is compiling locally with the USE_WAYLAND_GRIM to see if that happens to change anything.

@typecasto
Copy link

I had a very similar issue with horizontal monitors, could you try setting up window rules as such and see if this fixes it?

image

@AlexFolland
Copy link
Author

AlexFolland commented Oct 28, 2024

Yes, I tried that, but it doesn't work. Screen position (0,0) is not on any display and I think that's why KWin doesn't respect my rule.

@AlexFolland
Copy link
Author

The window appears with its top-left corner in the center of my lower display.

I've just tested an initial position of (320,0), and that does make it appear in the top-left corner of my top display, but shifted 320 pixels to the right, so I can see the black area that should be outside the display. However, as soon as I set it to (319,0), it appears with its top-left corner in the middle of my lower display again.

@FelixJochems
Copy link

Definitely one of those edge cases I will keep in mind for the rewrite, but as it would require significant changes to the current codebase I will not be fixing this as is.

@AlexFolland
Copy link
Author

AlexFolland commented Oct 29, 2024

It seems like this must not be Flameshot's fault. I think I'll need to open a bug report for KWin and link to this ticket to clarify the issue for KWin devs, since KWin is not respecting Flameshot's window position even though Flameshot is not entirely off the screen. What do you think?

@ParadoxLeon
Copy link

Maybe this can help.

Had a similar Issue and this fixed it for me.

@FelixJochems FelixJochems added the Wayland Wayland specific issues label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Unconfirmed Bug The bug is not confirmed by anyone else. Wayland Wayland specific issues
Projects
None yet
Development

No branches or pull requests

4 participants