Community
Participate
Working Groups
In CTabFolder's onMouse(Event) handling of the SWT.MouseDown event, there is a fair amount of conditional blocks that prevents things from happening unless the first mouse button is the one that was clicked. This is not in place for tab selection. There are requests against platform to not select a part when the user right-clicks on it (bug 60833) and to close it when it's been middle-clicked (bug 258511). This behaviour can be observed on applications like Firefox and IE7. If I invoke Ctrl+H and bring up the search dialog, I can see that right-clicking and middle-clicking doesn't cause the tabs to switch. Can the same be implemented for CTabFolder?
Created attachment 120388 [details] Patch to potentially implement the feature request. I'm not familiar with SWT's code at all but I hope this patch will at least help illustrate what I'm requesting here.
Can anybody from SWT comment on this? I presume this probably won't make it into 3.5 because everyone's busy with the Cocoa port but is there any hope of getting it committed in the future or would this change in behaviour be considered a contract breach of some sorts?
I just checked the code (handling of mouse down for CTabFolder) and it was written carefully to change item selection when any button is pressed. I can actually switch tab using the back and foward button on my mouse. Steve: do you know why it was implemented like that ?
> Steve: do you know why it was implemented like that ? Nope. You could ask Veronika.
(In reply to comment #4) > > Steve: do you know why it was implemented like that ? > Nope. You could ask Veronika. I checked the CVS history and it seems that this any-button-goes behaviour is by design only (no technical reason for it). The last time we changed the code in this area was back in Feb/2004b (version 1.86->1.87) the comment was 'Cut over to new look'. Veronika, do you know of any reason why we shouldn't change this ?
I think we should just fix this. Can you think of any reason it was coded this way? Is it so that when a menu is popped up, the tab is switched and the context for the menu is right?
FH, fix it or close the bug.
Fixed in HEAD > 20090130 CTabFolder is fixed, you can verify it using CustomControlExample. Eclipse still has the problem, UI must have its own implemenation to handle mouse events.