Bug 103914 - When LO closes menu, it sets window of that menu active
Summary: When LO closes menu, it sets window of that menu active
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
5.2.3.1 rc
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.3.0 target:5.2.4
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2016-11-13 20:44 UTC by Mike Kaganski
Modified: 2017-10-22 21:16 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 Mike Kaganski 2016-11-13 20:44:02 UTC
When LO closes menu, it sets window of that menu active

Steps to reproduce:
1. Open two any LO documents (e.g. an empty Calc document and an empty Writer document - I will refer to them below). Make them both visible on screen (say, side-by-side).
2. In Calc document, right-click in greed area to open context menu. Alternatively, click on a main menu item to open it down.
3. Now (while the menu is still open visible) try to left-click on page area of Writer document.

Expected result: the menu should close, and Writer document should become active.
Actual result: the menu does close, but the active window is still Calc.

When in Windows, this may be seen even better. After step 2, first activate Writer window clicking on its header (this won't close the menu), and then do step 3. This way, you will see that clicking on page area in already active Writer's window brings another window (Calc's) active.

Reproducible with:
==================
Version: 5.3.0.0.alpha1+
Build ID: 24707c7b8d5e7b3d72decb9749b83153b273917f
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
Locale: ru-RU (ru_RU); Calc: group

Version: 5.2.3.1 (x64)
Build ID: 01ec8f357e651ca9656837b783cf7e6a32ee4d92
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; 
Locale: ru-RU (ru_RU); Calc: CL

Version: 5.2.3.2
Build ID: 1:5.2.3~rc2-0ubuntu1~xenial1
CPU Threads: 1; OS Version: Linux 4.4; UI Render: default; 
Locale: en-US (en_US.UTF-8); Calc: group
-> OS: All

Not reproducible with:
======================
Version: 5.2.2.2 (x64)
Build ID: 8f96e87c890bf8fa77463cd4b640a2312823f3ad
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; 
Locale: ru-RU (ru_RU); Calc: CL
-> regression

Bibisect log (bibisect-win32-5.2):

# bad: [d2d2b966fc101ea850dd1cb37d7f628c1b6a13d5] source sha:3f373500282c926031eed4f995ca8d51402ed187
# good: [1f670510f08cb800cbae2a1dd6ea70d3542e4721] source sha:49c2b9808df8a6b197dec666dfc0cda6321a4306
git bisect start 'master' 'oldest'
# good: [ad4c13c90a7c6c8437f80068188b71e2f17190be] source sha:7df498c828b36259397e2dd2769d99e7f30f7470
git bisect good ad4c13c90a7c6c8437f80068188b71e2f17190be
# skip: [c1717b0fc757f6034436348e24d8e3058cc7952f] source sha:73b9846e8242f4d383717d627cb84e97b91c58f3
git bisect skip c1717b0fc757f6034436348e24d8e3058cc7952f
# skip: [a1d0fd68f06f368ebf73772fea1249335a8f5835] source sha:438f2db139dfee1036da3baae85c82c9a14448b5
git bisect skip a1d0fd68f06f368ebf73772fea1249335a8f5835
# good: [469f5f26711cb6b872179e201543b0db3959bedb] source sha:6c782fe1568d1b3a5f968b3696ba1bf8ad6d914c
git bisect good 469f5f26711cb6b872179e201543b0db3959bedb
# good: [39fde614d5390fcf200d839f16ac61ffa53faa02] source sha:35d4f6608a05b349950030e5aeb21dec6aa185e1
git bisect good 39fde614d5390fcf200d839f16ac61ffa53faa02
# good: [63a155b9baab60ce2a3693fd584f9cfa3253f676] source sha:721b55bcf1ab31b24b28aac6d9a54784fc290d6c
git bisect good 63a155b9baab60ce2a3693fd584f9cfa3253f676
# good: [927a15c2fb89575df147510515d2666457bc75a6] source sha:d8e46307cd8190c93c0b60e394475536b40e3a46
git bisect good 927a15c2fb89575df147510515d2666457bc75a6
# bad: [d02008cca47f3e5cdedf66dcf26d054d7f1f8607] source sha:6eef3ed192f4426ab1b8da6bb26ea64bcd5822a4
git bisect bad d02008cca47f3e5cdedf66dcf26d054d7f1f8607
# good: [78ec0b2be08e12f5f7a43cd6627356cbd7e17300] source sha:0402ba63551b614c9742b198e48232ac87a2b32b
git bisect good 78ec0b2be08e12f5f7a43cd6627356cbd7e17300
# bad: [001d8f317d7324af45d6ce4fe2235e10c756b415] source sha:b73a8e115d9afaf7cc00906d158d1c2f1ba8829c
git bisect bad 001d8f317d7324af45d6ce4fe2235e10c756b415
# bad: [4a73eccd907c0d3076800d2d35c69178b744d545] source sha:d0f2707c2a649778fe8bc47a187ceb2e6a90aaf7
git bisect bad 4a73eccd907c0d3076800d2d35c69178b744d545
# good: [c1ef34c55244191d0cdee2a97b6768df36320425] source sha:3e441af7c12e408a886256a55c34780699af7e2a
git bisect good c1ef34c55244191d0cdee2a97b6768df36320425
# bad: [2e26ebc43ae490af20c698974ee8febb76066fc0] source sha:06761518b63cc420ee11cff3e54e1059a5985b01
git bisect bad 2e26ebc43ae490af20c698974ee8febb76066fc0
# first bad commit: [2e26ebc43ae490af20c698974ee8febb76066fc0] source sha:06761518b63cc420ee11cff3e54e1059a5985b01

2e26ebc43ae490af20c698974ee8febb76066fc0 is the first bad commit
commit 2e26ebc43ae490af20c698974ee8febb76066fc0
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Thu Oct 6 07:49:32 2016 -0700

    source sha:06761518b63cc420ee11cff3e54e1059a5985b01

    source sha:06761518b63cc420ee11cff3e54e1059a5985b01

:040000 040000 988a108f2ce05fd3948fdf4e266dbab53c7a8325 e02e7ff8c7e535b6a5db2211940d9480619d0ad9 M      instdir

https://cgit.freedesktop.org/libreoffice/core/commit/?id=06761518b63cc420ee11cff3e54e1059a5985b01
author	Caolán McNamara <caolanm@redhat.com>	2016-09-27 14:14:46 (GMT)
committer	Miklos Vajna <vmiklos@collabora.co.uk>	2016-10-06 14:26:17 (GMT)
commit	06761518b63cc420ee11cff3e54e1059a5985b01
tree	8b46e4481c2b39f91699ea31da20d0ae49f50cfa
parent	3e441af7c12e408a886256a55c34780699af7e2a
Resolves: tdf#102177 focus not restored from context menus
Comment 1 Cor Nouws 2016-11-13 21:10:48 UTC
confirmed in Version: 5.3.0.0.alpha1+
Build ID: 0af30952982767543cddd0b1ce643cb8d5c253a2
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk2; Layout Engine: new; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-11-11_23:43:27
Locale: nl-NL (nl_NL.UTF-8); Calc: group
Comment 2 Xisco Faulí 2016-11-14 00:16:23 UTC
Adding Cc: to Caolán McNamara
Comment 3 Mike Kaganski 2016-11-14 05:07:49 UTC
As the identified commit in 5.2 was a bunch of squashed together commits from master, here is bibisecting results from bibisect-win32-5.3:

# bad: [2e5256b83814c5afeee8e0ef13333a803e991288] source sha:6fe0706f6726e5a5446c9f44e3d139cf73adeab9
# good: [defb73f1c6e2a66dbd21ba89e684f57427e8bc4b] source sha:5b168b3fa568e48e795234dc5fa454bf24c9805e
git bisect start 'master' 'oldest'
# good: [470e63808ce80588af14a79583f54bec38da3ccb] source sha:a75d49241df2e0dd2f1bcd3ce7fae3197eb5afe8
git bisect good 470e63808ce80588af14a79583f54bec38da3ccb
# bad: [8848305c9da26198edecff59040ace7352f90102] source sha:f0249a88fc502df142d36f2f67c976618b7ba6b6
git bisect bad 8848305c9da26198edecff59040ace7352f90102
# good: [96563aa883394c59a8d3111454aca6ff016b2eab] source sha:e501c39a48ab3f73f1994ab03a7f194774ed7ff4
git bisect good 96563aa883394c59a8d3111454aca6ff016b2eab
# good: [a4c502b9cea5c21c1002820268557ea7b1bbf31e] source sha:b2aa15ed6e989c50402e3914bffbc1a352e127de
git bisect good a4c502b9cea5c21c1002820268557ea7b1bbf31e
# good: [02f56f736c0be4880cffb353d37753b26c7b8c18] source sha:6d6668bb22a063cabb86bc601603d205522ae865
git bisect good 02f56f736c0be4880cffb353d37753b26c7b8c18
# bad: [e2f8bf1b68f219578df7c5e05152c22de437854e] source sha:f6998d9087c472954cc605c1308ec2df940dddd9
git bisect bad e2f8bf1b68f219578df7c5e05152c22de437854e
# bad: [24d0a1fb206cfa68c73c632b05d0aae81099f4cd] source sha:0145d83cc7872bf943de12e386645a7aa8868f5d
git bisect bad 24d0a1fb206cfa68c73c632b05d0aae81099f4cd
# bad: [32a8267515ac066d99e71bedb9fdc3316c50e0a3] source sha:0901c29d522f03c29c60fcda537918c2bf9eda63
git bisect bad 32a8267515ac066d99e71bedb9fdc3316c50e0a3
# good: [072ca7c27df58088cd551ac484abe51c564f90b7] source sha:3468dab9ff02ecdf5d0806a00e15b9b579c8dc35
git bisect good 072ca7c27df58088cd551ac484abe51c564f90b7
# good: [ea925963d2e71338cee3e6a5aef6a4c9b6bee20a] source sha:120d8fc75c164555058d63ef7dca8bfbd8316a5a
git bisect good ea925963d2e71338cee3e6a5aef6a4c9b6bee20a
# good: [3b38c129b658029cd78aaf71c50757bef9b38772] source sha:65fc486f7e28ec02ed481265dcaa30d09eaadc6c
git bisect good 3b38c129b658029cd78aaf71c50757bef9b38772
# bad: [3ad3848b73ecdaa3f6eadc39353e74d19807d725] source sha:1aaba02fafe0b9131c2cdeba3fb4ad9924da81be
git bisect bad 3ad3848b73ecdaa3f6eadc39353e74d19807d725
# bad: [7f571441f77eb85aec8ac12dc1c6bcb53abb9374] source sha:4da7971812b0a53ba80f7d9c29851c527488067d
git bisect bad 7f571441f77eb85aec8ac12dc1c6bcb53abb9374
# first bad commit: [7f571441f77eb85aec8ac12dc1c6bcb53abb9374] source sha:4da7971812b0a53ba80f7d9c29851c527488067d

7f571441f77eb85aec8ac12dc1c6bcb53abb9374 is the first bad commit
commit 7f571441f77eb85aec8ac12dc1c6bcb53abb9374
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Tue Sep 27 09:04:26 2016 -0700

    source sha:4da7971812b0a53ba80f7d9c29851c527488067d

    source sha:4da7971812b0a53ba80f7d9c29851c527488067d

:040000 040000 32e62ea1d646126ab7a5163cf0eb90522904205f 6d47edcf3ecc2e5cf1b782cc118b53aae3706852 M      instdir

https://cgit.freedesktop.org/libreoffice/core/commit/?id=4da7971812b0a53ba80f7d9c29851c527488067d

author	Caolán McNamara <caolanm@redhat.com>	2016-09-27 14:33:54 (GMT)
committer	Caolán McNamara <caolanm@redhat.com>	2016-09-27 15:03:54 (GMT)
commit	4da7971812b0a53ba80f7d9c29851c527488067d
tree	dd0724cbf76e465fd532008208973fdfcd365b3b
parent	65fc486f7e28ec02ed481265dcaa30d09eaadc6c
Resolves: tdf#102177 focus not restored from context menus
Comment 4 Commit Notification 2016-11-14 11:38:51 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=616bc7b854e237aea1962a6750abd7f139e38ac2

Resolves: tdf#103914 if menu no longer has focus, leave focus where it is

It will be available in 5.3.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 5 Caolán McNamara 2016-11-14 11:45:03 UTC
This seems to do what you want and keep the original problem working. Acceptable ?
Comment 6 Roman Kuznetsov 2016-11-14 11:58:56 UTC
(In reply to Caolán McNamara from comment #5)
> This seems to do what you want and keep the original problem working.
> Acceptable ?

if is it fixing this bug, then backport this to 5.2.4 please.
Comment 7 Mike Kaganski 2016-11-15 05:06:51 UTC
(In reply to Caolán McNamara from comment #5)
> Acceptable ?

I tested your fix, and it indeed fixes the problem. Thank you!
Comment 8 Commit Notification 2016-11-23 11:35:27 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5210e1ba38bfe996a888f21673640de13b49508b&h=libreoffice-5-2

Resolves: tdf#103914 if menu no longer has focus, leave focus where it is

It will be available in 5.2.4.

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

Affected users are encouraged to test the fix and report feedback.
Comment 9 Mike Kaganski 2016-12-04 10:55:36 UTC
Unfortunately, not properly fixed.

Steps to reproduce:
1. On Windows, open Writer and Impress side-by-side.
2. In Impress, click on File menu.
3. Click on Writer's title bar (note that menu in Impress is still open, and cursor is blinking in Writer).
4. Type single character "i".

Expected: "i" in Writer.
Actual result: Properties dialog from Impress is shown, nothing is typed in Writer. The "Properties" subitem of "File" menu that was open in Impress, has "i" as accelerator.

Caolán, I set you as assignee, as you've made previous patch; please reset to default if inappropriate.
Comment 10 Xisco Faulí 2017-07-13 10:54:13 UTC
Setting Assignee back to default. Please assign it back to yourself if you're
still working on this issue
Comment 11 Caolán McNamara 2017-07-13 14:02:34 UTC
really should have opened another bug there, sounds a little different. Realistically the fix there is probably to auto popdown menus when the window loses focus
Comment 12 Aron Budea 2017-10-22 20:06:53 UTC
Mike, please open a new bug report for comment 9.