#1081 Qt: resizing makes plot "tremble/shake"

None
open
nobody
qt (12)
2017-05-27
2012-01-11
No

When I magnify plotting area in Qt terminal, it seems that there are two processes competing:
- Qt tries to center the plot (and move upper left corner towards down and right)
- gnuplot replots it to make it bigger

The first effect usually happens if something is configured to be centered (as opposed to be attached to left & top border). This is indeed very useful when replotting is switched off, so that even if one resizes the plot in one direction, it stays nicely centered. But when auto resize is off, the effect is somewhat annoying.

This is a low priority, and might be easy to fix (just one or two settings of how the plot is placed on canvas).

I have some problems explaining the problem without sending a video.

Discussion

  • Ethan Merritt

    Ethan Merritt - 2014-01-29
    • status: open --> pending-works-for-me
    • Group: --> 5.0
     
  • Ethan Merritt

    Ethan Merritt - 2014-01-29

    Qt resizing code has been re-written.
    Please re-evaluate whether this problem still exists.

     
  • Bastian Märkisch

    On Windows, I am experiencing something similar: when dragging the window frame with the mouse to enlarge the window, the plot "shakes": the plot is redrawn and the window is temporarily resized (made smaller) again. This does not happen when making the window smaller.

     
  • Bastian Märkisch

    • labels: --> qt
    • status: pending-works-for-me --> pending
    • Priority: 5 --> 6
     
  • Bastian Märkisch

    This problem still applies on Windows.

     
  • Bastian Märkisch

    Attached is a screen video showing the problem. Replot on resize is turned on.

     
  • Bastian Märkisch

    • status: pending --> open
    • Group: -->
    • Priority: 6 -->
     
  • Bastian Märkisch

    Still a problem in version 5.0.4 on Windows.

     
  • Bastian Märkisch

    With newer Qt / Windows versions this problem now got more severe: While resizing the qt window with the mouse the graph is not updated at all. Only when releasing the mouse button the series of resize / redraw events is applied: the window is changed to almost the original size and the replot is applied, followed by a sequence of these window size changes and replots. Depending on the plot, the subsequent iterations are discarded, though.

    I think there are several (design) issues with the "replot-on-resize" feature:

    • qt_graphics() always sends a window-resize request to the qt terminal process. If processing of replots is slow, several replot events might haven been queued and gnuplot_qt will change the window size back to an "earlier" size of the window. In my opinion, this unconditional resize is superfluous and (partial) cause of the observed behaviour.
    • At least on Windows, the QLockalSocket on the terminal end needs to be flushed to force timely 'replot' event transmission to the gnuplot core.
    • qt_waitforinput() could be called recursively during a "replot-on-resize" event. At least the Windows code is not prepared for this
    • qt_sendFont() discards all pending events from the qt terminal, which possibly includes more resize/replot events.

    At this stage I do not have a concrete proposal which make it work on Windows. Locally, I put in hacks to avoid all of the above issues, but still resize-on-replot still does not work as intended. Ideas welcome.

     
  • Ethan Merritt

    Ethan Merritt - 2017-05-27

    I still don't see this effect, or at least I don't see much difference between on/off for "replot on resize". I am a bit surprised that it cannot redraw more smoothly while resizing, but the window itself doesn't suffer from any of the craziness shown in the video attached above. I'm guessing there is some window manager setting that is causing it to fight with gnuplot for who gets to redraw the window.
    Do you see the same jittery window resizing if you toggle off "replot on resize"?

     
    • Bastian Märkisch

      FWIW, I did see a similar effect on a Linux machine now. It appeared when resizing a plot with a massive number of datapoints. Interestingly, I cannot reproduce this using a remote login over an internet connection.

       

Log in to post a comment.