[arch-commits] CVS update of arch/build/lib/gtk2 (2 files)

Jan de Groot jgc at archlinux.org
Fri Jun 1 06:25:56 EDT 2007


    Date: Friday, June 1, 2007 @ 06:25:56
  Author: jgc
    Path: /home/cvs-arch/arch/build/lib/gtk2

Modified: PKGBUILD (1.94 -> 1.95)
          gtk2-2.10.12-filechooser-sizing.patch (1.1 -> 1.2)

upgpkg: gtk2 2.10.12-3
Fix filechooser resizing patch


---------------------------------------+
 PKGBUILD                              |   12 
 gtk2-2.10.12-filechooser-sizing.patch |  539 ++++++++++++++++----------------
 2 files changed, 281 insertions(+), 270 deletions(-)


Index: arch/build/lib/gtk2/PKGBUILD
diff -u arch/build/lib/gtk2/PKGBUILD:1.94 arch/build/lib/gtk2/PKGBUILD:1.95
--- arch/build/lib/gtk2/PKGBUILD:1.94	Sat May 12 09:31:35 2007
+++ arch/build/lib/gtk2/PKGBUILD	Fri Jun  1 06:25:55 2007
@@ -1,27 +1,27 @@
-# $Id: PKGBUILD,v 1.94 2007/05/12 13:31:35 jgc Exp $
+# $Id: PKGBUILD,v 1.95 2007/06/01 10:25:55 jgc Exp $
 # Maintainer: Jan de Groot <jgc at archlinux.org>
 
 pkgname=gtk2
 pkgver=2.10.12
-pkgrel=2
+pkgrel=3
 pkgdesc="The GTK+ Toolkit (v2)"
 arch=(i686 x86_64)
 url="http://www.gtk.org/"
 install=gtk2.install
-depends=('libjpeg' 'atk>=1.18.0-2' 'pango>=1.16.4' 'libxcursor' 'libxinerama' 'libxrandr>=1.2.1' 'libxi' 'libcups')
+depends=('atk>=1.18.0-2' 'pango>=1.16.4' 'libxcursor' 'libxinerama' 'libxrandr>=1.2.1' 'libxi' 'libcups')
 makedepends=('pkgconfig')
 replaces=('gtkprint-cups')
 conflicts=('gtkprint-cups')
-options=('nolibtool')
+options=('!libtool')
 backup=(etc/gtk-2.0/gtkrc)
 license=('LGPL')
 source=(http://ftp.gnome.org/pub/gnome/sources/gtk+/2.10/gtk+-${pkgver}.tar.bz2
 	gtk2-2.10.12-filechooser-sizing.patch)
-md5sums=('cf969c62134c662ff07e64613ed6c11f' 'a9f4ee6266c13ab1b712e06e0f8c12ac')
+md5sums=('cf969c62134c662ff07e64613ed6c11f' 'de098b87f00d1a3717accd1866598210')
 
 build() {
   cd ${startdir}/src/gtk+-${pkgver}
-  patch -Np1 -i ${startdir}/src/gtk2-2.10.12-filechooser-sizing.patch || return 1
+  patch -Np0 -i ${startdir}/src/gtk2-2.10.12-filechooser-sizing.patch || return 1
   ./configure --prefix=/usr --sysconfdir=/etc \
               --localstatedir=/var --with-xinput=xfree \
 	      --with-included-loaders=png
Index: arch/build/lib/gtk2/gtk2-2.10.12-filechooser-sizing.patch
diff -u arch/build/lib/gtk2/gtk2-2.10.12-filechooser-sizing.patch:1.1 arch/build/lib/gtk2/gtk2-2.10.12-filechooser-sizing.patch:1.2
--- arch/build/lib/gtk2/gtk2-2.10.12-filechooser-sizing.patch:1.1	Sat May 12 09:31:35 2007
+++ arch/build/lib/gtk2/gtk2-2.10.12-filechooser-sizing.patch	Fri Jun  1 06:25:56 2007
@@ -1,6 +1,8 @@
---- gtk+-2.10.12/gtk/gtkfilechooserembed.c.orig	2007-05-02 18:26:58.000000000 +0200
-+++ gtk+-2.10.12/gtk/gtkfilechooserembed.c	2007-05-08 17:21:44.000000000 +0200
-@@ -28,9 +28,7 @@ static void gtk_file_chooser_embed_class
+Index: gtk/gtkfilechooserembed.c
+===================================================================
+--- gtk/gtkfilechooserembed.c	(revision 17866)
++++ gtk/gtkfilechooserembed.c	(revision 17867)
+@@ -28,9 +28,7 @@
  static void delegate_get_default_size         (GtkFileChooserEmbed *chooser_embed,
  					       gint                *default_width,
  					       gint                *default_height);
@@ -11,7 +13,7 @@
  static gboolean delegate_should_respond       (GtkFileChooserEmbed *chooser_embed);
  static void delegate_initial_focus            (GtkFileChooserEmbed *chooser_embed);
  static void delegate_default_size_changed     (GtkFileChooserEmbed *chooser_embed,
-@@ -57,7 +55,7 @@ void
+@@ -57,7 +55,7 @@
  _gtk_file_chooser_embed_delegate_iface_init (GtkFileChooserEmbedIface *iface)
  {
    iface->get_default_size = delegate_get_default_size;
@@ -20,7 +22,7 @@
    iface->should_respond = delegate_should_respond;
    iface->initial_focus = delegate_initial_focus;
  }
-@@ -96,13 +94,11 @@ delegate_get_default_size (GtkFileChoose
+@@ -96,13 +94,11 @@
  {
    _gtk_file_chooser_embed_get_default_size (get_delegate (chooser_embed), default_width, default_height);
  }
@@ -38,7 +40,7 @@
  }
  
  static gboolean
-@@ -208,14 +204,10 @@ _gtk_file_chooser_embed_initial_focus (G
+@@ -208,14 +204,10 @@
    GTK_FILE_CHOOSER_EMBED_GET_IFACE (chooser_embed)->initial_focus (chooser_embed);
  }
  
@@ -57,32 +59,11 @@
 -  GTK_FILE_CHOOSER_EMBED_GET_IFACE (chooser_embed)->get_resizable_hints (chooser_embed, resize_horizontally, resize_vertically);
 +  return GTK_FILE_CHOOSER_EMBED_GET_IFACE (chooser_embed)->get_resizable (chooser_embed);
  }
---- gtk+-2.10.12/gtk/gtkfilechooserprivate.h.orig	2007-05-02 18:26:59.000000000 +0200
-+++ gtk+-2.10.12/gtk/gtkfilechooserprivate.h	2007-05-08 17:21:44.000000000 +0200
-@@ -109,10 +109,6 @@ struct _GtkFileChooserDialogPrivate
-   char *file_system;
- 
-   /* for use with GtkFileChooserEmbed */
--  gint default_width;
--  gint default_height;
--  gboolean resize_horizontally;
--  gboolean resize_vertically;
-   gboolean response_requested;
- };
- 
-@@ -254,6 +250,9 @@ struct _GtkFileChooserDefault
-   GSource *shortcuts_drag_outside_idle;
- #endif
- 
-+  gint default_width;
-+  gint default_height;
-+
-   /* Flags */
- 
-   guint local_only : 1;
---- gtk+-2.10.12/gtk/gtkfilechooserembed.h.orig	2007-05-02 18:26:58.000000000 +0200
-+++ gtk+-2.10.12/gtk/gtkfilechooserembed.h	2007-05-08 17:21:44.000000000 +0200
-@@ -43,9 +43,7 @@ struct _GtkFileChooserEmbedIface
+Index: gtk/gtkfilechooserembed.h
+===================================================================
+--- gtk/gtkfilechooserembed.h	(revision 17866)
++++ gtk/gtkfilechooserembed.h	(revision 17867)
+@@ -43,9 +43,7 @@
    void (*get_default_size)        (GtkFileChooserEmbed *chooser_embed,
  				   gint                *default_width,
  				   gint                *default_height);
@@ -93,7 +74,7 @@
  
    gboolean (*should_respond)      (GtkFileChooserEmbed *chooser_embed);
  
-@@ -61,10 +59,7 @@ GType _gtk_file_chooser_embed_get_type (
+@@ -61,10 +59,7 @@
  void  _gtk_file_chooser_embed_get_default_size    (GtkFileChooserEmbed *chooser_embed,
  						   gint                *default_width,
  						   gint                *default_height);
@@ -105,9 +86,224 @@
  gboolean _gtk_file_chooser_embed_should_respond (GtkFileChooserEmbed *chooser_embed);
  
  void _gtk_file_chooser_embed_initial_focus (GtkFileChooserEmbed *chooser_embed);
---- gtk+-2.10.12/gtk/gtkfilechooserdefault.c.orig	2007-05-02 18:26:59.000000000 +0200
-+++ gtk+-2.10.12/gtk/gtkfilechooserdefault.c	2007-05-08 17:23:59.000000000 +0200
-@@ -272,6 +272,8 @@ static void     gtk_file_chooser_default
+Index: gtk/gtkfilechooserdialog.c
+===================================================================
+--- gtk/gtkfilechooserdialog.c	(revision 17866)
++++ gtk/gtkfilechooserdialog.c	(revision 17867)
+@@ -87,10 +87,6 @@
+ 								   GTK_TYPE_FILE_CHOOSER_DIALOG,
+ 								   GtkFileChooserDialogPrivate);
+   dialog->priv = priv;
+-  dialog->priv->default_width = -1;
+-  dialog->priv->default_height = -1;
+-  dialog->priv->resize_horizontally = TRUE;
+-  dialog->priv->resize_vertically = TRUE;
+   dialog->priv->response_requested = FALSE;
+ 
+   gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
+@@ -151,25 +147,6 @@
+ }
+ 
+ static void
+-file_chooser_widget_update_hints (GtkFileChooserDialog *dialog,
+-				  gint                  width)
+-{
+-  GtkFileChooserDialogPrivate *priv;
+-  GdkGeometry geometry;
+-
+-  priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
+-
+-  geometry.min_width = (!priv->resize_horizontally ? width : -1);
+-  geometry.min_height = -1;
+-  geometry.max_width = (priv->resize_horizontally?G_MAXSHORT:-1);
+-  geometry.max_height = (priv->resize_vertically?G_MAXSHORT:-1);
+-
+-  gtk_window_set_geometry_hints (GTK_WINDOW (dialog), NULL,
+-				 &geometry,
+- 				 GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
+-}
+-
+-static void
+ clamp_to_screen (GtkWidget *widget,
+ 		 gint      *width,
+ 		 gint      *height)
+@@ -193,131 +170,57 @@
+ }
+ 
+ static void
+-file_chooser_widget_default_realized_size_changed (GtkWidget            *widget,
+-						   GtkFileChooserDialog *dialog)
++file_chooser_widget_default_size_changed (GtkWidget            *widget,
++					  GtkFileChooserDialog *dialog)
+ {
+   GtkFileChooserDialogPrivate *priv;
+-  gint width;
+-  gint height;
++  gint width, height;
+   gint default_width, default_height;
+-  GtkRequisition req;
+-  gboolean resize_horizontally;
+-  gboolean resize_vertically;
+-  gboolean update_hints;
+-  gint dx = 0, dy = 0;
+-  gint cur_width, cur_height;
++  GtkRequisition req, widget_req;
++  gboolean resizable;
+ 
+   priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
+ 
+-  /* Force a size request of everything before we start.  This will make sure
+-   * that widget->requisition is meaningful. */
+-  gtk_widget_size_request (GTK_WIDGET (dialog), &req);
+-  gtk_window_get_size (GTK_WINDOW (dialog), &cur_width, &cur_height);
+-  width = GTK_WIDGET (dialog)->requisition.width - priv->widget->requisition.width;
+-  height = GTK_WIDGET (dialog)->requisition.height - priv->widget->requisition.height;
+-  _gtk_file_chooser_embed_get_default_size (GTK_FILE_CHOOSER_EMBED (priv->widget),
+-					    &default_width, &default_height);
++  /* Unset any previously set size */
++  gtk_widget_set_size_request (GTK_WIDGET (dialog), -1, -1);
+ 
+-  /* Ideal target size modulo any resizing */
+-  width = default_width + width;
+-  height = default_height + height;
+-
+-  /* Now, we test for resizability */
+-  update_hints = FALSE;
+-  _gtk_file_chooser_embed_get_resizable_hints (GTK_FILE_CHOOSER_EMBED (priv->widget),
+-					       &resize_horizontally,
+-					       &resize_vertically);
+-  resize_vertically = (!! resize_vertically);     /* normalize */
+-  resize_horizontally = (!! resize_horizontally);
+-
+-  if (resize_horizontally && priv->resize_horizontally)
++  if (GTK_WIDGET_DRAWABLE (widget))
+     {
+-      dx = default_width - priv->default_width;
+-      priv->default_width = default_width;
+-    }
+-  else if (resize_horizontally && ! priv->resize_horizontally)
+-    {
+-      /* We restore to the ideal size + any change in default_size (which is not
+-       * expected).  It would be nicer to store the older size to restore to in
+-       * the future. */
+-      dx = default_width - priv->default_width;
+-      dx += width - cur_width;
+-      priv->default_width = default_width;
+-      update_hints = TRUE;
+-    }
+-  else
+-    {
+-      update_hints = TRUE;
+-    }
++      /* Force a size request of everything before we start.  This will make sure
++       * that widget->requisition is meaningful. */
++      gtk_widget_size_request (GTK_WIDGET (dialog), &req);
++      gtk_widget_size_request (widget, &widget_req);
+ 
+-  if (resize_vertically && priv->resize_vertically)
+-    {
+-      dy = default_height - priv->default_height;
+-      priv->default_height = default_height;
++      width = req.width - widget_req.width;
++      height = req.height - widget_req.height;
+     }
+-  else if (resize_vertically && ! priv->resize_vertically)
+-    {
+-      dy = default_height - priv->default_height;
+-      dy += height - cur_height;
+-      priv->default_height = default_height;
+-      update_hints = TRUE;
+-    }
+   else
+     {
+-      update_hints = TRUE;
++      width = GTK_WIDGET (dialog)->allocation.width - widget->allocation.width;
++      height = GTK_WIDGET (dialog)->allocation.height - widget->allocation.height;
+     }
+ 
+-  priv->resize_horizontally = resize_horizontally;
+-  priv->resize_vertically = resize_vertically;
+-
+-  if (dx != 0 || dy != 0)
+-    {
+-      gint new_width = cur_width + dx;
+-      gint new_height = cur_height + dy;
+-
+-      clamp_to_screen (GTK_WIDGET (dialog), &new_width, &new_height);
+-      
+-      gtk_window_resize (GTK_WINDOW (dialog), new_width, new_height);
+-    }
+-
+-  /* Only store the size if we can resize in that direction. */
+-  if (update_hints)
+-    file_chooser_widget_update_hints (dialog, width);
+-}
+-
+-static void
+-file_chooser_widget_default_unrealized_size_changed (GtkWidget            *widget,
+-						     GtkFileChooserDialog *dialog)
+-{
+-  GtkFileChooserDialogPrivate *priv;
+-  GtkRequisition req;
+-  gint width, height;
+-
+-  priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
+-  gtk_widget_size_request (GTK_WIDGET (dialog), &req);
+-
+-  _gtk_file_chooser_embed_get_resizable_hints (GTK_FILE_CHOOSER_EMBED (priv->widget),
+-					       &(priv->resize_horizontally),
+-					       &(priv->resize_vertically));
++  resizable = _gtk_file_chooser_embed_get_resizable (GTK_FILE_CHOOSER_EMBED (priv->widget));
+   _gtk_file_chooser_embed_get_default_size (GTK_FILE_CHOOSER_EMBED (priv->widget),
+-					    &(priv->default_width), &(priv->default_height));
+-  
+-  /* Determine how much space the rest of the dialog uses compared to priv->widget */
+-  width = priv->default_width + GTK_WIDGET (dialog)->requisition.width - priv->widget->requisition.width;
+-  height = priv->default_height + GTK_WIDGET (dialog)->requisition.height - priv->widget->requisition.height;
++					    &default_width, &default_height);
+ 
+-  gtk_window_set_default_size (GTK_WINDOW (dialog), width, height);
+-  file_chooser_widget_update_hints (dialog, width);
+-}
++  /* Ideal target size plus any extra size */
++  width = default_width + width + (2 * GTK_CONTAINER (dialog)->border_width);
++  height = default_height + height + (2 * GTK_CONTAINER (dialog)->border_width);
+ 
+-static void
+-file_chooser_widget_default_size_changed (GtkWidget            *widget,
+-					  GtkFileChooserDialog *dialog)
+-{
+   if (GTK_WIDGET_REALIZED (dialog))
+-    file_chooser_widget_default_realized_size_changed (widget, dialog);
++    clamp_to_screen (GTK_WIDGET (dialog), &width, &height);
++
++  if (resizable)
++    {
++      gtk_window_set_resizable (GTK_WINDOW (dialog), resizable);
++      gtk_window_resize (GTK_WINDOW (dialog), width, height);
++    }
+   else
+-    file_chooser_widget_default_unrealized_size_changed (widget, dialog);
++    {
++      gtk_widget_set_size_request (GTK_WIDGET (dialog), width, -1);
++      gtk_window_set_resizable (GTK_WINDOW (dialog), resizable);
++    }
+ }
+ 
+ static void
+@@ -487,6 +390,7 @@
+   if (!GTK_WIDGET_MAPPED (priv->widget))
+     gtk_widget_map (priv->widget);
+ 
++  file_chooser_widget_default_size_changed (priv->widget, dialog);
+   _gtk_file_chooser_embed_initial_focus (GTK_FILE_CHOOSER_EMBED (priv->widget));
+ 
+   GTK_WIDGET_CLASS (gtk_file_chooser_dialog_parent_class)->map (widget);
+Index: gtk/gtkfilechooserdefault.c
+===================================================================
+--- gtk/gtkfilechooserdefault.c	(revision 17866)
++++ gtk/gtkfilechooserdefault.c	(revision 17867)
+@@ -272,6 +272,8 @@
  							 GtkStyle              *previous_style);
  static void     gtk_file_chooser_default_screen_changed (GtkWidget             *widget,
  							 GdkScreen             *previous_screen);
@@ -116,7 +312,7 @@
  
  static gboolean       gtk_file_chooser_default_set_current_folder 	   (GtkFileChooser    *chooser,
  									    const GtkFilePath *path,
-@@ -310,9 +312,7 @@ static GSList *       gtk_file_chooser_d
+@@ -310,9 +312,7 @@
  static void           gtk_file_chooser_default_get_default_size       (GtkFileChooserEmbed *chooser_embed,
  								       gint                *default_width,
  								       gint                *default_height);
@@ -127,15 +323,17 @@
  static gboolean       gtk_file_chooser_default_should_respond         (GtkFileChooserEmbed *chooser_embed);
  static void           gtk_file_chooser_default_initial_focus          (GtkFileChooserEmbed *chooser_embed);
  
-@@ -423,6 +423,7 @@ static void browse_files_center_selected
+@@ -423,8 +423,8 @@
  static void location_button_toggled_cb (GtkToggleButton *toggle,
  					GtkFileChooserDefault *impl);
  static void location_switch_to_path_bar (GtkFileChooserDefault *impl);
-+static void     settings_load                (GtkFileChooserDefault *impl);
- 
++static void settings_load               (GtkFileChooserDefault *impl);
  
+-
  
-@@ -485,6 +486,7 @@ _gtk_file_chooser_default_class_init (Gt
+ 
+ /* Drag and drop interface declarations */
+@@ -485,6 +485,7 @@
    widget_class->hierarchy_changed = gtk_file_chooser_default_hierarchy_changed;
    widget_class->style_set = gtk_file_chooser_default_style_set;
    widget_class->screen_changed = gtk_file_chooser_default_screen_changed;
@@ -143,7 +341,7 @@
  
    signals[LOCATION_POPUP] =
      _gtk_binding_signal_new (I_("location-popup"),
-@@ -665,7 +667,7 @@ static void
+@@ -665,7 +666,7 @@
  gtk_file_chooser_embed_default_iface_init (GtkFileChooserEmbedIface *iface)
  {
    iface->get_default_size = gtk_file_chooser_default_get_default_size;
@@ -152,7 +350,7 @@
    iface->should_respond = gtk_file_chooser_default_should_respond;
    iface->initial_focus = gtk_file_chooser_default_initial_focus;
  }
-@@ -4998,6 +5000,7 @@ gtk_file_chooser_default_set_property (G
+@@ -4998,6 +4999,7 @@
  	      }
  	    impl->action = action;
  	    update_appearance (impl);
@@ -160,7 +358,7 @@
  	  }
        }
        break;
-@@ -5419,6 +5422,37 @@ gtk_file_chooser_default_screen_changed 
+@@ -5419,6 +5421,37 @@
    profile_end ("end", NULL);
  }
  
@@ -198,7 +396,7 @@
  static gboolean
  get_is_file_filtered (GtkFileChooserDefault *impl,
  		      const GtkFilePath     *path,
-@@ -7186,49 +7220,35 @@ find_good_size_from_style (GtkWidget *wi
+@@ -7186,49 +7219,35 @@
  			   gint      *height)
  {
    GtkFileChooserDefault *impl;
@@ -222,12 +420,6 @@
 -    }
 -  else
 -    resolution = 96.0; /* wheeee */
--
--  font_size = pango_font_description_get_size (widget->style->font_desc);
--  font_size = PANGO_PIXELS (font_size) * resolution / 72.0;
--
--  default_width = font_size * NUM_CHARS;
--  default_height = font_size * NUM_LINES;
 +      screen = gtk_widget_get_screen (widget);
 +      if (screen)
 +	{
@@ -238,22 +430,28 @@
 +      else
 +	resolution = 96.0; /* wheeee */
  
+-  font_size = pango_font_description_get_size (widget->style->font_desc);
+-  font_size = PANGO_PIXELS (font_size) * resolution / 72.0;
++      font_size = pango_font_description_get_size (widget->style->font_desc);
++      font_size = PANGO_PIXELS (font_size) * resolution / 72.0;
+ 
+-  default_width = font_size * NUM_CHARS;
+-  default_height = font_size * NUM_LINES;
+-
 -  if (impl->preview_widget_active && impl->preview_widget)
 -    {
 -      gtk_widget_size_request (impl->preview_box, &req);
 -      default_width += PREVIEW_HBOX_SPACING + req.width;
--    }
-+      font_size = pango_font_description_get_size (widget->style->font_desc);
-+      font_size = PANGO_PIXELS (font_size) * resolution / 72.0;
++      impl->default_width = font_size * NUM_CHARS;
++      impl->default_height = font_size * NUM_LINES;
+     }
  
 -  if (impl->extra_widget)
 -    {
 -      gtk_widget_size_request (impl->extra_align, &req);
 -      default_height += GTK_BOX (widget)->spacing + req.height;
-+      impl->default_width = font_size * NUM_CHARS;
-+      impl->default_height = font_size * NUM_LINES;
-     }
- 
+-    }
+-
 -  gtk_widget_size_request (widget, &req);
 -  default_width = MAX (default_width, req.width);
 -  default_height = MAX (default_height, req.height);
@@ -265,7 +463,7 @@
  }
  
  static void
-@@ -7237,35 +7257,37 @@ gtk_file_chooser_default_get_default_siz
+@@ -7237,35 +7256,37 @@
  					   gint                *default_height)
  {
    GtkFileChooserDefault *impl;
@@ -322,215 +520,28 @@
  }
  
  struct switch_folder_closure {
---- gtk+-2.10.12/gtk/gtkfilechooserdialog.c.orig	2007-05-02 18:26:58.000000000 +0200
-+++ gtk+-2.10.12/gtk/gtkfilechooserdialog.c	2007-05-08 17:21:44.000000000 +0200
-@@ -87,10 +87,6 @@ gtk_file_chooser_dialog_init (GtkFileCho
- 								   GTK_TYPE_FILE_CHOOSER_DIALOG,
- 								   GtkFileChooserDialogPrivate);
-   dialog->priv = priv;
--  dialog->priv->default_width = -1;
--  dialog->priv->default_height = -1;
--  dialog->priv->resize_horizontally = TRUE;
--  dialog->priv->resize_vertically = TRUE;
-   dialog->priv->response_requested = FALSE;
- 
-   gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
-@@ -151,25 +147,6 @@ file_chooser_widget_file_activated (GtkF
- }
- 
- static void
--file_chooser_widget_update_hints (GtkFileChooserDialog *dialog,
--				  gint                  width)
--{
--  GtkFileChooserDialogPrivate *priv;
--  GdkGeometry geometry;
--
--  priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
--
--  geometry.min_width = (!priv->resize_horizontally ? width : -1);
--  geometry.min_height = -1;
--  geometry.max_width = (priv->resize_horizontally?G_MAXSHORT:-1);
--  geometry.max_height = (priv->resize_vertically?G_MAXSHORT:-1);
--
--  gtk_window_set_geometry_hints (GTK_WINDOW (dialog), NULL,
--				 &geometry,
-- 				 GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
--}
--
--static void
- clamp_to_screen (GtkWidget *widget,
- 		 gint      *width,
- 		 gint      *height)
-@@ -193,131 +170,49 @@ clamp_to_screen (GtkWidget *widget,
- }
+Index: gtk/gtkfilechooserprivate.h
+===================================================================
+--- gtk/gtkfilechooserprivate.h	(revision 17866)
++++ gtk/gtkfilechooserprivate.h	(revision 17867)
+@@ -109,10 +109,6 @@
+   char *file_system;
  
- static void
--file_chooser_widget_default_realized_size_changed (GtkWidget            *widget,
--						   GtkFileChooserDialog *dialog)
-+file_chooser_widget_default_size_changed (GtkWidget            *widget,
-+					  GtkFileChooserDialog *dialog)
- {
-   GtkFileChooserDialogPrivate *priv;
--  gint width;
--  gint height;
-+  gint width, height;
-   gint default_width, default_height;
--  GtkRequisition req;
+   /* for use with GtkFileChooserEmbed */
+-  gint default_width;
+-  gint default_height;
 -  gboolean resize_horizontally;
 -  gboolean resize_vertically;
--  gboolean update_hints;
--  gint dx = 0, dy = 0;
--  gint cur_width, cur_height;
-+  GtkRequisition req, widget_req;
-+  gboolean resizable;
+   gboolean response_requested;
+ };
  
-   priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
+@@ -254,6 +250,9 @@
+   GSource *shortcuts_drag_outside_idle;
+ #endif
  
-+  /* Unset any previously set size */
-+  gtk_widget_set_size_request (GTK_WIDGET (dialog), -1, -1);
-+
-   /* Force a size request of everything before we start.  This will make sure
-    * that widget->requisition is meaningful. */
-   gtk_widget_size_request (GTK_WIDGET (dialog), &req);
--  gtk_window_get_size (GTK_WINDOW (dialog), &cur_width, &cur_height);
--  width = GTK_WIDGET (dialog)->requisition.width - priv->widget->requisition.width;
--  height = GTK_WIDGET (dialog)->requisition.height - priv->widget->requisition.height;
-+  gtk_widget_size_request (widget, &widget_req);
-+
-+  width = req.width - widget_req.width;
-+  height = req.height - widget_req.height;
++  gint default_width;
++  gint default_height;
 +
-+  resizable = _gtk_file_chooser_embed_get_resizable (GTK_FILE_CHOOSER_EMBED (priv->widget));
-   _gtk_file_chooser_embed_get_default_size (GTK_FILE_CHOOSER_EMBED (priv->widget),
- 					    &default_width, &default_height);
- 
--  /* Ideal target size modulo any resizing */
--  width = default_width + width;
--  height = default_height + height;
--
--  /* Now, we test for resizability */
--  update_hints = FALSE;
--  _gtk_file_chooser_embed_get_resizable_hints (GTK_FILE_CHOOSER_EMBED (priv->widget),
--					       &resize_horizontally,
--					       &resize_vertically);
--  resize_vertically = (!! resize_vertically);     /* normalize */
--  resize_horizontally = (!! resize_horizontally);
-+  /* Ideal target size plus any extra size */
-+  width = default_width + width + (2 * GTK_CONTAINER (dialog)->border_width);
-+  height = default_height + height + (2 * GTK_CONTAINER (dialog)->border_width);
- 
--  if (resize_horizontally && priv->resize_horizontally)
--    {
--      dx = default_width - priv->default_width;
--      priv->default_width = default_width;
--    }
--  else if (resize_horizontally && ! priv->resize_horizontally)
--    {
--      /* We restore to the ideal size + any change in default_size (which is not
--       * expected).  It would be nicer to store the older size to restore to in
--       * the future. */
--      dx = default_width - priv->default_width;
--      dx += width - cur_width;
--      priv->default_width = default_width;
--      update_hints = TRUE;
--    }
--  else
--    {
--      update_hints = TRUE;
--    }
-+  if (GTK_WIDGET_REALIZED (dialog))
-+    clamp_to_screen (GTK_WIDGET (dialog), &width, &height);
- 
--  if (resize_vertically && priv->resize_vertically)
--    {
--      dy = default_height - priv->default_height;
--      priv->default_height = default_height;
--    }
--  else if (resize_vertically && ! priv->resize_vertically)
-+  if (resizable)
-     {
--      dy = default_height - priv->default_height;
--      dy += height - cur_height;
--      priv->default_height = default_height;
--      update_hints = TRUE;
-+      gtk_window_set_resizable (GTK_WINDOW (dialog), resizable);
-+      gtk_window_resize (GTK_WINDOW (dialog), width, height);
-     }
-   else
-     {
--      update_hints = TRUE;
--    }
--
--  priv->resize_horizontally = resize_horizontally;
--  priv->resize_vertically = resize_vertically;
--
--  if (dx != 0 || dy != 0)
--    {
--      gint new_width = cur_width + dx;
--      gint new_height = cur_height + dy;
--
--      clamp_to_screen (GTK_WIDGET (dialog), &new_width, &new_height);
--      
--      gtk_window_resize (GTK_WINDOW (dialog), new_width, new_height);
-+      gtk_widget_set_size_request (GTK_WIDGET (dialog), width, -1);
-+      gtk_window_set_resizable (GTK_WINDOW (dialog), resizable);
-     }
--
--  /* Only store the size if we can resize in that direction. */
--  if (update_hints)
--    file_chooser_widget_update_hints (dialog, width);
--}
--
--static void
--file_chooser_widget_default_unrealized_size_changed (GtkWidget            *widget,
--						     GtkFileChooserDialog *dialog)
--{
--  GtkFileChooserDialogPrivate *priv;
--  GtkRequisition req;
--  gint width, height;
--
--  priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
--  gtk_widget_size_request (GTK_WIDGET (dialog), &req);
--
--  _gtk_file_chooser_embed_get_resizable_hints (GTK_FILE_CHOOSER_EMBED (priv->widget),
--					       &(priv->resize_horizontally),
--					       &(priv->resize_vertically));
--  _gtk_file_chooser_embed_get_default_size (GTK_FILE_CHOOSER_EMBED (priv->widget),
--					    &(priv->default_width), &(priv->default_height));
--  
--  /* Determine how much space the rest of the dialog uses compared to priv->widget */
--  width = priv->default_width + GTK_WIDGET (dialog)->requisition.width - priv->widget->requisition.width;
--  height = priv->default_height + GTK_WIDGET (dialog)->requisition.height - priv->widget->requisition.height;
--
--  gtk_window_set_default_size (GTK_WINDOW (dialog), width, height);
--  file_chooser_widget_update_hints (dialog, width);
--}
--
--static void
--file_chooser_widget_default_size_changed (GtkWidget            *widget,
--					  GtkFileChooserDialog *dialog)
--{
--  if (GTK_WIDGET_REALIZED (dialog))
--    file_chooser_widget_default_realized_size_changed (widget, dialog);
--  else
--    file_chooser_widget_default_unrealized_size_changed (widget, dialog);
- }
- 
- static void
-@@ -375,6 +270,7 @@ gtk_file_chooser_dialog_constructor (GTy
-   else
-     priv->widget = g_object_new (GTK_TYPE_FILE_CHOOSER_WIDGET, NULL);
- 
-+  gtk_widget_show (priv->widget);
-   g_signal_connect (priv->widget, "file-activated",
- 		    G_CALLBACK (file_chooser_widget_file_activated), object);
-   g_signal_connect (priv->widget, "default-size-changed",
-@@ -384,8 +280,6 @@ gtk_file_chooser_dialog_constructor (GTy
- 
-   gtk_box_pack_start (GTK_BOX (GTK_DIALOG (object)->vbox), priv->widget, TRUE, TRUE, 0);
- 
--  gtk_widget_show (priv->widget);
--
-   _gtk_file_chooser_set_delegate (GTK_FILE_CHOOSER (object),
- 				  GTK_FILE_CHOOSER (priv->widget));
+   /* Flags */
  
+   guint local_only : 1;




More information about the arch-commits mailing list