[polari] userList: Postpone propagating height until content limit is set
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] userList: Postpone propagating height until content limit is set
- Date: Mon, 10 Oct 2016 21:27:25 +0000 (UTC)
commit 240afe9d02364ac867564eb37bbf064fb269e610
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Oct 10 22:20:25 2016 +0200
userList: Postpone propagating height until content limit is set
For the user list popover to work as intended, we have to set both
:max-content-height - to limit the number of displayed entries - and
:propagate-natural-height - to actually request more than the minimum
height. As computing the former requires the rows' allocations, we
can only set it after the initial size request, however we currently
set the latter immediately. As a result, there's a short span where
the popover is set to request the full content height, which at best
leads to a visual glitch when the popover briefly flashes at full
height, and in the worst case will crash when the windowing system's
limits are exceeded. Fix this by only propagating the height once
the maximum content height is set as well.
https://bugzilla.gnome.org/show_bug.cgi?id=771557
src/userList.js | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/userList.js b/src/userList.js
index 4019296..581f61c 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -372,8 +372,7 @@ const UserList = new Lang.Class({
this.parent({ hexpand: true,
shadow_type: Gtk.ShadowType.ETCHED_IN,
hscrollbar_policy: Gtk.PolicyType.NEVER,
- propagate_natural_width: true,
- propagate_natural_height: true });
+ propagate_natural_width: true });
this._list = new Gtk.ListBox({ vexpand: true });
this.add(this._list);
@@ -475,6 +474,7 @@ const UserList = new Lang.Class({
height += this._list.get_row_at_index(index + i).get_allocated_height();
this.max_content_height = height;
+ this.propagate_natural_height = true;
this._updateHeightId = 0;
return GLib.SOURCE_REMOVE;
}));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]