Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 475313 - [GTK] incorrect Sash positioning when dragging
Summary: [GTK] incorrect Sash positioning when dragging
Status: CLOSED DUPLICATE of bug 522140
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.5   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-18 22:53 EDT by Alexander Burdukov CLA
Modified: 2018-04-11 11:30 EDT (History)
2 users (show)

See Also:


Attachments
Incorrect Sash postion (73.66 KB, image/png)
2015-08-18 22:53 EDT, Alexander Burdukov CLA
no flags Details
Simple snippet to reproduce the issue (1.27 KB, text/plain)
2015-09-25 17:27 EDT, Alexander Burdukov CLA
no flags Details
Screenshot with the issue reproduced by the attached snippet (4.50 KB, image/png)
2015-09-25 17:28 EDT, Alexander Burdukov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Burdukov CLA 2015-08-18 22:53:29 EDT
Created attachment 255939 [details]
Incorrect Sash postion

Dragging Sash with SWT.SMOOTH | SWT.VERTICAL style causes incorrect Sash bounds if attempt to drag Sash outside of valid area is performed (i.e., to a position when left or right widgets width can become less than minimum allowed value).

Only vertical Sash on GTK is affected.

To reproduce, try to drag Sash in Eclipse Preferences dialog sharply to left/right several times (so the minimum width of left panel with preferences tree is reached), than release mouse button. As the result there is no Sash between left and right panels anymore and you cannot drag it again (resizing dialog workarounds the issue).

Also, please, see attached screenshot of our custom dialog as another example of this issue.

It seems bug at org.eclipse.swt.widgets.Sash.gtk_motion_notify_event method.
In the end of this method you can see following code:

if ((style & SWT.SMOOTH) != 0) {
    setBounds (event.x, lastY, width, height);
    // widget could be disposed at this point
}

In this code event.x should be changed to lastX (see the simular method for Windows platform org.eclipse.swt.widgets.Sash.WM_MOUSEMOVE, where the X coordidate of Sash bounds sets correctly to lastX).
Comment 1 Alexander Kurtakov CLA 2015-08-20 00:48:45 EDT
Would you please attach a snippet to test the code and even submit gerrit patch for fixing the issue?
Comment 2 Alexander Burdukov CLA 2015-09-25 17:27:43 EDT
Created attachment 256857 [details]
Simple snippet to reproduce the issue
Comment 3 Alexander Burdukov CLA 2015-09-25 17:28:14 EDT
Created attachment 256858 [details]
Screenshot with the issue reproduced by the attached snippet
Comment 4 Alexander Burdukov CLA 2015-09-25 17:32:15 EDT
Snippet and corresponding screenshot are attached.
There is nothing special with this snippet, it is simple SashForm with two Text widgets inside. I have only colored the background of the Sash widget via reflection for better understanding of the problem.

To reproduce:
1. Run the snippet.
2. Quickly move sash to the left and right. Note during these movements you should move mouse outside of the left and right window borders to reproduce the issue.
Comment 5 Eric Williams CLA 2018-04-11 11:30:01 EDT
This has been fixed in M7.

*** This bug has been marked as a duplicate of bug 522140 ***