Bug 564561 - Buttons from hidden view are added to the visible view in same stack
Summary: Buttons from hidden view are added to the visible view in same stack
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.17   Edit
Hardware: All All
: P3 critical (vote)
Target Milestone: 4.17 M3   Edit
Assignee: Rolf Theunissen CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
: 564994 565725 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-06-23 03:04 EDT by Andrey Loskutov CLA
Modified: 2020-07-31 10:52 EDT (History)
5 users (show)

See Also:


Attachments
COnsole buttons in History view (86.20 KB, image/png)
2020-06-23 03:04 EDT, Andrey Loskutov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Loskutov CLA 2020-06-23 03:04:50 EDT
Created attachment 283383 [details]
COnsole buttons in History view

Build id: I20200622-1800.

I've opened History view, it was focused on Platform UI repo (if that is important), and after that started runtime Eclipse for debugging.

Buttons from the Console view activated in background in the same stack were added to the toolbar of the History view!!!

Console buttons were fully enabled / drop-down to create new Consoles was selectable, I could terminate the new launch from History view etc.

After clicking on Console view to show it, buttons disappeared from History view.

Must be some recent regression, unfortunately I have no  idea how to reproduce it (tried same steps, no luck).
Comment 1 Andrey Loskutov CLA 2020-06-23 03:08:40 EDT
Possibly related?
 - bug 564299
 - bug 562645
 - bug 563547
Comment 2 Rolf Theunissen CLA 2020-06-23 07:09:04 EDT
I wouldn't be surprised if this is another incarnation of Bug 564290.

The parts are created lazily in the StackRenderer. It seems that the console part is created (lazily) when an Eclipse instance is created, however it does not become visible yet. The same code that triggers that the toolbar will be hidden (Bug 564290), can cause that the toolbar will be visible always (also related to Bug 563086). That is, the toolbar is flagged visible, even if the part is still not in top of the tabfolder.

If it is indeed Bug 564290, it the triggering of this situation depends on the order in which some listeners are triggered. And the probability that is triggered seems to be going down.
Comment 3 Lars Vogel CLA 2020-06-24 05:20:24 EDT
I cannot reproduce.
Comment 4 Andrey Loskutov CLA 2020-07-07 05:10:07 EDT
*** Bug 564994 has been marked as a duplicate of this bug. ***
Comment 5 Andrey Loskutov CLA 2020-07-07 05:12:11 EDT
As seen in bug 564994, it is not Linux only issue and not only for Console, I've updated the title.

That is definitely regression in 4.17 & *must* be fixed.
Comment 6 Andrey Loskutov CLA 2020-07-07 05:16:28 EDT
The attachment 283526 [details] from bug 564994 shows that Variables view (in front) contains additionally buttons from *two* hidden views that are in the same stack - Breakpoints and Expressions.
Comment 7 Sarika Sinha CLA 2020-07-07 05:45:37 EDT
Yes, this is a severe regression. We need to solve this as it confuses user.
Comment 8 Lars Vogel CLA 2020-07-07 06:01:45 EDT
(In reply to Sarika Sinha from comment #7)
> Yes, this is a severe regression. We need to solve this as it confuses user.

Is this reproducable for you? So far I was not able to produce Andreys example.
Comment 9 Sarika Sinha CLA 2020-07-07 06:09:21 EDT
(In reply to Lars Vogel from comment #8)
> (In reply to Sarika Sinha from comment #7)
> > Yes, this is a severe regression. We need to solve this as it confuses user.
> 
> Is this reproducable for you? So far I was not able to produce Andreys
> example.

Not the console view issue, But I am consistently able to reproduce Variables/Breakpoint/Expression View issue.
Comment 10 Andrey Loskutov CLA 2020-07-07 06:26:37 EDT
(In reply to Sarika Sinha from comment #9)
> Not the console view issue, But I am consistently able to reproduce
> Variables/Breakpoint/Expression View issue.

Can you please provide steps to reproduce?
Comment 11 Sarika Sinha CLA 2020-07-07 07:31:04 EDT
(In reply to Andrey Loskutov from comment #10)
> (In reply to Sarika Sinha from comment #9)
> > Not the console view issue, But I am consistently able to reproduce
> > Variables/Breakpoint/Expression View issue.
> 
> Can you please provide steps to reproduce?

1. Launch Eclipse I20200706-2300 with Java 13
2. A simple program like
package t13;

public class a1 {

	public static void main(String[] args) {
		var a = "hello";
		System.out.println(a);

	}

}
3. Debug with Breakpoint at sysout
4. Choose to switch perspective when it asks.
5. The Variable view  shows duplicate icons from Breakpoint or Expression view.
Comment 12 Andrey Loskutov CLA 2020-07-07 13:11:35 EDT
Couldn't this be regression from bug 562892? Sounds like a perfect match: 

"Bug 562892 - Calling toBeRendered on a view toolbar breaks UI"
https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/162592/
Comment 13 Eclipse Genie CLA 2020-07-07 15:44:57 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165977
Comment 14 Rolf Theunissen CLA 2020-07-07 15:55:52 EDT
(In reply to Andrey Loskutov from comment #12)
> Couldn't this be regression from bug 562892? Sounds like a perfect match: 
> 
> "Bug 562892 - Calling toBeRendered on a view toolbar breaks UI"
> https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/162592/

Indeed it is related to this one. Not sure how it worked before but do know what was the cause now:
The MParts are lazily created, any toolbar on a non-visible part is marked invisible. Most of the time the views are only rendered when they become visible. However, the not visible MParts in the debug view are rendered in the 'background' when the debugger runs. That is, the MParts are already rendered even if they are not on top. The rendering of parts trigggers that a toolbar is added in the CompatibiltyView. This new toolbar is not marked invisible.

The submitted change listens for toolbars that are added to the model, it marks the toolbars (in)visible depending if the Part is visible or not.
Comment 16 Rolf Theunissen CLA 2020-07-16 03:31:08 EDT
(In reply to Eclipse Genie from comment #15)
> Gerrit change
> https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165977 was merged
> to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=0bfddfbc18467d59452d1cb28ef180e2f6fd4c07

From the review, this change fixes the issue for new workspaces (or after -clearPersistedState). The issue remains for workspaces that were created with older versions.
Comment 17 Sarika Sinha CLA 2020-07-20 01:16:53 EDT
(In reply to Rolf Theunissen from comment #16)
> (In reply to Eclipse Genie from comment #15)
> > Gerrit change
> > https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165977 was merged
> > to [master].
> > Commit:
> > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> > ?id=0bfddfbc18467d59452d1cb28ef180e2f6fd4c07
> 
> From the review, this change fixes the issue for new workspaces (or after
> -clearPersistedState). The issue remains for workspaces that were created
> with older versions.

Verified with Build id: I20200716-1800
Comment 18 Eclipse Genie CLA 2020-07-20 16:29:05 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/166560
Comment 20 Rolf Theunissen CLA 2020-07-31 10:52:12 EDT
*** Bug 565725 has been marked as a duplicate of this bug. ***