Bug 469762

Summary: Give us a way to configure if the destination opens or not after creating an archive via "Compress to..." option from the context menus
Product: [Applications] ark Reporter: Patrick Silva <bugseforuns>
Component: pluginsAssignee: Elvis Angelaccio <elvis.angelaccio>
Status: CONFIRMED ---    
Severity: wishlist CC: aacid, butirsky, code, jlp, kde, rthomsen6
Priority: NOR    
Version: 23.04.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=440663
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Patrick Silva 2023-05-14 18:35:57 UTC
SUMMARY
In Ark settings there is an option used to open or not the destination after an extraction.
However, currently Ark always opens the destination after creating an archive via "Compress to..." option from the context menus and there is no option to change this behavior.

STEPS TO REPRODUCE
1.  right-click on a file in Dolphin, hover over "Compress" and choose "Compress to..."
2. choose a destination that is not open in Dolphin
3. click on "OK" button

OBSERVED RESULT
when the compression finishes, the destination opens in a new tab/window

EXPECTED RESULT
the behavior after creating an archive should be configurable

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9
Graphics Platform: Wayland
Comment 1 Andrey 2023-05-14 18:39:31 UTC
I suggest maybe we could combine these two options in the current one and just rename it instead of adding a new one.
Comment 2 Luke Horwell 2024-01-24 00:17:55 UTC
This "bug" still bites (23.08.4). Sometimes I use the compress menu to create archives, but don't expect Dolphin to steal focus(!) after the archive finished being created minutes later. The notification is good on its own since it allows to open the containing folder if desired. Having Dolphin honour Ark's "Open destination folder after extraction" will greatly help.

Another way to reproduce (on X11) is to compress a large file and switch to another application.
- Expected: Only the notification is shown when compression finished.
- Observed: Dolphin pops up (even if it was on another virtual desktop) and steals focus of the active app. Hopefully the DELETE key isn't being pressed at the time :)
Comment 3 Luke Horwell 2024-04-04 22:08:11 UTC
With the latest Plasma 6 and Ark/Dolphin 24.02.1, here's what happens when starting a long-running compression via context menu:

* Dolphin process that started the compression is closed: No dolphin window opens on completion. [Good]
* Dolphin process that started the compression stays open: That window steals focus back on completion. [Bad]
* Dolphin process that started the compression navigated to a different folder: New window opens on completion, stealing focus. [Bad]

Under X11 at least, I haven't checked if this is the same behaviour under Wayland. I have "Keep a single Dolphin window, opening new folders in tabs" unchecked in Dolphin's settings if that's related.

For now, until a configuration option is present, I'll rebuild the ark package locally but revert changes in:
https://invent.kde.org/utilities/ark/-/commit/2c847f76778a797964e189bb17ce774e56005f57

In particular, by removing this line in app/compressfileitemaction.cpp:

    KIO::highlightInFileManager({QUrl::fromLocalFile(addToArchiveJob->fileName())});