[gtk+] sizegroups: Use is_visible() instead of get_mapped() for visibility
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] sizegroups: Use is_visible() instead of get_mapped() for visibility
- Date: Sun, 4 Nov 2012 14:36:01 +0000 (UTC)
commit be1bde91112c80ddc475547db0d5cfabdff7f046
Author: Benjamin Otte <otte redhat com>
Date: Fri Nov 2 00:44:30 2012 +0100
sizegroups: Use is_visible() instead of get_mapped() for visibility
The current approach of using gtk_widget_get_mapped() is broken:
The usual steps taken when showing a window are:
(1) request the sizes
(2) allocate the sizes
(3) show the window in the allocated size
Showing the window with a random size between steps (1) and (2) would of
course
result in extra work and potential flickering when the widgets get
resized to
their proper sizes.
However, as GtkSizeGroup::ignore-hidden uses gtk_widget_get_mapped() to
determine visibility for a widget, the following will happen:
(1) the widget will request a 0 size
(2) the widget will be allocated a 0 size
(3) the widget will be too small when it is shown
gtk_widget_get_visible() however is set in advance. Note that toggling
visibility also causes a gtk-widget_queue_resize() call already so we
take care of changes in here automatically.
gtk/gtksizegroup.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c
index 3385e04..b9e2ac3 100644
--- a/gtk/gtksizegroup.c
+++ b/gtk/gtksizegroup.c
@@ -165,7 +165,7 @@ add_widget_to_closure (GtkWidget *widget,
*widgets = g_slist_prepend (*widgets, widget);
_gtk_widget_set_sizegroup_visited (widget, TRUE);
- hidden = !gtk_widget_get_mapped (widget);
+ hidden = !gtk_widget_is_visible (widget);
for (tmp_groups = _gtk_widget_get_sizegroups (widget); tmp_groups; tmp_groups = tmp_groups->next)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]