Bug 436766 - SashForm Sash SWT.DRAG Event.detail different on swt 3.102 (and 3.103) compared to 3.100
Summary: SashForm Sash SWT.DRAG Event.detail different on swt 3.102 (and 3.103) compar...
Status: CLOSED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2014-06-06 01:57 EDT by Adrian G CLA
Modified: 2019-02-21 15:28 EST (History)
1 user (show)

See Also:


Attachments
Example source code (10.26 KB, application/x-java-archive)
2014-06-06 01:57 EDT, Adrian G CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian G CLA 2014-06-06 01:57:37 EDT
Created attachment 244027 [details]
Example source code

I note that the handing of SWT.DRAG in org.eclipse.swt (3.100.1) is different to (3.102.1).
The 3.100.1 version makes more sense to me. A Sash drag event has an event.detail == SWT.DRAG, however in 3.102.1 it does not.

I have attached an example. I created a dummy ModifiedSashForm and added a print to console call at line 290. This shows the different properties of event.detail in the onDragSash(Event) method, depending on which version of swt is used.
Comment 1 Adrian G CLA 2014-06-07 11:06:57 EDT
I am using Linux with GTK3.

In SWT version 3.102.1 of the OS class initialization there is:
USE_CAIRO = useCairo || OS.GTK3;

and in the Sash class:
static int checkStyle (int style) {
	if (OS.USE_CAIRO) {
		style |= SWT.SMOOTH;
	}
	return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
}

in SWT version 3.100.1 in the Sash class the checkStyle method is:
static int checkStyle (int style) {
	return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
}

then in both version 3.100.1 and 3.102.1 Sash classes in the gtk_button_press_event(..) mthod is
..
	if ((style & SWT.SMOOTH) == 0) {
		event.detail = SWT.DRAG;
	}
..
so in 3.102.1 GTK3 environment SWT.DRAG is not enabled by default (unlike 3.100.1) - and thus in the SashForm onDragSash(Event event) a selection event is not differentiated from a drag event.

This is causing problems for me as I have a lot of on screen real estate to update - and I only want to update it at the end of the drag.

I see that the the current SWT version for Luna, 3.103 contains the same GTK3 SWT.DRAG problems as 3.102.
Comment 2 Eric Williams CLA 2019-02-21 15:28:18 EST
According to https://bugs.eclipse.org/bugs/show_bug.cgi?id=387641#c2

SWT.SMOOTH Sash's are a thing of the past. Also looking at the code I can tell that SWT.SMOOTH does nothing.

The solution to the bug is to stop using SWT.SMOOTH.