flameshot-org / flameshot

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

Flameshot window is not focused until it is clicked #2269

Open j-tai opened 2 years ago

j-tai commented 2 years ago

Flameshot Version

Flameshot v11.0.0 () Compiled with Qt 5.15.3 linux: 5.15.11-76051511-generic org.kde.Platform: 5.15

Installation Type

Flatpak from Flathub

Operating System type and version

Pop!_OS 21.10

Description

When taking a screenshot with the flameshot gui command, Flameshot is not automatically focused. Thus, it does not respond to keypresses until you click with the mouse.

Steps to reproduce

  1. Run flameshot gui
  2. Press Esc to exit → Nothing happens

Screenshots or screen recordings

No response

System Information

Pop!_OS 21.10

image 1080p + 1440p

GNOME 40 on Xorg

j-tai commented 2 years ago

Weird, I can't reproduce this anymore...

mmahmoudian commented 2 years ago

Do you use tiling of the PopOS DE?

j-tai commented 2 years ago

Yes. Though I never experienced this issue with v0.10.

mmahmoudian commented 2 years ago

Then you are experiencing a known issue. It has been reported few times already, one of which is:

https://github.com/flameshot-org/flameshot/issues/2031#issuecomment-1013311033

I think someone even opened an issue in PopOS repo. I should search in the issues to find it though.

j-tai commented 2 years ago

Actually, yeah I had that issue a few days ago! But I've already updated Pop Shell which fixed that.

This seems to be different since it is fixed after clicking anywhere, and it only happens sometimes.

j-tai commented 2 years ago

Okay, I'm able to reproduce this again. Flameshot doesn't respond to any keypresses, and instead those keypresses go to the previously focused window. Weirdly, it doesn't display the "Flameshot has lost focus" message when this happens. Update: it does display it when I disconnect my 2nd monitor.

And just when I've finished writing this, I can't reproduce anymore. :confused:

j-tai commented 2 years ago

Okay, these steps seem to reproduce the bug reliably. Please let me know if these work for you.

  1. Enable window tiling in Pop!_OS.
  2. Quit flameshot if it is running.
  3. In a terminal, run flatpak run org.flameshot.Flameshot gui
  4. Select a region and press Ctrl+C to copy the screenshot
  5. Wait at least 5 seconds
  6. Run flatpak run org.flameshot.Flameshot gui again
  7. Press Esc to try to exit → Nothing happens

Make sure you do not click on Flameshot in the system tray (even if you don't select anything in the dropdown)... that stops the bug from happening. Edit: this might be incorrect.

mmahmoudian commented 2 years ago

Update: it does display it when I disconnect my 2nd monitor.

It is known that Flameshot does not detect the newly attached or detached monitor. so every time you modify your monitors, killing and starting Flameshot daemon is necessary.

6.Run flatpak run org.flameshot.Flameshot gui again 7.Press Esc to try to exit → Nothing happens

before step 6 can you check if Flameshot is already running?

j-tai commented 2 years ago

Yes, it is running at that point.

mmahmoudian commented 2 years ago

@j-tai

How about this sequence:

  1. pkill flameshot and make sure it is not running
  2. Enable window tiling in Pop!_OS.
  3. run flatpak run org.flameshot.Flameshot gui
  4. Select a region and press Ctrl+C to copy the screenshot
  5. Wait at least 5 seconds
  6. Check if Flameshot is closed and report in this thread
  7. Run flatpak run org.flameshot.Flameshot gui again
  8. Press Esc to try to exit

I suspect that you have the daemon running and that is somehow glitching

j-tai commented 2 years ago

These steps do reproduce the issue. In step 6, flameshot running is in the system tray.

andrejb-dev commented 3 months ago

The same behaviour aplies to Windows flameshot installation. Flameshot v12.1.0 (96c2c82e) Compiled with Qt 5.15.2 winnt: 10.0.22631 windows: 10

After hitting mapped key "print screen" the flameshot goes on and is workable. But hitting Esc to close it, works only after the first interaction with the mouse is made. (I assume it focuses the flameshot window after that) On situation of accidential key hitting its cumbersome to execute redundant mouse action to continue working.

UPDATE: Some more testing today, and I find out that Esc is not working only on the first start of screen capturing. Afterwards, on subsequent tries, Esc worked like expected.