Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Layout does not get preserved between multiple launches of git-cola #848
I have tried almost anything but each time I run git-cola the layout configuration gets resized a few pixels.
The vertical splitter jumps a few pixels to the right and so do the horizontal splitters (more to the top)
Testing the current git master. What can I do to help to fix this issue?
I wanted to debug this and while testing I have figured out the issue occurs only when the window is maximazed. If it's not maximized/fullscreen then it works properly. Although between restarts of "git-cola" the window slightly moves to the left a few pixels until it gets aligned with x=0. Somebody should look at this.
Thanks for the heads-up. What OS are you using? If Linux, what window manager? I'll see if I can reproduce it.
To help debug it, the code that applies the saved window settings are the
We're using Qt's built-in
One tweak worth trying is running the base class WidgetMixin.apply_state() after the stuff done in the MainWindowMixin's apply_state() (rather than at the very beginning, as is currently done).
It's possible that could work around it, since we'd be maximizing after restoring the state, outside of Qt's control. We'll see... it's hard to know without knowing more details.
Thank you David.
I have also tried the tweak as you mentioned above and it also does not seem to help.
I started git-cola with the default settings and moved the vertical splitter to the left (it was in the center by default). Then restarted and it does not stay in position.
I haven't tested it on Windows as I abandonded that OS some time ago :)
Me too ;-) thanks for the verification.
I'm able to reproduce the issue now. I see why I wasn't able to before -- my layout was always within the margins where the widget sizes wouldn't trigger it. I think I have a solution that should solve this nicely. Thanks for the heads-up.
Today I learned that I shouldn't try to implement my own window maximized and sizing logic -- just let Qt's saveGeometry / restoreGeometry handle it. We have custom logic for restoring window sizes, and that seems to be the core issue.
This should be much better behaved now. One issue remains, but it's a tiny one.
On the very first launch, when no settings are present, the middle splitter can't be resized. Once we restart the app, this issue goes away, and everything works as expected. That is a Qt5-only bug. I tested Qt4 and it does not exhibit that behavior:
This lines up with some bugs that have been submitted against Qt, and explains why we didn't see this in the past:
In any case, this should be a non-issue in practice now. Qt4 should be fine, and Qt5 will be fine once you start up and shutdown the app once with the new code.