ksnip / ksnip

ksnip the cross-platform screenshot and annotation tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Delay comes before rectangle selection mode

paul1149 opened this issue · comments

My problem is essentially covered in this bug report:

#853

When I have a delay set on the toolbar, the delay happens before the ability to select a rectangle, not after. The solution given in that thread is to uncheck the option "Snipping Area / Freeze image while snipping." I'm on MX Linux 23 (Debian 12), where this setting is supposed to make the desired difference. (I'm also on ksnip 1.10.1)

I've unchecked that setting, and still the delay comes before area selection mode.

I don't understand why this setting would be tied to the delay, but in any case, I would like to get the delay after rectangle selection, so I can get context menus into the screenshot.

Thanks.

There are two ways to take a screenshot:

  1. Take a fullscreen screenshot of your desktop and make it the background of your application, allow the user to basically select a region of an image.
  2. Make the background of your application transparent, let the user select a region, take a fullscreen screenshot and cut out the region.

Most screenshot application support only the first option, ksnip supports both and you can switch between them via the "Snipping Area / Freeze image while snipping." option, when checked you get option "1", when unchecked, you get option "2". The delay here is related to the moment when the screenshot is taking, either before or after.

I don't know what setup you have but I know that with Wayland option "2" is not supported, that could be the reason why you don't see a difference.

I just checked again with today's fresh reboot. Option is not checked, there is no delay after selecting rectangle. I don't use Wayland:

  Kernel: 6.1.0-13-amd64 [6.1.55-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-13-amd64 root=UUID=<filter> ro quiet splash
    init=/lib/systemd/systemd
  Desktop: KDE Plasma v: 5.27.5 wm: kwin_x11 vt: 7 dm: SDDM Distro: MX-23.2_KDE_x64 Libretto
    October 15 2023 base: Debian GNU/Linux 12 (bookworm)

Just tested on my Windows build and I get the delay.

What output do you get when you run this in console echo $XDG_SESSION_TYPE ?

Also, did you restart ksnip after cheking the Snipping Area / Freeze image while snipping. option? IIRC this option only takes effect after ksnip restart.

I get x11 in terminal.

That option is unchecked, not checked. It had been checked until one day ago. I don't recall if I cycled ksnip at that time, but I think I did. And IAC I booted down last night and back up today, and I checked and the setting is still disabled.

Can you enable debug in config and then restart ksnip and share the output that you get in the console?

I think I've located the problem. First, here's the terminal after enabling Debug:

$ ksnip
Debug: SingleInstance mode detected, we are the server.
Debug: X11ImageGrabber selected.
Debug: Loading translation for ksnip from /usr/share/ksnip/translations, failed.
Debug: Loading translation for ksnip from /usr/bin//usr/share/ksnip/translations, failed.
Debug: Loading translation for ksnip from /usr/bin/../../usr/share/ksnip/translations, failed.
Debug: Loading translation for ksnip from /usr/bin/../usr/share/ksnip/translations, failed.
Warning: Unable to find any translation files for ksnip.
Debug: Loading translation for kImageAnnotator from /usr/share/kImageAnnotator/translations, failed.
Debug: Loading translation for kImageAnnotator from /usr/bin//usr/share/kImageAnnotator/translations, failed.
Debug: Loading translation for kImageAnnotator from /usr/bin/../../usr/share/kImageAnnotator/translations, failed.
Debug: Loading translation for kImageAnnotator from /usr/bin/../usr/share/kImageAnnotator/translations, failed.
Warning: Unable to find any translation files for kImageAnnotator.

It's taking a good 20sec to load, perhaps due to searching for translations?

Here's what I found. During these test, the delay actually began working, but very inconsistently. I began to try numerous combinations in order to isolate the problem. Was debug mode involved? Calling it via terminal? Initiating a screenshot from within the GUI vs. via hotkey?

I began to suspect the way I was calling ksnip, which is via the PrintScreen key.

I opened KDE's options, to find there was no global hotkey set there for ksnip. Ok, then I opened ksnip's options, to find there was none set for the rectangle. So somehow ksnip was opening up for a rectangle without a shortcut for that being specified. So I set PrintScreen as a formal hotkey in ksnip's options, and now it's worked reliably four times in a row.

So I think the problem is solved! I'll get back if it raises its head again, but until then, thanks very much for your help.

EDIT: I also had two listings for Flameshot in the KDE hotkey options. They were enabled, but no hotkeys for them were specified (Flameshot used to own the PrintScreen key before I uninstalled it.). I disabled them for insurance sake. Normally I wouldn't mention that, but something weird was going on here with unspecified hotkeys.

Please see update to comment.

Thank you for providing this information and glad to hear that it's working for you now.