Bug 457214 - [Contributions] Redrawn in ToolBarManager should always turned of independent of the number of items
Summary: [Contributions] Redrawn in ToolBarManager should always turned of independent...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Lars Vogel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 465353
  Show dependency tree
 
Reported: 2015-01-12 03:03 EST by Lars Vogel CLA
Modified: 2020-08-16 14:45 EDT (History)
7 users (show)

See Also:


Attachments
introduced rendering problem (5.08 KB, image/png)
2015-05-28 05:52 EDT, Dominik G. CLA
no flags Details
Sample RCP Product (117.53 KB, application/binary)
2015-05-29 03:15 EDT, Dominik G. CLA
no flags Details
Sample RCP Product (40.94 KB, image/png)
2015-05-29 03:16 EDT, Dominik G. CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2015-01-12 03:03:45 EST
ToolBarManager contains a logic to turn of redraw if the toolbar entries are above a certain limit. I think we should remove the logic because it makes the code a bit more complex and I see no advantage of not doing it for a small number of items.

See https://git.eclipse.org/r/#/c/39353/3/bundles/org.eclipse.jface/src/org/eclipse/jface/action/ToolBarManager.java,cm Line 304
boolean useRedraw = (clean.size() - (mi.length - toRemove.size())) >= 3;
Comment 1 Lars Vogel CLA 2015-01-12 03:09:06 EST
Andrey, what do you think?
Comment 2 Andrey Loskutov CLA 2015-01-12 03:22:16 EST
(In reply to Lars Vogel from comment #0)
> ToolBarManager contains a logic to turn of redraw if the toolbar entries are
> above a certain limit. I think we should remove the logic because it makes
> the code a bit more complex and I see no advantage of not doing it for a
> small number of items.

You mean we should always set setRedraw(false) before starting TB manipulations?
I have no experience in that area, no idea if this can cause any regression.

But BTW I've seen Paul had some bugs related to the non-refreshing toolbar buttons - might be this is somehow related?
Comment 3 Lars Vogel CLA 2015-01-12 03:24:34 EST
(In reply to Andrey Loskutov from comment #2)
> But BTW I've seen Paul had some bugs related to the non-refreshing toolbar
> buttons - might be this is somehow related?

Maybe. Could you find the bug numbers?
Comment 4 Andrey Loskutov CLA 2015-01-12 03:43:19 EST
See bug 432856
Comment 5 Eclipse Genie CLA 2015-02-17 10:52:19 EST
New Gerrit change created: https://git.eclipse.org/r/42052
Comment 6 Eclipse Genie CLA 2015-04-20 04:34:06 EDT
New Gerrit change created: https://git.eclipse.org/r/46053
Comment 7 Lars Vogel CLA 2015-04-20 04:37:49 EDT
(In reply to Eclipse Genie from comment #6)
> New Gerrit change created: https://git.eclipse.org/r/46053

Sorry, forgot to press ammend commit. Correct one is https://git.eclipse.org/r/#/c/42052/
Comment 9 Lars Vogel CLA 2015-04-23 22:09:36 EDT
Fixed. See Bug 465353 for more work here.
Comment 10 Dominik G. CLA 2015-05-28 05:52:25 EDT
Created attachment 253885 [details]
introduced rendering problem

The last commit has the side effect that simple trim widgets (like http://stackoverflow.com/a/10331418) registered via the org.eclipse.ui.menus extension point were no more rendered correctly.
If I remove the last commit everything looks fine. I have attached a screenshot that shows the rendering problem in our RCP application.
Comment 11 Lars Vogel CLA 2015-05-28 06:08:09 EDT
(In reply to Dominik G. from comment #10)
> Created attachment 253885 [details]
> introduced rendering problem
> 
> The last commit has the side effect that simple trim widgets (like
> http://stackoverflow.com/a/10331418) registered via the org.eclipse.ui.menus
> extension point were no more rendered correctly.
> If I remove the last commit everything looks fine. I have attached a
> screenshot that shows the rendering problem in our RCP application.

Which platform? Please attach an example RCP application which demonstrates the problem.
Comment 12 Dominik G. CLA 2015-05-29 03:15:30 EDT
Created attachment 253916 [details]
Sample RCP Product

I have attached a sample product that has two trim widgets. One in the main toolbar that has a text control and one in the status line that has a combo control.
My platform is Windows 7 (64bit), Java 8 (64bit), eclipse 4.5RC1.
Comment 13 Dominik G. CLA 2015-05-29 03:16:07 EDT
Created attachment 253917 [details]
Sample RCP Product
Comment 14 Christian Walther CLA 2015-11-23 04:58:56 EST
I am seeing the same regression on Windows 7 with an Eclipse (IDE) plugin on Mars.1 that used to work correctly on Kepler. With this change, our trim bar control contribution gets a fixed height of 7 pixels, which makes it unusable. Reverting this change returns it to the previous fixed height of 22 pixels (which is not ideal either, but acceptable).

Since the change looks reasonable, it seems like this might only have worked by chance before. However, I have not been able to figure out where the 7 pixels come from that appear to be caused by the additional WM_SETREDRAW Windows messages caused by this change. I am wondering why the SWT ToolBar is implemented using a Win32 Toolbar at all, as that just seems to result in a whole bunch of quirks and limitations.
Comment 15 Eclipse Genie CLA 2020-05-05 14:50:19 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 16 Rolf Theunissen CLA 2020-08-16 14:45:18 EDT
The original context of this bug was fixed by the commits.

The regression of caused by this bug, or the behavior it uncovered, is also reported as Bug 471313.