Skip to content

calendar: Emit selected-date-changed before rebuilding the calendar

If the cursor was placed on one of the widgets that get removed when rebuilding the calendar due to a month change, destroying the hovered widget will trigger a repick. This repick can then trigger an allocation while not all buttons of the calendar are present.

If the last allocation before selected-date-changed is emitted was from such an incomplete state, DateMenuButton will still freeze the layout in this state in its signal handler.

What freezing the layout in DateMenuButton is supposed to do is to prevent size changes of the menu when changing days, but for this the layout needs to be frozen before potentially rebuilding calendar. This change ensures that by emitting the signal earlier.

Closes: #5411 (closed) Closes: #5469 (closed)

Merge request reports