bitmap-printer icon indicating copy to clipboard operation
bitmap-printer copied to clipboard

Bitmap Printer can get killed (+ how to fix it)

Open andiandi13 opened this issue 3 years ago • 1 comments

I noticed that bitmap printer was sometimes replaced by the native screenshot notification. Most of the time it meant that it was deactivated - or killed. When I reboot it works again obviously.

After doing tests I found out that it was due to fast captures without waiting a delay (I think 3 sec as you mentioned). The issue is that it can happen by accident when we want to take a precise action, whatever.

Also note that system screenshot notification doesn't always mean BP has been killed. If you stop screenshoting as soon as you see the notification, it look like you can still use it. But if you press to frequently the button, it's over.

How do I fix it without having to reboot :

When this bug occurs (bitmap printer not being called anymore) there's a tmp.bmp file, which is the last screenshot before the bug. If you delete this picture, it works again.

  1. So if you can fix this, it'd be very nice.

  2. Also, I wonder if it's possible to improve delay between screenshots. I know .BMP file has to be saved but what would happen if you set 500ms delay ? It'd lag ?

andiandi13 avatar Jul 25 '22 23:07 andiandi13

The time it takes to store the bitmaps is mostly determined by how much memory I allocate. If you increate this variable it should save significantly faster. https://github.com/HookedBehemoth/bitmap-printer/blob/5a15742c1c2fd2c1aab43f4c7d4d629a0716b55b/source/main.cpp#L92

It should evenly divide 720 but that is statically asserted.

I could imagine the issue with it being "killed" is that we don't respond to the event in time and vi ends up taking precidence. I have no idea how I would detect that though.

HookedBehemoth avatar Jun 16 '23 09:06 HookedBehemoth