flameshot-org / flameshot

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

Screen configuration updates not picked up on Windows #3089

Open toelke opened 1 year ago

toelke commented 1 year ago

Flameshot Version

v12.1.0

Installation Type

Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...), Using the ready-made package from Github Releases, Compiled from source

Operating System type and version

Windows 10 & 11

Description

When the screen configuration changes (screens removed, tablet rotated), flameshot only shows the overlay gui on the "old" parts of the screens.

I have traced the issue to ScreenGrabber::desktopGeometry() (https://github.com/flameshot-org/flameshot/blob/master/src/utils/screengrabber.cpp#L185-L196) where QGuiApplication::screens returns stale data. I am rather certain that this is a Qt bug, but I want to add it here for completeness and to save others from doing the debugging I did.

Steps to reproduce

  1. Run flameshot
  2. Remove a monitor or rotate the tablet
  3. Take a screenshot
  4. Observe the shaded regions not spanning the complete screen.

Screenshots or screen recordings

No response

System Information

  1. Windows 10+11
  2. Single Tablet screen, up to two additional desktop screens
l-uuz commented 1 year ago

I can confirm this on Windows 10.

dwilliams-1 commented 1 year ago

Can also confirm on windows 10 using 12.1.0

dv-klaus-eckelt commented 4 weeks ago

For me, also the context menu of the tray icon is not fully visible making it difficult to close Flameshot. I used the keyboard arrow keys to navigate to the last entry and confirm with Enter. But for a quicker restart of Flameshot I now use this powershell script:

# Define the process name
$processName = "flameshot"

# Stop the process if it's running
Get-Process -Name $processName -ErrorAction SilentlyContinue | Stop-Process -Force

# Wait for a moment to ensure the process has stopped
Start-Sleep -Seconds 2

# Start the process again
Start-Process -FilePath "c:\Program Files\Flameshot\bin\flameshot.exe"

Additionally I created a shortcut to the script and set its target to: powershell.exe -ExecutionPolicy Bypass -File "C:\path\to\script.ps1"
This allows me to quickly restart Flameshot from the start menu if necessary. image