From: Soeren Apel Date: Tue, 30 May 2017 06:01:25 +0000 (+0200) Subject: TraceView: Improve the way we do the initial scrolling setup X-Git-Tag: pulseview-0.4.0~63 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=5f9b7de5c8c71801141d35497786bf57f75e3ca4;hp=5f9b7de5c8c71801141d35497786bf57f75e3ca4 TraceView: Improve the way we do the initial scrolling setup The two commits ae5f66281c38a76dcb7011907d7a86a99b9dd4dd and 66e4eae9ce743016c3f6d4974bceb9b7fc0ae7d7 Were okay but it showed that there was one case they didn't cover: the first session receives a resize notification upon startup whereas all other sessions don't. This means that sessions restored from a previous run suddenly see the size_finalized_ variable always staying at false - until the user resizes the window. While figuring out how to cover this case, I realized that there is actually an easier way to perform all this: instead of keeping an internal state of when and how we received useless and useful resize notifications, we just act upon the "show" event, which always comes after all the widget resizing has been performed. This way, we can remove the size_finalized_ variable completely and as it is definitely always received when a session is shown, we always end up in a sane and correct state. Note: to reproduce, open up a 2nd session and use demo. Then, when using the group handle to move the analog traces upwards, you'll notice that the logic traces will move down at the same time. This is because size_finalized_ is false and the view will always center the traces vertically. ---