Double-clicking a text annotation took the edit pointer and turned on
edit mode before refreshing the layers panel. The refresh rebuilds the
layer list, which emits layerChanged; updateActiveLayer then pushes the
pending size change to the undo stack, and the redo replaces the stored
objects with copies. The editor was left pointing at the old object, so
the first edit was dropped when the user clicked outside.
Refresh the layers panel first and fetch the text tool again afterwards,
so the editor and its undo snapshot use the stored annotation.
Fixes#4062
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
QTextEdit only claims the common editing keys in ShortcutOverride, so
Ctrl+Backspace while typing in the text tool fired the capture widget's
TYPE_CANCEL shortcut (Ctrl+Backspace by default) and closed the text box
instead of deleting the previous word. Accept the word and line deletion
key sequences in TextWidget, as is already done for Escape.
Fixes#4783
Qt::WindowStaysOnTopHint maps to NSFloatingWindowLevel (8), which is
below the Dock (20) and the menu bar (24). Both were drawn over the
capture overlay, so the top and bottom of the screen could not be
selected and the tool buttons could end up hidden behind the Dock.
Set the overlay window level to NSMainMenuWindowLevel + 2, which is
still below pop-up menus so Qt menus remain visible.
Fixes#4097Fixes#4346Fixes#4825
The plain dropdown listed every translation at once and overflowed
off-screen. Made the combobox editable with a popup-filtering
QCompleter so typing narrows the list instead.
Switched the save handler from currentTextChanged to textActivated -
the former fires on every keystroke once the box is editable, which
was spamming the "must restart" dialog and saving whatever partial
text was typed; textActivated only fires on an actual selection.
Qt has no native pasteboard mapping for image/png or image/jpeg, so the
encoded bytes were only exposed as com.trolltech.anymime.*, and non-Qt
apps fell back to the much larger public.tiff.
Register a QUtiMimeConverter that maps image/png and image/jpeg to their
native UTIs, and add the encoded bytes before setImageData so apps prefer
them over the TIFF fallback.
Fixes#4953
The capture launcher filled the WxH+x+y inputs from the cached last
region only when its window was created. After a capture the launcher
is hidden rather than closed, so reopening it from the tray menu shows
the region from before the capture, not the one that was just taken.
Reload the cached region whenever Flameshot::captureTaken is emitted.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
ShowSaveFileDialog set the default suffix once from the configured
extension and never listened to QFileDialog::filterSelected. Picking
another image format in the file type dropdown therefore had no effect
on the saved file: a name typed without an extension still got the
configured suffix, and with a native dialog such as GTK's the extension
already present in the name was not swapped either, so it had to be
edited by hand.
Connect filterSelected, derive the suffix from the selected mime type
and make it the new default suffix. If the current name already ends in
one of the offered image formats, rename it to the new suffix as well;
the Qt widget dialog does that on its own, native dialogs do not.
Fixes#4708
* Removed the close on double click on pinned captures and moved it to shortcut which is configurable through config
* fix typo errors and address review comments
* Clang formatting
The compiled .qm files were never copied into Flameshot.app, and
translationsPaths() did not look inside the bundle, so the macOS build
always showed the English UI.
Mark the .qm files with MACOSX_PACKAGE_LOCATION so CMake copies them to
Contents/Resources/translations at build time (before the bundle is
signed), and search that directory first on macOS.
Fixes#4976Fixes#3684
Tool size was only written to the config file from onToolSizeSettled(),
whose sole caller was the lambda connected to NotifierBox::hidden. The
NotifierBox hides on a 600ms single-shot timer, so the size was saved
only if the capture outlived that timer.
Two consequences:
- Changing the size with the mouse wheel, a digit key or the
increase/decrease buttons and then completing the capture within 600ms
(e.g. by pressing Copy) discarded the change.
- Changing the size with the side panel slider or spinbox never saved it
at all. That path is connected to onToolSizeChanged() rather than
setToolSize(), so it never shows the notifier and never reached
onToolSizeSettled().
Move the write into onToolSizeChanged(), which every input path reaches,
and drop onToolSizeSettled(). This restores the persist-on-change
behaviour that predates the tool size refactor in 534f05b2 while keeping
that refactor's split between UI updates and configuration.
ConfigHandler::setToolSize() also has to accept CaptureTool::NONE. Its
final branch excluded it, so a write for a capture with no active tool
button silently did nothing, while ConfigHandler::toolSize() already
returns drawThickness() for NONE. Making the setter symmetric with the
getter is what fixes the side panel case, where no tool button need be
selected to move the slider.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The Windows build already has ASLR, high-entropy ASLR and DEP; CFG is the
one mitigation missing. Both flags are needed: /guard:cf instruments the
code, /GUARD:CF marks the image. Set at the top level so the vendored
add_subdirectory() targets get it too.
Signed-off-by: David Dashti <47575784+Dashtid@users.noreply.github.com>
USE_LAUNCHER_ABSOLUTE_PATH exists because the flameshot binary is not
always on PATH, and src/CMakeLists.txt substitutes @LAUNCHER_EXECUTABLE@
into the desktop entry so the main Exec points at the installed binary.
The three Desktop Action entries were left calling a bare "flameshot":
after an install into a prefix that is not on PATH, launching Flameshot
from the application menu works but its Configure, Take screenshot and
Open launcher actions do nothing.
Substitute the same value into the action Exec lines. With the option
off, as the AppImage build sets it, @LAUNCHER_EXECUTABLE@ expands to
"flameshot" and the generated file is unchanged.
The counter bubble is always drawn with a contrasting ring. An outer
ellipse is filled with the anti-contrast color and the pen strokes both
ellipses with the contrast color, so the ring reads as black either way:
on dark draw colors it comes from the outer ellipse's fill, and on light
ones from the pen. There was no way to turn it off.
Add a `drawCircleCounterOutline` option together with a checkbox in
Configuration > General. It defaults to true, so the existing appearance
is unchanged.
Closes#3580
Co-authored-by: Bekir Soylu <bso@apptec360.com>
configureTranslation loads the UI translation with QTranslator's locale
lookup, which for it_CH tries Internationalization_it_CH and
Internationalization_it. The Italian file is shipped as it_IT, so Swiss
Italian users get English and a "No Flameshot translation found"
warning. de_AT and de_CH miss de_DE the same way, sv_FI misses sv_SE.
When that lookup fails, look for any Internationalization_<lang>_*.qm in
the same directory and load the first one. The .ts files keep their
names since Weblate manages them.
Fixes#4921
* async-notification
The previous synchronous callWithArgumentList stalled the main thread for the QtDBus reply timeout (~25s) after every capture, freezing further captures until it returned. Probably related to Issue #2425.
* Fix missing closing curly brace
* clang-format
---------
Co-authored-by: Mehrad Mahmoudian <m.mahmoudian@gmail.com>
The GNOME clipboard workaround (keeping the capture window alive so
Wayland can serve clipboard data after the window closes) was gated
to GNOME only. COSMIC hits the exact same Wayland limitation but
never triggered the workaround, so copy-to-clipboard silently did
nothing on COSMIC. Extends the check to include COSMIC.
Also fixes a race in the workaround itself: it previously closed the
window on the first clipboard read of any kind, which could cut off
a paste consumer that probes available clipboard types before
issuing the real data fetch. It now closes only once the clipboard's
current data is no longer ours, and the safety-net timeout is raised
from 500ms to 30s, since COSMIC's compositor fetches clipboard data
lazily (on actual paste) rather than eagerly grabbing it like GNOME's
mutter does.
Verified on Pop!_OS 24.04 with COSMIC 1.0.0.
Pinning a capture on a display with 150% scaling produces a pin window
half again as large as the region that was selected. #4614 fixed the
position of that window for v14.0.0; this is the size.
A capture started from the tray icon is fine, because the tray lives in
the daemon and createPin() hands the pixmap straight to attachPin().
Any invocation that runs in its own process instead -- `flameshot gui`
from a shell, a desktop or AutoHotkey shortcut, D-Bus -- finds
FlameshotDaemon::instance() null and serializes the capture to the
daemon. QDataStream writes a QPixmap as a plain image, which carries no
device pixel ratio, so the daemon reconstructs a pixmap that claims a
ratio of 1. PinWidget then lays out device pixels as if they were
logical ones and the window comes out too large by the scale factor.
The built-in PrintScreen hook is not affected; it runs inside the daemon
and takes the in-process path.
Send the ratio next to the pixmap so the serialized path ends up with
the same pixmap the in-process path already gets. Both transports share
the reading half, since the D-Bus adapter and the KDSingleApplication
handler each deserialize the message themselves. A message from an older
flameshot has no ratio appended; the read runs past the end, the stream
reports it, and the pixmap keeps the ratio it already had.
Checked on Windows 11, 1024x768 screen, QT_SCALE_FACTOR=1.5, pinning a
400x300 region. The pin window measured 621x471 before and 422x321
after. The capture is 400x300 device pixels either way, so the pin
should be that plus the 7pt margin on each side, and the patched size
matches the 414x314 measured on an unscaled screen to within the scaled
margin. Unscaled displays measured 414x314 both before and after.