Bug 493833 - View Close Button hidden after Minimize and Restore
Summary: View Close Button hidden after Minimize and Restore
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.5.1   Edit
Hardware: PC Linux
: P3 minor with 1 vote (vote)
Target Milestone: 4.16 M3   Edit
Assignee: Paul Pazderski CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2016-05-17 12:46 EDT by Ben Steffensmeier CLA
Modified: 2020-05-20 12:45 EDT (History)
9 users (show)

See Also:


Attachments
Shows tabs before and after a restore/minimize, they should be the same. (31.54 KB, image/png)
2016-05-17 12:46 EDT, Ben Steffensmeier CLA
no flags Details
before the patch (14.25 KB, image/png)
2017-02-05 12:43 EST, Andrey Loskutov CLA
no flags Details
after the patch (61.48 KB, image/png)
2017-02-07 09:37 EST, Markus Keller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Steffensmeier CLA 2016-05-17 12:46:21 EDT
Created attachment 261805 [details]
Shows tabs before and after a restore/minimize, they should be the same.

When a view stack is minimized and then restored the close button on the view can become hidden behind the minimize button. This only occurs when the rightmost view is selected and the view stack is narrow enough that the view titles are truncated in the tab text. See the attached image for an example.

If one of the other views(not rightmost) is selected then the close button is always visible but some of the text on the rightmost view will be cut off. The problem can easily be corrected by selecting a different view or resizing the view stack.

To reproduce:
1. Open several views in the same stack
2. Decrease the width of the view stack until some of the text is cut off of the tab titles
3. Select the rightmost view, note the close button('x') on the tab
4. Minimize the view stack
5. Restore the view stack
6. Note the close button('x') is no longer visible on the tab.
Comment 1 Andrey Loskutov CLA 2016-05-17 12:54:21 EDT
Just to make sure: can you reproduce rhis with 4.6 RC1? Can you reproduce this also with GTK2?
Comment 2 Ben Steffensmeier CLA 2016-05-17 13:57:15 EDT
I just downloaded Neon(4.6.0M7 Build id: 20160505-1310) and I see the same behavior. I am currently running GTK2, I do not know if the same problem exists on GTK3.
Comment 3 Eclipse Genie CLA 2016-06-07 15:30:26 EDT
New Gerrit change created: https://git.eclipse.org/r/74823
Comment 4 Ben Steffensmeier CLA 2016-06-14 11:39:33 EDT
I have submitted a patch which fixes the problem. It has been tested on linux using both gtk2 and gtk3 and it resolves the problem in both versions. Can someone take a look at the patch and let me know if there are any problems or if it can be merged?
Comment 5 Andrey Loskutov CLA 2016-06-15 02:35:39 EDT
Moving to SWT.
The patch introduces regression for me on GTK2 - the shortened view titles do not have "..." at the end anymore.
Comment 6 Ben Steffensmeier CLA 2016-06-15 11:41:26 EDT
Andrey, thanks for taking the time to look at the patch. Unfortunately I do not see the same regression as you. The default theme on GTK2 has the ellipsis("...") disabled, this is what I see both before and after the patch. By removing the org.eclipse.ui.themes plugin from my run configuration I can remove the theme and the ellipsis are enabled, again I get the same behavior both before and after the patch. Is it possible that in your test configuration you were unexpectedly using a theme which does not include ellipsis(swt-simple: false)?
Comment 7 Nate Jensen CLA 2016-07-07 11:33:56 EDT
Can this patch be retested based on Ben's comment about themes?
Comment 8 Andrey Loskutov CLA 2016-07-22 05:04:30 EDT
(In reply to Nathan Jensen from comment #7)
> Can this patch be retested based on Ben's comment about themes?

Sorry, my bad, patch looks good for me, but I'm not SWT committer so I can't merge. @SWT team - anyone?
Comment 9 Eric Williams CLA 2016-07-22 08:40:59 EDT
(In reply to Andrey Loskutov from comment #8)
> (In reply to Nathan Jensen from comment #7)
> > Can this patch be retested based on Ben's comment about themes?
> 
> Sorry, my bad, patch looks good for me, but I'm not SWT committer so I can't
> merge. @SWT team - anyone?

I'd be happy to review this today on Linux, will need someone to review on Mac and Windows since CTabFolder is cross platform.
Comment 10 Eric Williams CLA 2016-07-25 11:46:25 EDT
(In reply to Eric Williams from comment #9)
> I'd be happy to review this today on Linux, will need someone to review on
> Mac and Windows since CTabFolder is cross platform.

I can't actually reproduce this bug on Linux.
Comment 11 Andrey Loskutov CLA 2016-07-27 08:21:51 EDT
(In reply to Eric Williams from comment #10)
> (In reply to Eric Williams from comment #9)
> > I'd be happy to review this today on Linux, will need someone to review on
> > Mac and Windows since CTabFolder is cross platform.
> 
> I can't actually reproduce this bug on Linux.

Perfectly reproducible for me on RHEL 7.0, on both GTK2/3 implementations.
rpm -q gtk2 gtk3
gtk2-2.24.22-5.el7.x86_64
gtk3-3.8.8-5.el7.x86_64
Comment 12 Andrey Loskutov CLA 2017-02-05 12:43:11 EST
Created attachment 266645 [details]
before the patch

(In reply to Eric Williams from comment #9)
> I'd be happy to review this today on Linux, will need someone to review on
> Mac and Windows since CTabFolder is cross platform.

I've just tested it on Windows, I can reproduce the problem without patch (see my attachment) and I can confirm that the patch fixes the problem.

Can we please merge this?
Comment 14 Alexander Kurtakov CLA 2017-02-06 03:45:50 EST
Thanks for the patch. Pushed.
Comment 15 Markus Keller CLA 2017-02-07 09:37:27 EST
Created attachment 266699 [details]
after the patch

This change is the reason for misplaced overflow buttons in master.

I'm on Windows 7, I20170205-2000, new workspace, open all types in java.lang.annotation, close last editor.
Comment 16 Markus Keller CLA 2017-02-07 09:57:19 EST
I also saw similar drawing errors around the chevron button on macOS in I20170206-2000. Reverted the patch with http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=665fa3c948ec6912d648fb5c396f758b9c3b7656
Comment 17 Andrey Loskutov CLA 2017-02-07 10:37:33 EST
(In reply to Markus Keller from comment #15)
> Created attachment 266699 [details]
> after the patch
> 
> This change is the reason for misplaced overflow buttons in master.
> 
> I'm on Windows 7, I20170205-2000, new workspace, open all types in
> java.lang.annotation, close last editor.

Yes, this can be also reproduced if just opening many editors and then constantly resizing window. Sometimes the chevron jumps to wrong position. I'm sorry I haven't tested this case :-(
Comment 18 Markus Keller CLA 2017-03-09 06:12:12 EST
Back to inbox, since there's currently no working fix available.
Comment 19 Eric Williams CLA 2019-08-27 14:33:38 EDT
Still reproducible on 4.13 M3.
Comment 20 Paul Pazderski CLA 2020-05-05 16:24:22 EDT
I could reproduce this issue and found it fixed with my change for bug 499215.
Comment 21 Paul Pazderski CLA 2020-05-07 17:06:48 EDT
Fixed with bug 499215. In fact Ben had almost provided the right fix. The major difference I made is to split the creation of min/max button and the positioning of min/max and chevron and run one before item sizing and one after.
Comment 22 Lakshmi P Shanmugam CLA 2020-05-20 06:48:03 EDT
@Paul, can you please verify this for M3?
Comment 23 Paul Pazderski CLA 2020-05-20 12:45:04 EDT
Verified in I20200520-0600