[gtksourceview/gnome-3-20] CompletionContainer: chain-up in get_preferred_width/height()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/gnome-3-20] CompletionContainer: chain-up in get_preferred_width/height()
- Date: Thu, 19 May 2016 06:04:33 +0000 (UTC)
commit 443f97866fe492fd3a88ffeb172f3a92837dc9c7
Author: Sébastien Wilmet <swilmet gnome org>
Date: Thu May 19 07:52:26 2016 +0200
CompletionContainer: chain-up in get_preferred_width/height()
To fix this critical message:
Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion
'height >= 0' failed
Thanks to slaf for the suggestion on IRC.
gtksourceview/gtksourcecompletioncontainer.c | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletioncontainer.c b/gtksourceview/gtksourcecompletioncontainer.c
index db138ac..f36fcc0 100644
--- a/gtksourceview/gtksourcecompletioncontainer.c
+++ b/gtksourceview/gtksourcecompletioncontainer.c
@@ -2,7 +2,7 @@
/* gtksourcecompletioncontainer.c
* This file is part of GtkSourceView
*
- * Copyright (C) 2013, 2014 - Sébastien Wilmet <swilmet gnome org>
+ * Copyright (C) 2013, 2014, 2016 - Sébastien Wilmet <swilmet gnome org>
*
* GtkSourceView is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -78,6 +78,17 @@ _gtk_source_completion_container_get_preferred_width (GtkWidget *widget,
width = MIN (nat_size.width, get_max_width (container));
+ if (GTK_WIDGET_CLASS (_gtk_source_completion_container_parent_class)->get_preferred_width != NULL)
+ {
+ gint min_width_parent = 0;
+
+ GTK_WIDGET_CLASS (_gtk_source_completion_container_parent_class)->get_preferred_width (widget,
+
&min_width_parent,
+ NULL);
+
+ width = MAX (width, min_width_parent);
+ }
+
if (min_width != NULL)
{
*min_width = width;
@@ -158,6 +169,17 @@ _gtk_source_completion_container_get_preferred_height (GtkWidget *widget,
height = n_rows_allowed * row_height;
}
+ if (GTK_WIDGET_CLASS (_gtk_source_completion_container_parent_class)->get_preferred_height != NULL)
+ {
+ gint min_height_parent = 0;
+
+ GTK_WIDGET_CLASS (_gtk_source_completion_container_parent_class)->get_preferred_height
(widget,
+
&min_height_parent,
+ NULL);
+
+ height = MAX (height, min_height_parent);
+ }
+
if (min_height != NULL)
{
*min_height = height;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]