flameshot-org / flameshot

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

Crash when clicking arrow, square, etc while text tool is active #3232

Closed zjuul closed 1 year ago

zjuul commented 1 year ago

Flameshot Version

Flameshot v11.0.0 (11.0.0-2 Debian) Compiled with Qt 5.15.2

Installation Type

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

Operating System type and version

Linux 5.19.0-43-generic #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon May 22 13:39:36 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Description

When adding text to an image, clicking one of the tools (arrow, line, bubble, etc) results in a crash.

Syslog says:

.. systemd[2732]: Started Application launched by gsd-media-keys.
.. gnome-shell[3076]: Window manager warning: Invalid WM_TRANSIENT_FOR window 0x480000a specified for 0x4800008.
.. gsd-media-keys[36772]: flameshot: info: Screenshot aborted.

or:

.. gnome-shell[3076]: Window manager warning: Invalid WM_TRANSIENT_FOR window 0x560000a specified for 0x5600008.
.. gnome-shell[3076]: Window manager warning: WM_TRANSIENT_FOR window 0x5600008 for override-redirect window 0x5600023 is an override-redirect window and this is not correct according to the standard, so we'll fallback to the root window.
.. gnome-shell[3076]: Window manager warning: WM_TRANSIENT_FOR window 0x5600008 for override-redirect window 0x560002d is an override-redirect window and this is not correct according to the standard, so we'll fallback to the root window.
.. gsd-media-keys[38489]: flameshot: info: Screenshot aborted.

This only happens when the text tool is active, and a cursor is active. Closing the text tool, then clicking an other tool works fine.

dbus log

signal time=1686911655.050088 sender=org.freedesktop.DBus -> destination=:1.217 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.217"
signal time=1686911655.050139 sender=org.freedesktop.DBus -> destination=:1.217 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.217"
method call time=1686911663.915873 sender=:1.219 -> destination=org.freedesktop.DBus serial=12 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.a11y.Bus',arg1=''"
method call time=1686911663.915944 sender=:1.219 -> destination=org.freedesktop.DBus serial=13 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameHasOwner
   string "org.a11y.Bus"
method call time=1686911663.916175 sender=:1.219 -> destination=org.freedesktop.DBus serial=14 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.a11y.Bus'"
method call time=1686911663.916196 sender=:1.219 -> destination=org.freedesktop.DBus serial=15 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner
   string "org.a11y.Bus"
method call time=1686911663.916397 sender=:1.219 -> destination=org.a11y.Bus serial=16 path=/org/a11y/bus; interface=org.freedesktop.DBus.Properties; member=Get
   string "org.a11y.Status"
   string "ScreenReaderEnabled"
method call time=1686911663.916843 sender=:1.219 -> destination=org.a11y.Bus serial=17 path=/org/a11y/bus; interface=org.freedesktop.DBus.Properties; member=Get
   string "org.a11y.Status"
   string "IsEnabled"

Steps to reproduce

  1. activate flameshot
  2. draw a rectangle to select a screen region
  3. click the text tool T
  4. click somewhere in the rectangle
  5. type some text (optional)
  6. with the cursor still blinking, click arrow tool

Screenshots or screen recordings

No response

System Information

Running X11

System:
  Host: monster Kernel: 5.19.0-43-generic x86_64 bits: 64 Desktop: GNOME 42.5
    Distro: Ubuntu 22.04.2 LTS (Jammy Jellyfish)
Graphics:
  Device-1: NVIDIA TU116 [GeForce GTX 1660] driver: nvidia v: 470.182.03
  Device-2: Logitech StreamCam type: USB
    driver: hid-generic,snd-usb-audio,usbhid,uvcvideo
  Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: nvidia
    unloaded: fbdev,modesetting,nouveau,vesa gpu: nvidia resolution:
    1: 2560x1440~60Hz 2: 3840x2160~60Hz
  OpenGL: renderer: NVIDIA GeForce GTX 1660/PCIe/SSE2
    v: 4.6.0 NVIDIA 470.182.03
Monitors: 2
 0: +*HDMI-0 3840/708x2160/399+2560+0  HDMI-0
 1: +DP-4 2560/597x1440/336+0+0  DP-4
borgmanJeremy commented 1 year ago

This is fixed in 12.0

zjuul commented 1 year ago

This is fixed in 12.0

Confirmed. Version found at https://launchpad.net/ubuntu/mantic/amd64/flameshot/12.1.0-2 does not have the issue.

I wanted to donate to flameshot anyway, so added a small bounty on rysolv for this ticket, so whoever fixed this can claim the bounty. Thanks all for creaing this tool - I use it daily.

borgmanJeremy commented 1 year ago

Thanks, @AndreaMarangoni fixed it here: https://github.com/flameshot-org/flameshot/pull/2369

mmahmoudian commented 1 year ago

@AndreaMarangoni if you have issues cashing out the bounty, I can ask rysolv to handle the payment. Just ping me if there was any issues. Thanks again for contributions.

@zjuul thanks for the bounty. It creates more incentive for developers to contribute and everyone gets the benefit of the fixed bug.