At startup and as well when one moves panel, resizePanel is called
multiple times. For instance, at startup resizePanel is called 8 times
in row from different callers.
So add timer to do panel resize in one go. This will avoid multiple
resize.
davidedmundson |
Plasma |
At startup and as well when one moves panel, resizePanel is called
multiple times. For instance, at startup resizePanel is called 8 times
in row from different callers.
So add timer to do panel resize in one go. This will avoid multiple
resize.
Resized, and moved my panel, worked without any obvious regressions. also added
debug statement in the resizePanel, which got printed just 3 times at startup
with this patch while before it was getting printed 8-9 times.
No Linters Available |
No Unit Test Coverage |
100% no. Timers with magic timeout values are a "let's hope it works out if we wait a bit" anti-pattern to paper over figuring out proper update logic.
Idea of using QQmlParserStatus is fine and it might save some cycles at start but problem remains same when I move panel around.. I don't think QQmlParser status can help there..(?)
adding an event compression timer (that by the way, it's a perfectly fine, many times even desired thing) and solving the useless restore() calls at startup are two ortogonal pissues.
an event compression there *may* be a good thing if during the normal use (like, dragging panels around) things like setLength() still get called too much.
but right now as the main problem is the startup issue, is too soon to put this in, as it hides the real problem
Double restore() issue was fixed by other commits..
an event compression there *may* be a good thing if during the normal use (like, dragging panels around) things like setLength() still get called too much.
In my testing, moving panel from bottom edge to right edge calls resizePanel 78 times.. and moving between two screens it calls it 179 times, IMO this are high numbers to require event compression.
but right now as the main problem is the startup issue, is too soon to put this in, as it hides the real problem
I agree that we will need to solve startup issue, probably using QQmlParserStatus at proper place..
ok, so let's try to do the QQmlParserStatus thing (can you give a stab at it?) then when it's working and we know solves the startup issues, we reconsider this one again?