Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 436841

Summary: [GTK3] FocusOut/In and Activate/Deactivate events when opening context menu
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: SWTAssignee: Xi Yan <xixiyan>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, arunkumar.thondapu, daniel_megert, Ed.Merks, ericwill, lbullen, loskutov, niraj.modi, sravankumarl
Version: 4.4Keywords: triaged
Target Milestone: 4.9 M3   
Hardware: PC   
OS: Linux-GTK   
See Also: https://git.eclipse.org/r/126509
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=9f91c882bb8f96c689143525a71937171402a3d7
https://git.eclipse.org/r/127357
https://git.eclipse.org/r/127364
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=b06158d7dd5b7576ae3250fd1c337625da5d2ee5
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=ddc3826de4b8789f3df31a6927cb568b8e21c19f
https://git.eclipse.org/r/127774
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=ae69be6c3c1008e9517e8550424a0fd0d34b866d
https://git.eclipse.org/r/129713
Whiteboard:

Description Markus Keller CLA 2014-06-06 08:58:02 EDT
(In reply to Markus Keller from bug 435799 comment #8)
> The patch works fine for the scenarios without detached views, but we still
> get FocusOut/In and activation events on GTK3 when the context menu is
> shown. On GTK2 and Windows, no such events are sent.
Comment 1 Sravan Kumar Lakkimsetti CLA 2016-05-04 06:20:38 EDT
We did not had time to look at this problem in 4.6 Moving out
Comment 2 Eric Williams CLA 2018-07-06 14:21:34 EDT
Still reproducible with SWT master as of today, GTK3.22, and Fedora 28.
Comment 3 Eclipse Genie CLA 2018-07-23 15:55:31 EDT
New Gerrit change created: https://git.eclipse.org/r/126509
Comment 5 Eric Williams CLA 2018-08-08 11:53:11 EDT
(In reply to Eclipse Genie from comment #4)
> Gerrit change https://git.eclipse.org/r/126509 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=9f91c882bb8f96c689143525a71937171402a3d7

Patch is in master, thanks Xi.
Comment 6 Andrey Loskutov CLA 2018-08-13 06:49:26 EDT
This seem to cause test issues, please investigate.

I see that since a http://download.eclipse.org/eclipse/downloads/drops4/I20180808-2000/testResults.php, many UI tests started to fail on GTK3 builds.

See most recent BAD build:
http://download.eclipse.org/eclipse/downloads/drops4/I20180812-2000/testResults.php

Last known good build:
http://download.eclipse.org/eclipse/downloads/drops4/I20180807-2000/testResults.php

I mean:
4 fails in e4.ui.bindings.tests
5 fails in ui.tests
3 fails in ui.workbench.texteditor.tests

They complain about unexpected, inactive or missing windows:

- "Application does not have an active window"

- "expected:<Shell {MyWindow}> but was:<null>"

- "expected:<org.eclipse.ui.internal.WorkbenchWindow@6efc419> but was:<org.eclipse.ui.internal.WorkbenchWindow@6af609ea>"

- "this test does not work on GTK unless the runtime workbench has focus. Screenshot: /home/cbi/genie.releng/workspace/ep49I-unit-cen64-gtk3/workarea/I20180812-2000/eclipse-testing/results/ep49I-unit-cen64-gtk3_linux.gtk.x86_64_8.0/org.eclipse.ui.workbench.texteditor.tests.FindReplaceDialogTest.testFocusNotChangedWhenButtonMnemonicPressed.png"
Comment 7 Andrey Loskutov CLA 2018-08-13 11:15:09 EDT
This must be reverted or fixed ASAP!

1 Open any text file
2 copy some text
3 Ctrl+F
4 Try to paste the text to search for via Ctrl+V into the text box: the text is pasted *into the editor*!
Comment 8 Eclipse Genie CLA 2018-08-13 11:27:54 EDT
New Gerrit change created: https://git.eclipse.org/r/127357
Comment 9 Eric Williams CLA 2018-08-13 11:28:42 EDT
(In reply to Eclipse Genie from comment #8)
> New Gerrit change created: https://git.eclipse.org/r/127357

We are in the process of investigating/fixing this. Please give us until the end of the day before reverting.
Comment 10 Andrey Loskutov CLA 2018-08-13 11:32:29 EDT
(In reply to Eric Williams from comment #9)
> (In reply to Eclipse Genie from comment #8)
> > New Gerrit change created: https://git.eclipse.org/r/127357
> 
> We are in the process of investigating/fixing this. Please give us until the
> end of the day before reverting.

Perfect, thanks Eric. I wonted to have tomorrow build working :-)
Comment 11 Eric Williams CLA 2018-08-13 11:35:36 EDT
(In reply to Andrey Loskutov from comment #10)
> Perfect, thanks Eric. I wonted to have tomorrow build working :-)

No problem -- if no fix is found by end of day today, we'll revert.
Comment 12 Eclipse Genie CLA 2018-08-13 17:27:18 EDT
New Gerrit change created: https://git.eclipse.org/r/127364
Comment 15 Eric Williams CLA 2018-08-14 14:56:19 EDT
(In reply to Eclipse Genie from comment #14)
> Gerrit change https://git.eclipse.org/r/127364 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=ddc3826de4b8789f3df31a6927cb568b8e21c19f

Revised patch merged to master.
Comment 16 Eclipse Genie CLA 2018-08-21 10:19:10 EDT
New Gerrit change created: https://git.eclipse.org/r/127774
Comment 17 Eric Williams CLA 2018-08-23 08:48:30 EDT
Verified in I20180821-2000.
Comment 19 Eclipse Genie CLA 2018-09-20 02:00:12 EDT
New Gerrit change created: https://git.eclipse.org/r/129713
Comment 20 Ed Merks CLA 2018-09-20 02:02:33 EDT
I'm reopening this bug because the following commit changes org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Shell.test_activateEventSend() such that it can't be compiled on Windows:

https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=ae69be6c3c1008e9517e8550424a0fd0d34b866d

It's of course better to use SwtTestUtil.isX11 as the guard because that is available on all platforms.
Comment 21 Dani Megert CLA 2018-09-20 05:09:50 EDT
(In reply to Ed Merks from comment #20)
> I'm reopening this bug because the following commit changes
> org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Shell.test_activateEventSend()
> such that it can't be compiled on Windows:
> 
> https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=ae69be6c3c1008e9517e8550424a0fd0d34b866d
> 
> 
> It's of course better to use SwtTestUtil.isX11 as the guard because that is
> available on all platforms.

Ed, would be better to have a new bug for that, so that the separate fixes can be distinguished (problem solved in 4.9) and test issue fixed in 4.10.
Comment 22 Ed Merks CLA 2018-09-20 05:38:04 EDT
I've opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=539274
Comment 23 Niraj Modi CLA 2018-09-20 06:08:37 EDT
(In reply to Eclipse Genie from comment #18)
> Gerrit change https://git.eclipse.org/r/127774 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=ae69be6c3c1008e9517e8550424a0fd0d34b866d

Hi Xi,
Once a bug is marked verified against an already released version, we usually don't make further code commits. In this case, right practice would be to open a new bug for adding the new JUnit test.
Comment 24 Ed Merks CLA 2018-09-20 07:01:29 EDT
I suppose this should be closed again...
Comment 25 Xi Yan CLA 2018-09-20 08:44:54 EDT
(In reply to Niraj Modi from comment #23)
> (In reply to Eclipse Genie from comment #18)
> > Gerrit change https://git.eclipse.org/r/127774 was merged to [master].
> > Commit:
> > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> > ?id=ae69be6c3c1008e9517e8550424a0fd0d34b866d
> 
> Hi Xi,
> Once a bug is marked verified against an already released version, we
> usually don't make further code commits. In this case, right practice would
> be to open a new bug for adding the new JUnit test.

Hi Niraj, thanks for the info, and sorry about the trouble. Will keep it in mind next time!
Comment 26 Xi Yan CLA 2018-09-24 10:53:53 EDT
Verified in I20180923-1800.