[gtk+] Revert parts of "window: Remove useless functions"
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Revert parts of "window: Remove useless functions"
- Date: Wed, 14 Nov 2012 19:13:30 +0000 (UTC)
commit 5671a869c23a33db1941e4ada8cc5d3b880b6424
Author: Benjamin Otte <otte redhat com>
Date: Wed Nov 14 19:35:47 2012 +0100
Revert parts of "window: Remove useless functions"
This reverts the size_allocate removal from commit
8449e05865b42a8c78b96f809b280aa5a4f044d8. That code was using
_gtk_window_set_allocation() instead of gtk_widget_set_allocation(). And
that broke glade.
gtk/gtkwindow.c | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index bc2a051..26cd8f6 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -328,6 +328,8 @@ static void gtk_window_map (GtkWidget *widget);
static void gtk_window_unmap (GtkWidget *widget);
static void gtk_window_realize (GtkWidget *widget);
static void gtk_window_unrealize (GtkWidget *widget);
+static void gtk_window_size_allocate (GtkWidget *widget,
+ GtkAllocation *allocation);
static gboolean gtk_window_map_event (GtkWidget *widget,
GdkEventAny *event);
static gint gtk_window_configure_event (GtkWidget *widget,
@@ -473,7 +475,6 @@ static void gtk_window_buildable_custom_finished (GtkBuildable *buildable,
const gchar *tagname,
gpointer user_data);
-
static void ensure_state_flag_backdrop (GtkWidget *widget);
G_DEFINE_TYPE_WITH_CODE (GtkWindow, gtk_window, GTK_TYPE_BIN,
@@ -574,6 +575,7 @@ gtk_window_class_init (GtkWindowClass *klass)
widget_class->unmap = gtk_window_unmap;
widget_class->realize = gtk_window_realize;
widget_class->unrealize = gtk_window_unrealize;
+ widget_class->size_allocate = gtk_window_size_allocate;
widget_class->configure_event = gtk_window_configure_event;
widget_class->key_press_event = gtk_window_key_press_event;
widget_class->key_release_event = gtk_window_key_release_event;
@@ -5586,6 +5588,30 @@ _gtk_window_set_allocation (GtkWindow *window,
}
}
+static void
+gtk_window_size_allocate (GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ GtkWindow *window = GTK_WINDOW (widget);
+ GtkAllocation child_allocation;
+ GtkWidget *child;
+ guint border_width;
+
+ _gtk_window_set_allocation (window, allocation);
+
+ child = gtk_bin_get_child (&(window->bin));
+ if (child && gtk_widget_get_visible (child))
+ {
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (window));
+ child_allocation.x = border_width;
+ child_allocation.y = border_width;
+ child_allocation.width = MAX (1, allocation->width - border_width * 2);
+ child_allocation.height = MAX (1, allocation->height - border_width * 2);
+
+ gtk_widget_size_allocate (child, &child_allocation);
+ }
+}
+
static gint
gtk_window_configure_event (GtkWidget *widget,
GdkEventConfigure *event)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]