(I copied this trick from https://stackoverflow.com/a/57272592/1739415)
The GitHub clang-format workflow was already ignoring the `external`
directory because of the setting in the `clang-format.yml` file, but
that doesn't help other people running `clang-format` by hand (which the
CONTRIBUTING.md file instructs developers to do). Without this change,
I'd see a bunch of changes appear in the `external/spdlog` every time I
ran clang-format by hand.
I figure it's better to configure this via files that clang knows about
so both the GitHub workflow *and* developers have a closer to identical
experience.
The call to `resize` is pretty important... without it, nothing shows up
on the screen when I run flameshot (presumably because it's 0 pixels by
0 pixels large). This was accidentally removed when resolving merge
conflicts in 77c509e798.
While I was in here, I also opted to delete some comments. I personally
am never a fan of commenting out code: if we need something, that's what
Git is for! And, just in case GitHub disappears, I thought it would be
nice to record my research in a Git commit about why I think removing
`Qt::BypassWindowManagerHint` is ok. Comments copied from
https://github.com/flameshot-org/flameshot/pull/731):
> I played around with it [removing `Qt::BypassWindowManagerHint`] a bit
> and it has some really nice properties for me as a Xmonad X11 user:
>
> - It resolves https://github.com/flameshot-org/flameshot/issues/784
> - It also makes it possible for me to clearly see when flameshot has
> focus, and give it focus, which I'd argue is a workaround/fix for
> https://github.com/flameshot-org/flameshot/issues/1072, and also has
> some nice properties as @filipkilibarda mentioned: "Allows the user to
> switch workspaces while in the screenshot GUI..."
>
> I did some git spelunking and here's the history of the current code:
>
> - c4d9210c35 is the first commit where
> something like this showed up, but it used
> `Qt::X11BypassWindowManagerHint`, which is just [an alias for
> `Qt::BypassWindowManagerHint`](b75d60abd2/src/corelib/global/qnamespace.h (L247))
> - 0f30529c77 removed it (yay!)
> - 11b0e2db4b added in
> `Qt::BypassWindowManagerHint` with somewhat cryptic message: "Capture
> window showing when mouse events are holded" message. I'm not sure what
> that means.
> - Later, this commit a9b0c21304 added a
> `#ifdef Q_OS_WIN` branch that made it so this
> `Qt::BypassWindowManagerHint` only happens on Linux, not Windows.
>
> So, since flameshot doesn't currently target OSX, I think this change
> only affects Linux. @borgmanJeremy if I did some investigation into how
> this behaves with other window managers (and maybe wayland?) would you
> be open to merging it up?
> https://github.com/flameshot-org/flameshot/pull/731#issuecomment-719767364
> for more information.
Later, I investigated how things behave on Linux with a non-tiling
window manager:
> I just installed xfce and tried this out, and as far as I can tell,
> things work great! During a screenshot, I can alt-tab to other windows
> and they end up on top of the ongoing screenshot, but I can click back
> on the screenshot to continue editing the screenshot (strangely, I
> cannot alt-tab back to the window). Keyboard shortcuts work as expected,
> and this feels like an improvement in every way, IMO.
* Move calls to update outside of each input case
* Remove redundant checks when moving selection
* Handle selection clipping the same for each mode
* Fix typo in SelectionWidget enum
* Obligatory "I forgot to clang-format" commit