Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: workaround macos fullscreen animation #3625

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

paperclover
Copy link

@paperclover paperclover commented Jun 5, 2024

edit: do not think this is viable due to #2886 (comment)

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).

This seems to be introduced in macOS 11 or 12, where the API that
showFullScreen plays an animation. The downside of this approach is the
system menu bar is still visible while taking a screenshot, as the
window is no longer actually fullscreen, just borderless covering the
screen.
@mmahmoudian
Copy link
Member

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

@Untersander
Copy link

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.

@ElijahLynn
Copy link

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.

@mmahmoudian mmahmoudian added Waiting For Info Addressing the issue or merging the PR is halted and we are waiting for more info to be provided. Needs Decision This is something that should be discussed by community MacOS MacOS related labels Jun 24, 2024
@paperclover
Copy link
Author

from #2886 (comment), it seems this approach is not going to be viable at all. we'll need a different technique. not sure what though.

@jackielii
Copy link

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.

@paperclover
Copy link
Author

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 paperclover marked this pull request as draft July 10, 2024 21:07
@paperclover
Copy link
Author

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

@ElijahLynn
Copy link

ElijahLynn commented Jul 17, 2024

@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 #2886.

@chrismessina
Copy link

@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.

@ElijahLynn
Copy link

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!

@dfredell
Copy link

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.

@paperclover
Copy link
Author

paperclover commented Oct 17, 2024

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.

@mmahmoudian
Copy link
Member

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.

@icaroscherma
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MacOS MacOS related Needs Decision This is something that should be discussed by community Waiting For Info Addressing the issue or merging the PR is halted and we are waiting for more info to be provided.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Active desktop switches to Desktop 1 after saving/copying a screenshot on MacOS
8 participants