mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
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: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5411
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5469
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2989>
(cherry picked from commit 23bcff3348)
This commit is contained in:
parent
198e6f5cfc
commit
495967905c
1 changed files with 2 additions and 1 deletions
|
|
@ -456,11 +456,12 @@ var Calendar = GObject.registerClass({
|
|||
return;
|
||||
|
||||
this._selectedDate = date;
|
||||
this._update();
|
||||
|
||||
let datetime = GLib.DateTime.new_from_unix_local(
|
||||
this._selectedDate.getTime() / 1000);
|
||||
this.emit('selected-date-changed', datetime);
|
||||
|
||||
this._update();
|
||||
}
|
||||
|
||||
updateTimeZone() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue