Bug 49684 - the Navigator gets the focus when starting a new document while the Navigator is open
Summary: the Navigator gets the focus when starting a new document while the Navigator...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.0 RC1
Hardware: Other All
: medium major
Assignee: Not Assigned
URL:
Whiteboard: target:6.2.2
Keywords:
: 86496 (view as bug list)
Depends on:
Blocks: Navigator
  Show dependency treegraph
 
Reported: 2012-05-09 04:53 UTC by Cor Nouws
Modified: 2020-02-22 18:04 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cor Nouws 2012-05-09 04:53:45 UTC
- writer document, start Navigator (docked)
- Ctrl-N for new Writer Document
  > Focus is in Navigator
should be in document.

Try the same with Styles & FOrmatting window, then the focus is properly in the document
Comment 1 Jean-Francois Nifenecker 2012-08-14 19:01:45 UTC
This behaviour doesn't occur when running Writer from the Launcher.
It occurs with:
-- File / New / Text document
-- Running Writer from it's own icon
Checked with various OSes: Xubuntu (10.04), Mageia 2, Windows 7.
Comment 2 retired 2014-12-10 12:05:47 UTC
Persisting with Ubuntu 14.10 LO Version: 4.3.3.2
Build ID: 430m0(Build:2)
Comment 3 Urmas 2015-01-21 01:25:02 UTC
In 4.4, component shortcuts in menu also cause this. That is a major regress.
Comment 4 Urmas 2015-01-21 01:26:19 UTC
*** Bug 86496 has been marked as a duplicate of this bug. ***
Comment 5 Cor Nouws 2015-01-21 08:48:44 UTC
(In reply to Urmas from comment #3)
> In 4.4, component shortcuts in menu also cause this. That is a major regress.

Hi Urmas,
Can you pls explain what you mean with this?
thanks,
Cor
Comment 6 QA Administrators 2016-02-21 08:37:52 UTC Comment hidden (obsolete)
Comment 7 Cor Nouws 2016-02-22 20:48:34 UTC
This ugly bug still exists :\
Comment 8 QA Administrators 2017-03-06 16:02:03 UTC Comment hidden (obsolete)
Comment 9 Terrence Enger 2017-03-22 02:13:38 UTC
Working with daily Linux dbgutil bibisect repository version 2017-03-21 running on debian-stretch, I see slightly different behavior:
(*) In new document opened via <Ctrl>+N, the focus is in the navigator or 
    document area, as it was in the previous window.
(*) Upon redisplay of another Writer window, either by closing another 
    LibreOffice window or by <Alt>+<Tab> from another LibreOffice window,
    focus goes to the navigator.

Cor,

I shall leave it to you to check my work and to change the bug summary here or to file a new report for the changed behavior.
Comment 10 Cor Nouws 2017-04-12 13:40:05 UTC
Hi Terrence,

(In reply to Terrence Enger from comment #9)
> Working with daily Linux dbgutil bibisect repository version 2017-03-21
> running on debian-stretch, I see slightly different behavior:
> (*) In new document opened via <Ctrl>+N, the focus is in the navigator or 
>     document area, as it was in the previous window.

For me that is not the case. Still as originally reported.
(But it may be OS/config dependent, for sure)
Comment 11 QA Administrators 2018-06-17 02:44:07 UTC Comment hidden (obsolete)
Comment 12 Jim Raykowski 2018-10-24 01:57:47 UTC
@Cor, Hi, From the comment made here [1], about not causing the same effect as in Writer, I found that the Navigator content grabbing focus is causing the Navigator to get focus when starting a new document while the Navigator is open.

So can we just make the Writer Navigator behavior like the Calc Navigator and not have focus set to the tree list box when it is shown?

[1] https://bugs.documentfoundation.org/show_bug.cgi?id=113250#c13
Comment 13 Cor Nouws 2018-10-24 21:31:04 UTC
(In reply to Jim Raykowski from comment #12)

> So can we just make the Writer Navigator behavior like the Calc Navigator
> and not have focus set to the tree list box when it is shown?

Not sure if that will help to prevent that the focus is *somewhere* but not in the document?
If I read it, it may still be that the focus is on the Navigator's frame :D ?
Comment 14 Jim Raykowski 2018-10-24 22:12:07 UTC
This is the commit that added grab focus to tree in Writer Navigator

commit fee0ef3ca44b92a6f2cd877bd2e02b87254ea3ab
Author: Oliver Bolte <obo@openoffice.org>, Tue Nov 16 14:03:41 2004 +0000 (14 years ago)
Committer: Oliver Bolte <obo@openoffice.org>, Tue Nov 16 14:03:41 2004 +0000 (14 years ago)
Comment 15 Jim Raykowski 2018-10-24 23:04:20 UTC
Here is a patch to test that doesn't focus on Navigator or Sidebar on show:

https://gerrit.libreoffice.org/#/c/62337/
Comment 16 Commit Notification 2018-11-01 09:35:07 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/88cbc3ea2db8358bbedff01361f95f972f2b0231%5E%21

tdf#49684 Don't focus on Navigator or Sidebar on show

It will be available in 6.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 17 Jim Raykowski 2018-12-28 22:45:01 UTC
It seems this still isn't resolved for gtk3?

I used bibisect to find the commit which changed focus behavior for docking windows between gtk2 and gtk3. It is an awesome tool for debugging. Kudos to all who have contributed to it!

On confirmation I will provide more details and a possible solution.
Comment 18 Cor Nouws 2019-01-07 15:24:51 UTC
Hi Jim,

Thanks for your efforts here!

(In reply to Jim Raykowski from comment #17)
> It seems this still isn't resolved for gtk3?

In Version: 6.3.0.0.alpha0+
Build ID: 3bf82348bc73797fec61997dc4268a322299b3ff
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-01-06_08:29:45
Locale: nl-NL (nl_NL.UTF-8); UI-Language: en-US
Calc: threaded

I see two things:
1)
- Have one document open with Navigator (F5), close the document.
- Open the (or another document)
  > focus in document.
  Which is what this bug is about. So fixed, IMO. With gtk3.
However..
2)
- Have document without Navigator open
- hit F5 to open Navigator
  > focus still in document and not in Navigator, as was before
  (not sure if that started with your patch exactly)
The use case for this is:
 - F5 (Navigator has focus)
 - use keyboard to go to a section (in Navigator)
 - enter to go to that place in the document

File another bug for this?
Comment 19 Jim Raykowski 2019-01-08 09:17:29 UTC
(In reply to Cor Nouws from comment #18)

Hi Cor,

Here are the results I get with current master 6.3.0.0.alpha0+

> 1)
> - Have one document open with Navigator (F5), close the document.
> - Open the (or another document)
>   > focus in document.
>   Which is what this bug is about. So fixed, IMO. With gtk3.

gtk3:  
   for undocked Navigator focus is in Navigator
   for docked Navigator focus is in document

gtk2: 
   for undocked or docked Navigator focus is in document 

> However..
> 2)
> - Have document without Navigator open
> - hit F5 to open Navigator
>   > focus still in document and not in Navigator, as was before

gtk3:
   for undocked Navigator focus changes to Navigator
   for docked Navigator focus remains in document

gtk2:
   for undocked or docked Navigator focus remains in document
Comment 20 Commit Notification 2019-02-15 22:15:16 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/5a557821c647c1a499270a8a1188e23fc015f782%5E%21

Revert "tdf#49684 Don't focus on Navigator or Sidebar on show"

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 21 Commit Notification 2019-03-12 18:14:49 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/35074dc5518e59284663ce85496b3cda406a25eb%5E%21

Revert "tdf#49684 Don't focus on Navigator or Sidebar on show"

It will be available in 6.2.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 22 Commit Notification 2019-03-15 17:37:07 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "libreoffice-6-2-2":

https://git.libreoffice.org/core/+/c58bc517af4a8c8aabace4b65d6503670ba2ba43%5E%21

Revert "tdf#49684 Don't focus on Navigator or Sidebar on show"

It will be available in 6.2.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 23 sdc.blanco 2020-02-21 12:30:11 UTC
@Jim -- maybe you have resolved this, but did change the status because you were waiting for someone (Cor?) to test?  In relation to the two issues in comment 18 (nr. 1 is still the same, and for nr. 2, the focus shifts to Navigator when opened from a document, which is what I think was wanted.)

Could not test all the variations you described in comment 19. 
Tested with:
Version: 7.0.0.0.alpha0+ (x64)
Build ID: cf96cb11e2a46c452a273ded1c66c556118983cf
CPU threads: 8; OS: Windows 10.0 Build 18363; UI render: GL; VCL: win; 
Locale: en-US (en_DK); UI-Language: en-US
Calc: threaded
Comment 24 Cor Nouws 2020-02-22 18:04:41 UTC
(In reply to sdc.blanco from comment #23)
> @Jim -- maybe you have resolved this, but did change the status because you
> were waiting for someone (Cor?) to test?  In relation to the two issues in
Thanks - a bit busy, but..

tested in Version: 7.0.0.0.alpha0+
Build ID: fe75ce648c53e641048fe1fcd416868b784860e5
CPU threads: 8; OS: Linux 5.3; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2020-02-12_04:56:37
Locale: nl-NL (en_US.UTF-8); UI-Language: en-US
Calc: threaded

and indeed works nice now. Thanks Jim :) !!