Bug 156822 - Prevent CALC from taking focus from another active app when loading files from the taskbar Jump List
Summary: Prevent CALC from taking focus from another active app when loading files fro...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: All Windows (All)
: medium minor
Assignee: Not Assigned
URL: https://ask.libreoffice.org/t/prevent...
Depends on:
Reported: 2023-08-20 07:04 UTC by Colin
Modified: 2023-08-21 09:06 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Colin 2023-08-20 07:04:32 UTC
If something inspires me to open a CALC file from the taskbar jump list, CALC then presumes I want all my following data entered into the last active cell in CALC. Invariably it's a contravention of the cell format.

Apparently writer gets it "write" and leaves focus with the active app.

Thank the gods of perpetual chaos for undo - ensuring it’s never fatal, just annoying.

Steps to Reproduce:
Have two monitors with the desktop extended over both monitors and the taskbar active on both monitors.

Ensure the last time you used CALC it was "parked" on the second monitor.

Be active in any other data entry application on the primary monitor.

Mouse-Click any stored calc file from the windows taskbar jump list for Calc.

As you're not a "touch typist" look at the keyboard - not the screen - while you're typing (often quite critical thoughts) into the application YOU had in focus before activating the CALC.

Finish the immediate task and then look at the application you're working with.

Eventually identify that everything you thought you had achieved just went into a Calc cell (or cells) - invariably offending the cell format and associated data limitations.

Practice using the "undo" rotor.

Go back to the active application and do it all again.

Actual Results:
Data entered into the wrong application

Expected Results:
Data in the right application and CALC waiting patiently for ME to focus IT

Reproducible: Always

User Profile Reset: No

Additional Info:
Version: (x64) / LibreOffice Community
Build ID: 723314e595e8007d3cf785c16538505a1c878ca5
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: sv-SE (en_GB); UI: en-GB
Calc: threaded
Comment 1 Mike Kaganski 2023-08-21 08:21:11 UTC
This is not a bug.

In Windows (which is this bug is filed about), and I believe in other OSes, there is a *system* policy about the *expected* result of launching a new process. Namely, it is *expected* that when user explicitly starts a new process, it opens the window, and that window is in the foreground, ready for input.

Indeed, when a process takes very long (more than a few seconds), it is OK to assume that the user might want to return to other things they do, and then the newly launched process should not steal focus.

This exact protocol is followed by LibreOffice, based on the huge demand - see the See Also bug 48300, bug 49134, bug 75471, bug 114466.

Note that, as mentioned in https://ask.libreoffice.org/t/preventing-lo-calc-from-taking-focus-from-active-apps-on-loading/94812/ (which is the origin of this report), that the real time span reported there is 2-3 seconds, so agrees with the times typically granted by system for program launch.

And there is a LibreOffice-specific ForceFocusAndToFront expect configuration to prevent stealing the focus - please try to use it and see if it suits your needs.