Bug 510240 - [Cocoa] SWT.TOOL-shell influences the painting of TreeItems
Summary: [Cocoa] SWT.TOOL-shell influences the painting of TreeItems
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.7   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2017-01-11 05:08 EST by Thomas Singer CLA
Modified: 2020-12-11 04:29 EST (History)
2 users (show)

See Also:


Attachments
Sample code to reproduce (1.92 KB, text/plain)
2017-01-11 05:09 EST, Thomas Singer CLA
no flags Details
Screenshot while holding the left mouse button pressed (or without using SWT.TOOL) (18.65 KB, image/png)
2017-01-11 05:11 EST, Thomas Singer CLA
no flags Details
Screenshot with using SWT.TOOL after releasing the mouse button (17.69 KB, image/png)
2017-01-11 05:12 EST, Thomas Singer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Singer CLA 2017-01-11 05:08:50 EST
Please run the attached sample code on OS X (I'm using OS X 10.11). While clicking the nodes with the left mouse button, the background is painted in full width, but after releasing the mouse, only a part of the item's background is painted.

If the SWT.TOOL option is not used for the shell, then the whole tree item's background is painted correctly, independent of the mouse-down state.
Comment 1 Thomas Singer CLA 2017-01-11 05:09:35 EST
Created attachment 266224 [details]
Sample code to reproduce
Comment 2 Thomas Singer CLA 2017-01-11 05:11:41 EST
Created attachment 266225 [details]
Screenshot while holding the left mouse button pressed (or without using SWT.TOOL)
Comment 3 Thomas Singer CLA 2017-01-11 05:12:21 EST
Created attachment 266226 [details]
Screenshot with using SWT.TOOL after releasing the mouse button
Comment 4 Thomas Singer CLA 2017-01-11 05:13:39 EST
Unfortunately, we need to use the SWT.TOOL option to work-around the bug 470062.
Comment 5 Thomas Singer CLA 2017-01-11 06:19:59 EST
Even without the SWT.TOOL there is a problem if a selection listener sets the selection again (this is the essence of existing code stripped by unrelated code):

		tree.addListener(SWT.Selection, event -> {
			final TreeItem[] selection = tree.getSelection();
			if (selection.length == 1) {
				tree.setSelection(selection[0]);
				tree.showItem(selection[0]);
			}
		});
Comment 6 Eclipse Genie CLA 2020-12-11 00:08:03 EST
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 7 Thomas Singer CLA 2020-12-11 04:29:05 EST
Bug still can be reproduced with SWT 4_18_maintenance on macOS 10.14.