Bug 155043

Summary: In Gnome Shell, nothing happens when double clicking to launch a LibreOffice document in Files if the file is already open
Product: LibreOffice Reporter: fmgtack+libreoffice
Component: LibreOfficeAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: abe-bugs-odf01, andrew, caolan.mcnamara, mikekaganski, stephane.guillou
Priority: medium Keywords: bibisected, bisected, regression
Version: 7.5.0.0 beta1+   
Hardware: All   
OS: Linux (All)   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=150773
https://bugs.documentfoundation.org/show_bug.cgi?id=160933
Whiteboard: target:24.8.0
Crash report or crash signature: Regression By: Mike Kaganski
Bug Depends on:    
Bug Blocks: 103303    

Description fmgtack+libreoffice 2023-04-27 08:57:34 UTC
Description:
When double-clicking a LibreOffice document in Files to launch it, nothing happens if the file is already open. (Files application remains in front with the file selected. No notification appears neither is the LO document window brought to the front).

I filed the issue to Gnome: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6640#note_1732309 They closed the issue: "There is no xdg_activation request coming from LibreOffice (or any Wayland request that matter) when opening the file the second time. So that's a client side issue."

Steps to Reproduce:
On a Linux Gnome Shell desktop:

1. Open Files
2. Select an existing LibreOffice document (Text file, Writer document, ...). Hit Enter or double click. The document should open in an LO window.
3. Open another application maximized, for example a browser
4. Switch to Files, double click the same LibreOffice document.

Actual Results:
Nothing happens: the file manager remains in the front, with the file selected. Nothing else happened, i.e., there was no "Window is ready" notification (default behavior in Gnome Shell) nor was the open document brought to the front.

Expected Results:
Apparently, the software should send out a xdg_activation request, after which the desktop would (in the case of Gnome Desktop) issue a "Window is ready" notification or (in the case of a more sane default behavior) bring the document to the front.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.5.2.2 (X86_64)
Build ID: 50(Build:2)
CPU threads: 8; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

On Fedora 38
Comment 1 fmgtack+libreoffice 2023-04-27 12:32:29 UTC
I can add that

1) This also happens in a Gnome Shell session on Xorg, so it is not a Wayland issue
2) This also happens on an XFCE desktop, so it is not an issue with Gnome Shell (as the developper also suggested)
3) This also happens when opening the file on the terminal with

soffice <filename>

both under Gnome Shell and XFCE Desktop.
Comment 2 Stéphane Guillou (stragu) 2023-05-11 10:00:27 UTC
Thank you fmgtack!

Reproduced with:

Ubuntu 20.04 with GNOME 3.36.8
LO Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Tested with minimising the window before opening the file again:
- LO 6.1.0.3: window pops up
- LO 6.2.0.3 to 7.4.6.2: GNOME notification "LibreOffice is ready"
- LO 7.5.3.2: nothing -> regression

Bibisected with linux-64-7.5 repository to first bad commit cd2833d37048a91ad90deee69ea80e60d2a67e81 which points to core commit:

commit 42d197ef301db68e56f7e45b6e36ace5fae04b4d
author	Mike Kaganski <mike.kaganski@collabora.com>	Sun Sep 04 13:39:27 2022 +0300
committer	Mike Kaganski <mike.kaganski@collabora.com>	Sun Sep 04 19:44:49 2022 +0200
tdf#150773: Avoid bringing loading files to front several times
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139362

Mike, can you please have a look?
Comment 3 Mike Kaganski 2023-05-11 10:29:31 UTC
... but at the same time, it works as expected on Windows.

Caolan, do you know what is different here in the action sequence? Thanks!
Comment 4 Buovjaga 2023-07-07 13:08:27 UTC
*** Bug 155493 has been marked as a duplicate of this bug. ***
Comment 5 Buovjaga 2023-10-25 11:21:18 UTC
*** Bug 157710 has been marked as a duplicate of this bug. ***
Comment 6 Buovjaga 2023-10-26 14:24:54 UTC Comment hidden (obsolete)
Comment 7 Stéphane Guillou (stragu) 2024-05-29 07:02:51 UTC
Thanks for the reminder, Mike. I think e0b930e1ddf008d202c3620fdc6652483f914835 has also fixed this, like bug 160933. With a recent daily build, I get the GNOME dock's icon wiggle and the "is ready" notification.

Others can check with a recent daily build: https://dev-builds.libreoffice.org/daily/master/current.html