flameshot icon indicating copy to clipboard operation
flameshot copied to clipboard

fix: workaround macos fullscreen animation

Open paperclover opened this issue 1 year ago • 13 comments

edit: do not think this is viable due to https://github.com/flameshot-org/flameshot/issues/2886#issuecomment-2205197790

This would resolve #2886 at the cost of the system menu bar not being able to be visible as part of the capture window.

image

If there is something available in QT to put the window above the menu bar or disable the animation, we should use that instead. I couldn't find an API to do that though -- I feel like i0t has to be possible somehow, since the built-in screenshot command does not have this issue, and System Settings is able to draw overlays that are placed on top of the menu bar (if you have multiple monitors and re-arrange them, a red border surrounds the screen); Maybe this API is reserved for the system apps?

For now, I find this trade off reasonable as the fullscreen exit animation as shown in the issue is incredibly annoying, and most screenshots do not need to annotate the menu bar (you can still screenshot it, but the system bar is in the way for annotations).

paperclover avatar Jun 05 '24 07:06 paperclover

Do I understand it correctly that this PR makes Flameshot to be a "maximized" window but not a full-screen one?

mmahmoudian avatar Jun 06 '24 10:06 mmahmoudian

I believe this would also fix the issue from #2612 as not capturing the menu bar, for me it would be worth to lose the feature to capture the menu bar but if anybody has a solution how this could be fixed without losing this feature would be nice.

Untersander avatar Jun 11 '24 18:06 Untersander

Thanks for the initiative!

I would like to suggestions from the community on what other OSS screenshot tooling is there that does this correctly? Maybe then we could see what API or techniques they use.

ElijahLynn avatar Jun 12 '24 00:06 ElijahLynn

from https://github.com/flameshot-org/flameshot/issues/2886#issuecomment-2205197790, it seems this approach is not going to be viable at all. we'll need a different technique. not sure what though.

paperclover avatar Jul 09 '24 23:07 paperclover

I tried this patch, it doesn't work in my case. I can't see any window: as soon as I activate capture, the applications disappear.

jackielii avatar Jul 10 '24 09:07 jackielii

I tried this patch, it doesn't work in my case. I can't see any window: as soon as I activate capture, the applications disappear.

flameshot or the program executing flameshot doesn't have screen capture permissions. not a bug with this patch since i ran into this while building and running master.

paperclover avatar Jul 10 '24 21:07 paperclover

just tried cleanshot and they are currently the only tool other than the built in one that ive seen that doesnt have this issue.

so it's possible. just no idea how. might have to use more direct system apis to do this

paperclover avatar Jul 10 '24 21:07 paperclover

@chrismessina is the creator of Cleanshot, not sure he would be willing to help us since but mentioning him just in case he is! Chris, would you be up for sharing how you implemented screenshotting a fullscreen desktop so that it keeps you on the desktop? Was it just a standard API call, or did you have to do something hacky?

Here is the original report https://github.com/flameshot-org/flameshot/issues/2886.

ElijahLynn avatar Jul 17 '24 23:07 ElijahLynn

@chrismessina is the creator of Cleanshot, not sure he would be willing to help us since but mentioning him just in case he is! Chris, would you be up for sharing how you implemented screenshotting a fullscreen desktop so that it keeps you on the desktop? Was it just a standard API call, or did you have to do something hacky?

Hey @ElijahLynn — I'm an avid user of Cleanshot, but certainly not its creator!

You'll want to contact Luke or Paul from MakeTheWeb.

Here's their URL scheme docs, in case they're useful.

chrismessina avatar Jul 20 '24 21:07 chrismessina

Hey @ElijahLynn — I'm an avid user of Cleanshot, but certainly not its creator!

DOH! Wonder how I arrived at that conclusion. Thanks for pointing out who to contact!

ElijahLynn avatar Jul 25 '24 18:07 ElijahLynn

Thank you @paperdave I just switched from Linux to Mac. In the GA mac version the desktop flipping after the capture was complete was annoying. This MR solved that for me. Thanks.

dfredell avatar Jul 30 '24 18:07 dfredell

might have to use more direct system apis to do this

random conversation with the creator of ghostty (terminal application) led me to see that its "Quick terminal" feature was able to paint above the menu bar and on multiple screens.

the code is currently private but that feature is implemented in Swift (couple hundred lines of code). so the proper version of this fix would require some swift code to be added to the build system, but in return it would become the best free screenshot tool for the Mac.

posting this to remind myself to take a closer look at this later this week.

paperclover avatar Oct 17 '24 00:10 paperclover

Then we need some help from community to help us with swift. As far as I know, none of the devs are mac yser and none of them are swift developrs.

mmahmoudian avatar Oct 20 '24 07:10 mmahmoudian

I don't mind not being able to screenshot the menubar if I get the Desktop Switching fix.

As it's a compromise-able change and we could find people wanting either of the "sides", I think a toggle switch on the settings, maybe requiring it to restart the App when changed might be a feasible option.

I really like the idea of staying with the same app regardless of the OS as most of the shortcuts are now pretty much muscle memory to me.

icaroscherma avatar Dec 18 '24 23:12 icaroscherma