Preventing LO Calc from taking focus from active apps on loading

Hi there,

Version: 7.4.7.2 (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

I regularly select a CALC file from the taskbar jump list which may take 2 - 3 seconds to load. In the meantime, I continue working with the application I was using when I was inspired to open the Calc file.

As I’m no touch typist, I don’t always realise that Calc has snatched focus away from what I thought I was doing and my efforts end up in the wrong place, often in the wrong format.

Is there a manner in which Calc can be prevented from claiming focus from another app the moment it loads?

There doesn’t seem to be anything in the windows multitasking settings that could help alleviate the problem.

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

Thanks in advance for any suggestions which will be greatly appreciated.

Ja, verkligen … det är upprörande, Calc låter dig vänta i en halv evighet och stör sedan plötsligt ditt mycket viktiga arbete! Vilket ondskefullt program!

Calc does seem to take focus immediately, unlike Writer. You could:

  1. Post a bug report, How to Report Bugs in LibreOffice - The Document Foundation Wiki
  2. Start Calc when you start the computer so it stays in the background. Possibly Tools Options > LibreOffice > General and tick box Load LibreOffice during system start up will load Calc faster with less time to go back to previous application.
  3. Try a third party program with settings that might prevent a program from taking focus, search “Windows steal focus”

@Karolus Google mail couldn’t quite decide whether you were being flippant or facetious and popped it straight into the spam folder.
“Locale: sv-SE (en_GB); UI: en-GB” GB should provide a hint that I don’t speak “Troll” - I just live near Tomteland🤣

@TheRealWhiteKnight and your twin @WhiteKnight
What I wanted to tell you:
If you can’t wait 3 seconds for a program to start then you are the cause of the consequences.

@ Karolus I guess Mr.Google got it right - you were being facetious.
Clearly, your overwhelming desire to be contentious - or your belief that your perception of the English language exceeds reality - blinded you to the message.
It’s not a case of CALC taking 3 seconds to load - it’s the consequences of unknowingly entering data into an application I never authorised to accept the data and consequently corrupting not only the CALC but also the workflow and thought patterns.
Please feel free to offer your insights to another victim of your acerbic wit.

that’s funny…your your twinbuddy likes me!

@Karolus You’re misunderstanding the sentiment.
I don’t dislike you - I think your talents are being wasted on trying to defend the indefensible.
As your grandmother would undoubtedly advise “If you can’t say something nice about somebody - say nothing”.
Or did I mistake both versions of your male bonding comment for personal criticism?
Wait 30 minutes before responding - going into :shower:

@Karolus How come you can link to WhiteKnight and I can no longer gain access to it?

Anyone can link to a user name simply by using the @ prefix to the username. For instance @WhiteKnight creates a link. And no, I don’t know why you can’t get access to it.

You might consider asking the question in the Site Feedback category, with information on what happens when you try to log in.

Windows OS implements the following “steal focus” logic:

  1. Normally, windows of programs are not allowed to steal focus when user is interacting with some window (i.e., there’s some action in the recent some seconds - configurable using ForegroundLockTimeout registry setting), unless they are the windows of the already active process (i.e., the process already having user interaction/focus).
  2. Whenever an active process starts another process, it is treated as the direct request by the user, and thus, the newly spawned process gets a limited privilege to steal the focus - but only in a few seconds from the moment it’s created.
  3. The process that currently has privilege to steal focus may grant its privilege to another process (again, limited to the few seconds system limitation).

So - the end result is: when the system knows that a new process was launched by user, it assumes that the user wants to see this process’ window as soon as possible. But when the process takes long to start, the system changes its mind, and decides that it will not allow the process to steal focus.

The timeout is configurable (I don’t remember where exactly; definitely in registry, but possibly also in some UI); so this is where it is expected that the users’ preference is defined.

So - despite your claim that @karolus “tries to defend the indefensible”, they are actually perfectly correct - you see the system-defined correct behavior, which occur in accordance to the system settings. It is expected, that a few seconds is the time span where the user is waiting the results of their “launch it” action. If the user does not, it’s the user error to not configure the system to allow less time for the “expect a new process’ window”.

On the other hand, if LibreOffice somehow manages to steal the focus outside of the system-configured time span, then it would definitely be a bug - please feel free to file a bug report then, as @EarnestAl suggested, and don’t forget to leave a notice about that here, mentioning the bug number for the reference.

The code to follow this logic, and some comments explaining this (together with links to MS documentation), are in commit 8d1d82dd63eada8faa2f6eb43ef900764a5fda62.

And also: there is a ForceFocusAndToFront LibreOffice-specific (i.e., not OS-specific) setting - please check if setting it to false in expert configuration helps your issue. IIRC, even if we have the privilege to steal focus, we honor this setting.

3 Likes

@mikekaganski
" So - despite your claim that @karolus “tries to defend the indefensible”
I was pointing out the indefensibility of breaking the protocol of this site simply to insult me. I’m sure i read somewhere that it’s OK to be critical but not to make that a personal attack. Or would you both disagree?

@mikekaganski thanks! may you have also a look on 156822 – Prevent CALC from taking focus from another active app when loading files from the taskbar Jump List

@WhiteKnight I believe that you were over-reacting and taking it too personally - ignoring the real message (also pronounced in English), and only seeing a “personal attack”. I am myself tired of the habit of people reading personal attacks left and right, demanding some specific style of answers… so yes, I disagree with your reaction. Additionally, if you insist that people with different background e.g. of language, culture, etc. must use some specific protocol, then you rule out the input from the people who do not fit that protocol (inequality in action). Possibly better to require more tolerance when reading answers?

@mikekaganski
Try putting “Ja, verkligen … det är upprörande, Calc låter dig vänta i en halv evighet och stör sedan plötsligt ditt mycket viktiga arbete! Vilket ondskefullt program!” into Google Translate for English or Russian and explain to me how that - in any language - is deemed to be adhering to Ask LO’s site guidelines on respect.

As a joke? “2-3 seconds” → “waiting for half an eternity” … I myself sometimes use exaggerations to make my point clear.

@mikekaganski
As you enjoy exageration to clarify a point
Yes, really…1 it’s infuriating, 2 Calc keeps you waiting for half an eternity and then 3 suddenly interrupts your very important work! 4 What an evil program!
Is probably a bit like the difference between " 1 a special miltary operation" and then trying to 2 destroy an entire country whilst 3 threatening the rest of the planet with a nuclear escalation.
I partially agree with you. Perception is everything - perhaps you could exagerate my perception with your own favourite fourth presumption.

:joy: Of course! Modulo “my actions result in some problem” vs. “I write to you about someone else’s actions, as if you did them, just because you happen to live on that territory” … but again, no problem in that :wink: - I realize the people have all rights to be emotional about that topic, and it’s just human to expand their emotions to the whole nation. That’s just another reason why that (I mean war) must not happen … but I digress.

@mikekaganski You chose to write about somebody else’s response to me - that is to say you’re the third party which you somehow don’t appreciate is the same as me comparing an issue where I’m the third party. However, putting aside all the distractions, perhaps you could explain to me how either of @Karolus comments in any way furthered the resolution of my issue. Compare it with @earnestal comment which offered a sensible solution. I get that you’re buddies with @Karolus by your earlier utilisation of the prefered pronoun “They” so perhaps try a little more impartiality.

:slight_smile: Let me start with this. It is very interesting to read your comments here. Because it’s very interesting to learn how unexpected others’ reading of your words might be. Exactly because I do not even know who @karolus is (specifically I mean - I do not know how they identify themselves - of course, I know their many comments here and in the bug tracker, and I value their expertise) - and I always use that pronoun whenever I don’t have specific information. E.g., I would use “he” when writing about erAck (didn’t use @ to not ping unneedlessly), because I met and know him in person. So again, it’s interesting how my used pronoun could be read like that - I would also use it when talking to someone about you…

This is the Ask site. Answering why this happens is very important. @karolus didn’t use the Suggest a solution button, but used a comment. Everything is OK; they effectively wrote you that “it’s really a short timeout you are talking about - so it works as expected”. No, it did not tell you how to change it - but then again, it wasn’t an answer.