]> Pileus Git - ~andy/gtk/commitdiff
Fix problem with using result of g_get_charset() backwards - pointed out
authorOwen Taylor <otaylor@redhat.com>
Sun, 12 Nov 2000 19:16:11 +0000 (19:16 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Sun, 12 Nov 2000 19:16:11 +0000 (19:16 +0000)
Sun Nov 12 14:10:09 2000  Owen Taylor  <otaylor@redhat.com>

* gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
problem with using result of g_get_charset() backwards -
pointed out by Mikael Hermansson <mikeh@bahnhof.se>.

* gtk/gtkwindow.c (gtk_window_compute_hints): Support
negative min_width/height and max_width/height to
mean "requisition"; this allows setting a window
to be user-resizable in only one direction easily.

* gtk/testgtk.c (create_main_window): Remove hard-coded
usize - set a default size in the vertical direction.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/x11/gdkselection-x11.c
gtk/gtkwindow.c
gtk/testgtk.c
tests/testgtk.c

index 0a64e7631b693d1752dcefe512bbf5928551ab66..705658b1151b0fafe4054d56d1042aeac95679d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+Sun Nov 12 14:10:09 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
+       problem with using result of g_get_charset() backwards -
+       pointed out by Mikael Hermansson <mikeh@bahnhof.se>.
+
+       * gtk/gtkwindow.c (gtk_window_compute_hints): Support
+       negative min_width/height and max_width/height to
+       mean "requisition"; this allows setting a window
+       to be user-resizable in only one direction easily.
+
+       * gtk/testgtk.c (create_main_window): Remove hard-coded
+       usize - set a default size in the vertical direction.
+
 Sun Nov 12 13:33:01 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkrange.c: Add some missing casts. Support 
index 0a64e7631b693d1752dcefe512bbf5928551ab66..705658b1151b0fafe4054d56d1042aeac95679d2 100644 (file)
@@ -1,3 +1,17 @@
+Sun Nov 12 14:10:09 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
+       problem with using result of g_get_charset() backwards -
+       pointed out by Mikael Hermansson <mikeh@bahnhof.se>.
+
+       * gtk/gtkwindow.c (gtk_window_compute_hints): Support
+       negative min_width/height and max_width/height to
+       mean "requisition"; this allows setting a window
+       to be user-resizable in only one direction easily.
+
+       * gtk/testgtk.c (create_main_window): Remove hard-coded
+       usize - set a default size in the vertical direction.
+
 Sun Nov 12 13:33:01 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkrange.c: Add some missing casts. Support 
index 0a64e7631b693d1752dcefe512bbf5928551ab66..705658b1151b0fafe4054d56d1042aeac95679d2 100644 (file)
@@ -1,3 +1,17 @@
+Sun Nov 12 14:10:09 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
+       problem with using result of g_get_charset() backwards -
+       pointed out by Mikael Hermansson <mikeh@bahnhof.se>.
+
+       * gtk/gtkwindow.c (gtk_window_compute_hints): Support
+       negative min_width/height and max_width/height to
+       mean "requisition"; this allows setting a window
+       to be user-resizable in only one direction easily.
+
+       * gtk/testgtk.c (create_main_window): Remove hard-coded
+       usize - set a default size in the vertical direction.
+
 Sun Nov 12 13:33:01 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkrange.c: Add some missing casts. Support 
index 0a64e7631b693d1752dcefe512bbf5928551ab66..705658b1151b0fafe4054d56d1042aeac95679d2 100644 (file)
@@ -1,3 +1,17 @@
+Sun Nov 12 14:10:09 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
+       problem with using result of g_get_charset() backwards -
+       pointed out by Mikael Hermansson <mikeh@bahnhof.se>.
+
+       * gtk/gtkwindow.c (gtk_window_compute_hints): Support
+       negative min_width/height and max_width/height to
+       mean "requisition"; this allows setting a window
+       to be user-resizable in only one direction easily.
+
+       * gtk/testgtk.c (create_main_window): Remove hard-coded
+       usize - set a default size in the vertical direction.
+
 Sun Nov 12 13:33:01 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkrange.c: Add some missing casts. Support 
index 0a64e7631b693d1752dcefe512bbf5928551ab66..705658b1151b0fafe4054d56d1042aeac95679d2 100644 (file)
@@ -1,3 +1,17 @@
+Sun Nov 12 14:10:09 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
+       problem with using result of g_get_charset() backwards -
+       pointed out by Mikael Hermansson <mikeh@bahnhof.se>.
+
+       * gtk/gtkwindow.c (gtk_window_compute_hints): Support
+       negative min_width/height and max_width/height to
+       mean "requisition"; this allows setting a window
+       to be user-resizable in only one direction easily.
+
+       * gtk/testgtk.c (create_main_window): Remove hard-coded
+       usize - set a default size in the vertical direction.
+
 Sun Nov 12 13:33:01 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkrange.c: Add some missing casts. Support 
index 0a64e7631b693d1752dcefe512bbf5928551ab66..705658b1151b0fafe4054d56d1042aeac95679d2 100644 (file)
@@ -1,3 +1,17 @@
+Sun Nov 12 14:10:09 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
+       problem with using result of g_get_charset() backwards -
+       pointed out by Mikael Hermansson <mikeh@bahnhof.se>.
+
+       * gtk/gtkwindow.c (gtk_window_compute_hints): Support
+       negative min_width/height and max_width/height to
+       mean "requisition"; this allows setting a window
+       to be user-resizable in only one direction easily.
+
+       * gtk/testgtk.c (create_main_window): Remove hard-coded
+       usize - set a default size in the vertical direction.
+
 Sun Nov 12 13:33:01 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkrange.c: Add some missing casts. Support 
index 0a64e7631b693d1752dcefe512bbf5928551ab66..705658b1151b0fafe4054d56d1042aeac95679d2 100644 (file)
@@ -1,3 +1,17 @@
+Sun Nov 12 14:10:09 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
+       problem with using result of g_get_charset() backwards -
+       pointed out by Mikael Hermansson <mikeh@bahnhof.se>.
+
+       * gtk/gtkwindow.c (gtk_window_compute_hints): Support
+       negative min_width/height and max_width/height to
+       mean "requisition"; this allows setting a window
+       to be user-resizable in only one direction easily.
+
+       * gtk/testgtk.c (create_main_window): Remove hard-coded
+       usize - set a default size in the vertical direction.
+
 Sun Nov 12 13:33:01 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkrange.c: Add some missing casts. Support 
index 454d1cbd7e94e951e8ea95e5428327676c9f21a9..8ca93898349b63dd659b4b41485235318abbe303 100644 (file)
@@ -415,7 +415,7 @@ gdk_text_property_to_utf8_list (GdkAtom        encoding,
       gint local_count;
       gint i;
       gchar *charset = NULL;
-      gboolean need_conversiong_get_charset (&charset);
+      gboolean need_conversion = !g_get_charset (&charset);
       gint count = 0;
       GError *error = NULL;
       
@@ -605,7 +605,7 @@ gdk_utf8_to_compound_text (const gchar *str,
 
   g_return_val_if_fail (str != NULL, FALSE);
 
-  need_conversion = g_get_charset (&charset);
+  need_conversion = !g_get_charset (&charset);
 
   tmp_str = sanitize_utf8 (str);
 
index dbf9ecaf8faf00bec04e27e1ffa8c3d263679d4b..821f9d855eb3d02c7ee78499fa929064bdc69be8 100644 (file)
@@ -2125,8 +2125,15 @@ gtk_window_compute_hints (GtkWindow   *window,
   
   if (*new_flags & GDK_HINT_MIN_SIZE)
     {
-      new_geometry->min_width += extra_width;
-      new_geometry->min_height += extra_height;
+      if (new_geometry->min_width < 0)
+       new_geometry->min_width = requisition.width;
+      else
+       new_geometry->min_width += extra_width;
+
+      if (new_geometry->min_height < 0)
+       new_geometry->min_width = requisition.height;
+      else
+       new_geometry->min_height += extra_height;
     }
   else if (!window->allow_shrink)
     {
@@ -2138,8 +2145,15 @@ gtk_window_compute_hints (GtkWindow   *window,
   
   if (*new_flags & GDK_HINT_MAX_SIZE)
     {
-      new_geometry->max_width += extra_width;
-      new_geometry->max_height += extra_height;
+      if (new_geometry->max_width < 0)
+       new_geometry->max_width = requisition.width;
+      else
+       new_geometry->max_width += extra_width;
+
+      if (new_geometry->max_height < 0)
+       new_geometry->max_width = requisition.height;
+      else
+       new_geometry->max_height += extra_height;
     }
   else if (!window->allow_grow)
     {
index fd1795f2f6d56d4fe0c0cc7658d2436b9098ec0f..cfcbaf13003f46e7df0aad0d587432c87274e2f7 100644 (file)
@@ -9151,13 +9151,21 @@ create_main_window (void)
   GtkWidget *label;
   gchar buffer[64];
   GtkWidget *separator;
+  GdkGeometry geometry;
   int i;
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-  gtk_window_set_policy (GTK_WINDOW (window), FALSE, FALSE, FALSE);
   gtk_widget_set_name (window, "main window");
-  gtk_widget_set_usize (window, 200, 400);
   gtk_widget_set_uposition (window, 20, 20);
+  gtk_window_set_default_size (GTK_WINDOW (window), -1, 400);
+
+  geometry.min_width = -1;
+  geometry.min_height = -1;
+  geometry.max_width = -1;
+  geometry.max_height = G_MAXSHORT;
+  gtk_window_set_geometry_hints (GTK_WINDOW (window), NULL,
+                                &geometry,
+                                GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
 
   gtk_signal_connect (GTK_OBJECT (window), "destroy",
                      GTK_SIGNAL_FUNC(gtk_main_quit),
@@ -9187,7 +9195,7 @@ create_main_window (void)
   scrolled_window = gtk_scrolled_window_new (NULL, NULL);
   gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 10);
   gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
-                                 GTK_POLICY_AUTOMATIC
+                                 GTK_POLICY_NEVER
                                   GTK_POLICY_AUTOMATIC);
   gtk_box_pack_start (GTK_BOX (box1), scrolled_window, TRUE, TRUE, 0);
 
index fd1795f2f6d56d4fe0c0cc7658d2436b9098ec0f..cfcbaf13003f46e7df0aad0d587432c87274e2f7 100644 (file)
@@ -9151,13 +9151,21 @@ create_main_window (void)
   GtkWidget *label;
   gchar buffer[64];
   GtkWidget *separator;
+  GdkGeometry geometry;
   int i;
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-  gtk_window_set_policy (GTK_WINDOW (window), FALSE, FALSE, FALSE);
   gtk_widget_set_name (window, "main window");
-  gtk_widget_set_usize (window, 200, 400);
   gtk_widget_set_uposition (window, 20, 20);
+  gtk_window_set_default_size (GTK_WINDOW (window), -1, 400);
+
+  geometry.min_width = -1;
+  geometry.min_height = -1;
+  geometry.max_width = -1;
+  geometry.max_height = G_MAXSHORT;
+  gtk_window_set_geometry_hints (GTK_WINDOW (window), NULL,
+                                &geometry,
+                                GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
 
   gtk_signal_connect (GTK_OBJECT (window), "destroy",
                      GTK_SIGNAL_FUNC(gtk_main_quit),
@@ -9187,7 +9195,7 @@ create_main_window (void)
   scrolled_window = gtk_scrolled_window_new (NULL, NULL);
   gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 10);
   gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
-                                 GTK_POLICY_AUTOMATIC
+                                 GTK_POLICY_NEVER
                                   GTK_POLICY_AUTOMATIC);
   gtk_box_pack_start (GTK_BOX (box1), scrolled_window, TRUE, TRUE, 0);