Closed letsfindaway closed 1 year ago
This is caused by calling controlWidget->showNormal();
in the display manager due to my "fix" of screen change handling. This call is too early, and the sizes of the widgets are still unknown.
When resetting the geometry with setGeometry(QRect())
the size of the widgets collapses to a default size. This triggers a resize event which calls UBRightPalette::updateMaxWidth()
. This reduces the size of the palette. So either we have to remove that call, or we have to avoid the adjustment of the palette size in this case.
As @kaamui said that resetting the geometry works better in some cases, we probably have to handle that in the resize event handler.
Some more experiments verified that setting
controlWidget->setGeometry(QRect());
initiates resize events for the board view collapsed to a minimum of 400x94 pixels. We would have to avoid forwarding this event further to avoid resizing of the palettes. This could be done by asking the UBDisplayManager
whether it is in the process of positioning the screens. However doing this would be an architectural mess and I want to avoid that.
@kaamui: in what situations is calling controlWidget->setGeometry(QRect());
the better choice?
If I remember well, we are talking about rare use cases, depending (on Ubuntu/Gnome only), on which screen is the primary one (the one having the "Activities" toolbar), with screens ordered from right to left. And I'm not a 100% sure about the following assertion, but I think non of these placement issues weren't fixed by simply restarting so...
It's not worth it, imo. Actually, in Geneva schools, we have zero schools where it is the case. I think the action should be to add under the input that changing displays may need that OpenBoard restarts for them to be taken into account correctly.
Suppressing resize events while resetting geometry fixes this problem. Associated PR was merged.
I started showing the left and/or right palette. Then I resized them to my needs. After closing and re-opening OpenBoard, the palette was resized to some fixed width.