Bug 138206 - windows are unfocused when they open
Summary: windows are unfocused when they open
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.0.3.1 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-14 00:56 UTC by Scott
Modified: 2023-05-13 03:19 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
demonstrating focused and unfocused program windows (591.45 KB, image/png)
2021-08-13 16:29 UTC, Scott
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scott 2020-11-14 00:56:33 UTC
Description:
When I click to open a document in the file manager (Nautilus), usually the window that opens for the file is unfocused, even though it is on top of all other windows. So after it opens, if I use keyboard shortcuts such as Ctrl-F or Ctrl-V, these actions will happen in Nautilus, not in the LibreOffice document. 

Steps to Reproduce:
1. Click on a file icon in Nautilus.
2. Look at the window that opens for the file.
3. Try using a keyboard shortcut to work on the file.

Actual Results:
The newly opened window is unfocused.

Expected Results:
All other programs focus the window when opening a file.


Reproducible: Always


User Profile Reset: No



Additional Info:
The program/file window should be focused.

Version: 7.0.3.1
Build ID: 00(Build:1)
CPU threads: 8; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 1:7.0.3-0ubuntu0.20.04.1
Calc: threaded
(This is the current installed version, but I have seen this behavior for about three years, on four different computers and several versions of LibreOffice and Ubuntu.)
Reproducibility: It almost always happens when I open a file, so about 85% of the time (I mostly use Calc and Writer).
Comment 1 Eleonora Govallo 2021-08-13 10:19:06 UTC
Hello!
Could you please tell what you mean when you say "focused window" or maybe you can attach a screenshot? 

For now no repro in Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: ac0db5736a53a4887cebbacc59026cecb7c44c66
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: ru-RU (ru_RU.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-08-08_02:51:24
Calc: threaded
Comment 2 Scott 2021-08-13 16:29:42 UTC
Created attachment 174260 [details]
demonstrating focused and unfocused program windows
Comment 3 Scott 2021-08-13 16:37:12 UTC
Hi Eleanora,

Thank you for your message. When a window is "focused," that means that the program is currently selected in the OS. In Ubuntu Linux you can distinguish a focused window most easily by looking at the color of the X in its upper right corner. So in the screenshot I uploaded here, the Chrome window is focused and the LibreOffice window is unfocused, because I'm typing a note here in Chrome. 

Currently LibreOffice files are always unfocused when they open (unlike all other programs), and this is happening about 100% of the time except in the following cases: 1. It's the first LibreOffice file I've opened since booting up the computer.  2. The file has a password, in which case the password-entry dialog box is focused.

Thanks again.
Comment 4 Scott 2021-08-13 16:39:31 UTC
Currently I'm using LO version 7.1.5.2
Comment 5 Scott 2021-08-13 16:50:19 UTC
One other thing: I think my instructions for reproducing the problem where not clear enough. Here is a replacement:

Steps to Reproduce:
1. In the file browser (Nautilus) click on a LibreOffice file to open it.
2. Use the keyboard shortcut Ctrl-F to search for text, and specify a very common word, such as "the"

Actual Results:
Nothing happens in LibreOffice, but a search has happened in the file browser in the window behind it.

Expected Results:
You find the first instance of the word "the" in the LibreOffice file that you opened.
Comment 6 Eleonora Govallo 2021-08-13 18:04:41 UTC
Could you please clarify, are you using X11 or Wayland?
Please install version 7.3.0.0.alpha0+ and try to reproduce this bug.
Comment 7 Scott 2021-08-13 18:58:46 UTC
Hi Eleanora,

I just checked, and I see that my system is using X11.

I've uninstalled LibreOffice but now I can't find a place to download v7.3.0.0. I'm searching for the alpha versions but I don't see it anywhere online.
Comment 8 QA Administrators 2021-08-14 04:05:38 UTC Comment hidden (obsolete)
Comment 9 Eleonora Govallo 2021-08-14 15:16:05 UTC
You can download it by the link:
https://dev-builds.libreoffice.org/daily/master/current.html
Comment 10 Buovjaga 2022-05-12 10:32:40 UTC
Tested with LibreOffice 7.3.3 gtk3, Nautilus on Debian testing and I don't get the problem. Please re-test.

Set to NEEDINFO.
Change back to UNCONFIRMED, if the problem persists. Change to RESOLVED WORKSFORME, if the problem went away.
Comment 11 Scott 2022-05-18 16:13:39 UTC
Hi,

It's not recommended to updgrade LibreOffice to a version later than what's recommended for my verison of Ubuntu (still 20.04). But to stay safe, I upgraded with the PPA in a virtual machine. Then I tested it, and the problem still persists.
Comment 12 Buovjaga 2022-05-18 16:30:31 UTC
(In reply to Scott from comment #11)
> Hi,
> 
> It's not recommended to updgrade LibreOffice to a version later than what's
> recommended for my verison of Ubuntu (still 20.04). But to stay safe, I
> upgraded with the PPA in a virtual machine. Then I tested it, and the
> problem still persists.

Then it might be a problem with Ubuntu 20.04. You could report it to Ubuntu https://bugs.launchpad.net/ubuntu/+source/libreoffice/ or https://bugs.launchpad.net/ubuntu/+source/nautilus/
Comment 13 Scott 2022-05-18 16:41:53 UTC
Could it be a problem with Ubuntu if it only affects LibreOffice?

In the meantime I've found a workaround, which is to switch to focusing windows whenever I hover over them.
Comment 14 Buovjaga 2022-05-18 17:03:08 UTC
(In reply to Scott from comment #13)
> Could it be a problem with Ubuntu if it only affects LibreOffice?
> 
> In the meantime I've found a workaround, which is to switch to focusing
> windows whenever I hover over them.

Note that it does not affect the latest unstable Debian and Ubuntu is based on Debian.
Comment 15 fmgtack+libreoffice 2023-05-09 11:07:16 UTC
I cannot reproduce the issue in Ubuntu 22.04. The issue probably is related to how Gnome manages window focus (the dreaded "Your window is ready" notification). With an extension that gives new windows focus, (and in Ubuntu through the Ubuntu dock (fork of Dash to dock) extension) I never experienced the issue of focus not being transferred.
Comment 16 Buovjaga 2023-05-09 11:56:43 UTC
Let's put to needinfo while we wait for an update from Scott on Ubuntu 22.04 or even 23.04.
Comment 17 Scott 2023-05-13 02:09:19 UTC
Hi all,

The issue has not changed. I'm still using Ubuntu 20.04. The problem remained after my last reinstallation in the fall of 2021. I've continued to rely on my workaround of focusing windows whenever I hover over them. That's working well.
Comment 18 QA Administrators 2023-05-13 03:19:16 UTC Comment hidden (obsolete)