Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 513153

Summary: Connection visual is seldom redrawn when moving
Product: [Tools] GEF Reporter: Victor Johnsson <victor.johnsson>
Component: GEF MVCAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.wienand, victor.johnsson
Version: unspecified   
Target Milestone: 5.0.0 (Oxygen) M6   
Hardware: PC   
OS: Windows 10   
Whiteboard:
Attachments:
Description Flags
Seldom redrawn 5.0.0.201702250303
none
Continuously redrawn 5.0.0.201612310303
none
Seldom redrawn 5.0.0.201702250303 none

Description Victor Johnsson CLA 2017-03-06 08:07:00 EST
Created attachment 267113 [details]
Seldom redrawn 5.0.0.201702250303

When moving connections the visual is seldom redrawn. This happens in the GEF logo example when run as an Eclipse plugin.

How to reproduce:
1. Grab an end point of a connection.
2. Drag it around and keep moving.
Expected: The visual is redrawn continuously when moving the end point.
Actual: The visual is seldom redrawn when moving the end point.

The first attached gif shows the behavior in integration release 5.0.0.201702250303.

This problem did not exist in the integration release 5.0.0.201612310303, see the second attached gif.
Comment 1 Victor Johnsson CLA 2017-03-06 08:08:08 EST
Created attachment 267114 [details]
Continuously redrawn 5.0.0.201612310303
Comment 2 Victor Johnsson CLA 2017-03-06 08:11:38 EST
Created attachment 267115 [details]
Seldom redrawn 5.0.0.201702250303
Comment 3 Matthias Wienand CLA 2017-03-07 05:39:04 EST
I cannot reproduce the issue on my system (linux), however, I guess the problematic code is in FXCanvasEx, where the SWT widget is explicitly redrawn during event dispatching (EventDispatcherEx). Additionally to the redraw() call, maybe an update() call is necessary on Windows systems to keep the canvas redrawn continuously. As a workaround, I propose to replace FXCanvasEx with an implementation that calls redraw() and update() during event dispatching.
Comment 4 Victor Johnsson CLA 2017-03-10 10:12:58 EST
Thank you, that solved it!
Comment 5 Matthias Wienand CLA 2017-03-10 10:23:02 EST
Thank you for trying it out. I will talk to Alexander about the issue, and probably use different refresh/update code depending on the OS. The last time we changed the refresh code, it was because we experienced significant performance problems when calling update(). Hence, the workaround might be harmful on some platforms/systems.
Comment 6 Matthias Wienand CLA 2017-03-14 09:28:43 EDT
I added a check so that on Windows systems, the update() call is performed after redraw(). The code is published on the master branch, therefore, I resolve this ticket as fixed for 5.0.0 M6.