flameshot-org / flameshot

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

Screen area selection unresponsive and buggy with undesirable behavior. #894

Open vspecky opened 4 years ago

vspecky commented 4 years ago

Flameshot version Flameshot v0.6.0 Compiled with Qt 5.14.1

Describe the bug In the flameshot gui, when the mouse is clicked and dragged, no selection appears. Instead the cursor changes to a hand and keeps changing randomly at random positions of the screen (crosshair, hand, left resizing, corner resizing, etc)

To Reproduce Seemingly random

Expected behavior When the mouse is clicked and dragged and released, a rectangle representing the selected part of the screen should appear with one corner at the clicking position of the mouse and the other corner at the release position, with icons depicting various options to draw over the selection, manipulate it, etc appearing around the selection.

System Information Distribution: Manjaro Linux 20.1 Mikah Linux Kernel: 5.7.17-2-MANJARO DE: Gnome WM: i3

mmahmoudian commented 4 years ago

@vspecky Do you have multiple monitors? If so, does this happens on all monitors? Also would it possible to record your screen and demo this buggy behavior?

zaidrpm commented 4 years ago

can you try after disabling i3wm?

shenqizhi commented 4 years ago

@vspecky Do you have multiple monitors? If so, does this happens on all monitors? Also would it possible to record your screen and demo this buggy behavior?

Hi, mmahmoudian This is a best tool I've ever used in linux. But I had the same issue as vspecky's. I used Manjaro(XFEC) too and had just one monitor. There is not frame when I captured, but it can work when I press the "Enter" keys. Here is the issue detail: image

It was strange that I can capture the frame when I used the screen record tool, here is the git: Peek 2020-10-07 13-46

So, could you help to fix this issue? Also, It's better if there is a shortcut key for "Pin Tool"

shenqizhi commented 4 years ago

@mmahmoudian

mmahmoudian commented 4 years ago

@shenqizhi I have no idea how this issue occurs. Which version of Flameshot do you use? if you are not using the latest version, try updating or using AppImage (as explained here)

shenqizhi commented 4 years ago

@mmahmoudian Issue same when I used the latest AppImage version. I can see the logs in the terminal:

QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setCompositionMode: Painter not active
QPainter::translate: Painter not active
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::setBrush: Painter not active

Could you give me some advises? Many thanks

mmahmoudian commented 4 years ago

@borgmanJeremy do you know what can be the issue based on these?

borgmanJeremy commented 4 years ago

@mmahmoudian No I am unable to replicate it in any of my VM's. My gut says its a gpu rendering issue, which would explain why its not reproducable in a VM. Are you able to replicate it?

mmahmoudian commented 4 years ago

@borgmanJeremy I cannot reproduce this in KDE or DWM (these are the only things I have on my machine).

This is what I get:

❯  ./Flameshot-0.8.4.x86_64.AppImage
Run experimental self-contained bundle
Fontconfig warning: "/etc/fonts/conf.avail/05-reset-dirs-sample.conf", line 6: unknown element "reset-dirs"
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setCompositionMode: Painter not active
QPainter::translate: Painter not active
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::setBrush: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setCompositionMode: Painter not active
QPainter::translate: Painter not active
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::setBrush: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setCompositionMode: Painter not active
QPainter::translate: Painter not active
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::setBrush: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setCompositionMode: Painter not active
QPainter::translate: Painter not active
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::setBrush: Painter not active
qt.svg: Cannot open file ':img/app/flameshot.svg', because: No such file or directory
qt.svg: Cannot open file ':img/app/flameshot.svg', because: No such file or directory

I have three monitors, the primary is using intel integrated GPU and the other two are connected to an Nvidia card and Flameshot AppImage v0.8.4 works fine on all three of them.

Also how can it be GPU related when it worked fine while he is capturing his screen? This is a very interesting situation indeed.

@shenqizhi is your computer a laptop? also can you tell us your XFCE version

shenqizhi commented 4 years ago

@mmahmoudian Thanks for your test.

I'm using a Dell OptiPlex 3050 Desktop, not laptop.

xfce4-about -V
xfce4-about 4.14.1 (Xfce 4.14)
hxss commented 3 years ago

same problem on xfce 4.14.1. Selection is invisible in ~30-40% of uses.

But it can be rendered after this algorithm:

  1. select area(invisible selection, only cursor changes)
  2. alt+tab(no visible changes, but windows toggles in bg)
  3. resize selection(aim by cursor changes) <-- now selection is visible
  4. because of alt+tab used, flameshot no longer responds to shortcuts(ctrl+c, ctrl+s, ctrl+z), only button can be used.

I run flameshot by xfce shortcut flameshot gui -p /home/hxss/downloads Also when I try to screencast the bug, I saw selection on video. Its Intel core m5 with HD Graphics 515 integrated.

mmahmoudian commented 3 years ago

@hxss when you use the command line, do you get any error/warning? can you post here the terminal out of Flameshot when this issue occurs.

hxss commented 3 years ago

@mmahmoudian no, flameshot outputs nothing. Is there exist debug/verbose flag? Maybe logs?

mmahmoudian commented 3 years ago

@hxss well, we don't have such mode yet, but as you might know, Flameshot uses a DBUS system. So do the following:

  1. close any open Flameshot (e.g pkill flameshot)
  2. open two terminals
  3. on first terminal type flameshot and keep the terminal open (this will have some output)
  4. on the second terminal type flameshot gui, do what ever you do to take a screenshot
  5. copy-paste the output from the first terminal in this thread

image

hxss commented 3 years ago

same output in both cases:

// normal behavior
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setCompositionMode: Painter not active
QPainter::translate: Painter not active
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::setBrush: Painter not active

// invisible selection + alt+tab
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setCompositionMode: Painter not active
QPainter::translate: Painter not active
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::setBrush: Painter not active

Just in case black background is always visible.

Flameshot v0.8.4
Compiled with Qt 5.15.1

Config:

[General]
buttons=@Variant(\0\0\0\x7f\0\0\0\vQList<int>\0\0\0\0\x11\0\0\0\0\0\0\0\x1\0\0\0\x2\0\0\0\x3\0\0\0\x4\0\0\0\x5\0\0\0\x6\0\0\0\x12\0\0\0\xf\0\0\0\x13\0\0\0\b\0\0\0\t\0\0\0\x10\0\0\0\n\0\0\0\v\0\0\0\f\0\0\0\x11)
contrastUiColor=#0088cc
disabledTrayIcon=true
drawColor=#ff0000
drawThickness=0
saveAfterCopyPath=/home/hxss/downloads
showDesktopNotification=true
showHelp=false
showSidePanelButton=false
uiColor=#005596
shenqizhi commented 3 years ago

@mmahmoudian , Is there any update?

mmahmoudian commented 3 years ago

@shenqizhi no, because we cannot reproduce this issue. Perhaps @borgmanJeremy or @ZetaoYang might have an idea.

ghost commented 3 years ago

Same issue here. My system information:

flameshot --version
Flameshot v0.8.5
Compiled with Qt 5.15.1

loginctl show-session $(loginctl show-user $(whoami) -p Display --value) -p Type --value
x11

xrandr --listactivemonitors
Monitors: 1
 0: +*eDP1 1920/310x1080/170+0+0  eDP1

lspci | grep -i 'vga\|3d\|2d'
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (Whiskey Lake) (rev 02)

sudo lshw -class display
  *-display                 
       description: VGA compatible controller
       product: UHD Graphics 620 (Whiskey Lake)
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 02
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:134 memory:a0000000-a0ffffff memory:90000000-9fffffff ioport:3000(size=64) memory:c0000-dffff

uname -a
Linux MyComputer 5.10.7-arch1-1 #1 SMP PREEMPT Wed, 13 Jan 2021 12:02:01 +0000 x86_64 GNU/Linux

echo $XDG_CURRENT_DESKTOP
XFCE

xfce4-panel --version
xfce4-panel 4.16.0 (Xfce 4.16)

Edit: I solved by deleting the intel driver!

tsarquis88 commented 3 years ago

Same issue here. I've tried building from sources and with pacman, with no solution though.

OS: Arch Kernel: 5.10.15-arch1-1 DE: XFCE4

Flameshot v0.9.0 compiled with Qt 5.15.2

@mano1404 I've the same Intel controllers... what exactly did you do for fixing this?

EDIT: After rebooting, the problem seems to be disappeared

ghost commented 3 years ago

@mano1404 I've the same Intel controllers... what exactly did you do for fixing this?

I removed xf86-video-intel package and reconfigured Xorg to only use Mesa driver.

fdmarcin commented 3 years ago

This happens to me too ~50% of the time. What's weird is that when recorded, it looks normal.

Here I was only able to see the selection the last time I did out of the four times:

https://user-images.githubusercontent.com/25668969/111010274-5176b800-8396-11eb-8e51-bb7c7be461ec.mp4

OS: Manjaro Kernel: 5.11.2-1-MANJARO DE: XFCE 4.16 Flameshot: 0.9.0

Flameshot config ```ini [General] contrastOpacity=188 disabledTrayIcon=false drawColor=#db4954 drawThickness=3 saveAfterCopyPath=/home/marcin/Pictures savePath=/home/marcin/dev/gitlab/gitlab/doc/ci/test_cases/img savePathFixed=false showStartupLaunchMessage=true startupLaunch=true [Shortcuts] TYPE_ARROW=A TYPE_CIRCLE=C TYPE_CIRCLECOUNT= TYPE_COMMIT_CURRENT_TOOL=Ctrl+Return TYPE_COPY=Return TYPE_DRAWER=D TYPE_EXIT=Ctrl+Q TYPE_IMAGEUPLOADER= TYPE_MARKER=M TYPE_MOVESELECTION=Ctrl+M TYPE_MOVE_DOWN=Down TYPE_MOVE_LEFT=Left TYPE_MOVE_RIGHT=Right TYPE_MOVE_UP=Up TYPE_OPEN_APP=Ctrl+O TYPE_PENCIL=P TYPE_PIN= TYPE_PIXELATE=B TYPE_RECTANGLE=R TYPE_REDO=Ctrl+Shift+Z TYPE_RESIZE_DOWN=Shift+Down TYPE_RESIZE_LEFT=Shift+Left TYPE_RESIZE_RIGHT=Shift+Right TYPE_RESIZE_UP=Shift+Up TYPE_SAVE=Ctrl+S TYPE_SELECTION=S TYPE_SELECTIONINDICATOR= TYPE_SELECT_ALL=Ctrl+A TYPE_TEXT=T TYPE_TOGGLE_PANEL=Space TYPE_UNDO=Ctrl+Z ```

flameshot output following https://github.com/flameshot-org/flameshot/issues/894#issuecomment-709355698:

$ flameshot                    
QSettings::value: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setCompositionMode: Painter not active
QPainter::translate: Painter not active
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::setBrush: Painter not active
alex88 commented 3 years ago

Same here using xmonad and only happens when copying to clipboard, works just fine when saving to file

Update: nvm my issue was https://github.com/flameshot-org/flameshot/issues/1179