]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkoffscreenwindow.c
filechooserbutton: New test for opening the Other item in the combo box and then...
[~andy/gtk] / gtk / gtkoffscreenwindow.c
index a787e6b66c53c2308f03bb9614f76b40bef339e8..8e9f23f02ce997649891ec1aa933c16e88b80851 100644 (file)
@@ -10,9 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  *
  * Authors: Cody Russell <crussell@canonical.com>
  *          Alexander Larsson <alexl@redhat.com>
@@ -22,6 +20,7 @@
 
 #include "gtkoffscreenwindow.h"
 #include "gtkwidgetprivate.h"
+#include "gtkcontainerprivate.h"
 #include "gtkprivate.h"
 
 /**
@@ -184,7 +183,7 @@ gtk_offscreen_window_realize (GtkWidget *widget)
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
   gtk_widget_set_window (widget, window);
-  gdk_window_set_user_data (window, widget);
+  gtk_widget_register_window (widget, window);
 
   child = gtk_bin_get_child (bin);
   if (child)
@@ -221,13 +220,10 @@ static void
 gtk_offscreen_window_show (GtkWidget *widget)
 {
   gboolean need_resize;
-  GtkContainer *container;
 
   _gtk_widget_set_visible_flag (widget, TRUE);
 
-  container = GTK_CONTAINER (widget);
-  need_resize = _gtk_container_get_need_resize (container) || !gtk_widget_get_realized (widget);
-  _gtk_container_set_need_resize (container, FALSE);
+  need_resize = _gtk_widget_get_alloc_needed (widget) || !gtk_widget_get_realized (widget);
 
   if (need_resize)
     gtk_offscreen_window_resize (widget);