Community
Participate
Working Groups
On GTK, the rectangle for the SWT Tracker class stops following the mouse after moving the mouse a few pixels. After moving it slightly farther, it disappears entirely. It also stops firing the SWT.MouseMove event after the tracker disappears. Easily reproduced using both of the SWT Tracker snippets (Snippet31 and Snippet23).
My bad. I see no evidence that the SWT.Move event is missing... but the tracker is disappearing.
Created attachment 261420 [details] My video
Stefan, please take a look at the video. I can't experience what you describe. My system is Fedora 24/Gtk 3.20 , can it be smth caused by additional things loaded in your env?
(In reply to Alexander Kurtakov from comment #3) > Stefan, please take a look at the video. I can't experience what you > describe. My system is Fedora 24/Gtk 3.20 , can it be smth caused by > additional things loaded in your env? I get the same result -- can't reproduce this bug.
My bad. I forgot to include an important reproduction step. On the line that instantiates the Tracker, change the code to use the version that accepts a Display rather than the version that accepts a Shell. Tracker tracker = new Tracker (display, SWT.NONE); So for example: public class Snippet23 { public static void main (String [] args) { Display display = new Display (); final Shell shell = new Shell (display); shell.open (); shell.addListener (SWT.MouseDown, e -> { Tracker tracker = new Tracker (display, SWT.NONE); tracker.setRectangles (new Rectangle [] { new Rectangle (e.x, e.y, 100, 100), }); tracker.open (); }); while (!shell.isDisposed()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); } } I also see the following in the log: (SWT:8101): Gdk-CRITICAL **: gdk_frame_clock_request_phase: assertion 'GDK_IS_FRAME_CLOCK (frame_clock)' failed
I tried using the Shell constructor as a workaround, but encountered bug 493477.
I can reproduce the problem using Snippet31 and Snippet23 (modified) but only on GTK2, GTK3 seems to work fine, is that what you noticed too Stefan? Also, with GTK2, in my case, the tracker was not appearing at all for both snippets, I tried on Ubuntu 15.10.
> I can reproduce the problem using Snippet31 and Snippet23 (modified) but > only on GTK2, GTK3 seems to work fine, is that what you noticed too Stefan? No, I'm only seeing this on GTK3. On GTK2, I get bug 493477 instead. With the Display constructor I still receive the events on GTK2 but not on GTK3 (verified by adding a System.out.println that spits out the current time. > Also, with GTK2, in my case, the tracker was not appearing at all for > both snippets, I tried on Ubuntu 15.10. Yes, that happens for me, too. The tracker rectangle disappears entirely while moving the mouse and only reappears when the mouse is stationary. This isn't a problem for the Eclipse platform, though, since the platform always moves the Tracker rectangle offscreen so it can't be seen during drags. Platform only uses the Tracker as a mechanism for capturing the mouse events and setting the cursor globally.
Arun, I've been trying to reach you over email for a couple months. Is your spam filter blocking emails from my @google.com address?
I have taken a look at it and was able to reproduce this on GTK3. Initially, the bug would be that the rectangle would not draw correctly if you moved too fast when dragging. After restarting my computer, I was able to get the rectangle loading correctly again, however it would display the rectangle if you dragged your mouse slowly. If you moved fast, the rectangle would pause and delay, then draw on top of your mouses latest location. I did some println time statements and found that its not caused by any inherent function in SWT, but likely caused by how GTK3 deals with drawing images in a "queue" lineup. The timestamps would all post correctly in a batch, meaning its not stuck on any function, but the process itself was delayed. I think GTK3 is perhaps setting the function as a low priority in their queueing system, causing a delay in fast/often executed draw function.
Potentially related: 498217: [GTK3] Dragging parts does not show rectangle https://bugs.eclipse.org/bugs/show_bug.cgi?id=498217
(In reply to Leo Ufimtsev from comment #11) > Potentially related: > 498217: [GTK3] Dragging parts does not show rectangle > https://bugs.eclipse.org/bugs/show_bug.cgi?id=498217 Nope, it appears that the issues are somewhat separate. I tested the snippet above on Gtk3.6, Gtk3.8, ...... Gtk3.20. The tracker is unreliable on all these gtk version. But the part-dragging issue above appears only in Gtk3.10 and onwards, but part-dragging works well on gtk3.6, gtk3.8.
Updating status as there still seems to be problems on newer Gtk3 versions.
The snippet behaves somewhat properly -- right now if you run the snippet with a Display as the argument, the rectangle does appear but it's offset incorrectly to the left by about the Shell size. Likely the event or drawing coordinates are off.