altTab: fix Alt+Tab scrolling on initial display

The initial selection of the Alt+Tab dialog was happening before the
dialog was shown and allocated, and so the "do we need to scroll"
check used bogus coordinates. Fix by showing the dialog (and forcing
an allocation) first.

https://bugzilla.gnome.org/show_bug.cgi?id=647807
This commit is contained in:
Dan Winship 2011-04-18 09:52:21 -04:00 committed by Adel Gadllah
parent d2a16bca10
commit fe08edbe2b

View File

@ -145,6 +145,12 @@ AltTabPopup.prototype = {
this._appIcons = this._appSwitcher.icons;
// Need to force an allocation so we can figure out whether we
// need to scroll when selecting
this.actor.opacity = 0;
this.actor.show();
this.actor.get_allocation_box();
// Make the initial selection
if (switch_group) {
if (backward) {
@ -174,8 +180,6 @@ AltTabPopup.prototype = {
return false;
}
this.actor.opacity = 0;
this.actor.show();
Tweener.addTween(this.actor,
{ opacity: 255,
time: POPUP_FADE_TIME,