letsfindaway / OpenBoard

I'm using this fork to contribute features and fixes to the upstream project. In order to create good pull requests, I'm rebasing my feature branches, squashing and reordering commits, etc. If you fork this repository be aware that my development branches may rewrite history without prior notice.
http://openboard.ch/
GNU General Public License v3.0
9 stars 0 forks source link

Size of left and right palette changes #125

Closed letsfindaway closed 1 year ago

letsfindaway commented 1 year ago

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.

letsfindaway commented 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.

letsfindaway commented 1 year ago

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.

letsfindaway commented 1 year ago

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?

kaamui commented 1 year ago

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.

letsfindaway commented 1 year ago

Suppressing resize events while resetting geometry fixes this problem. Associated PR was merged.