Commit 23a249a0 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Sanity check default font family name and size.

Sat Feb 23 22:37:23 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkstyle.c (gtk_style_init): Sanity check default
        font family name and size.

        * gtk/gtkwindow.c (gtk_window_set_default_size): Remove
        incorrect comment about the geometry widget.

        * gtk/gtkwindow.c (gtk_window_move_resize): Unset the
        gtk_window_resize)() information once we've set the size
        once, to avoid it coming back next time we queue a resize.
        (#72359)

        * gtk/gtkwindow.c (gtk_window_move_resize): Remove
        setthing of ->need_default_size from here, Havoc
        says that it should correspond more or less exactly
        to GTK_WIDGET_MAPPED (window).
parent c44a49fa
Sat Feb 23 22:37:23 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_init): Sanity check default
font family name and size.
* gtk/gtkwindow.c (gtk_window_set_default_size): Remove
incorrect comment about the geometry widget.
* gtk/gtkwindow.c (gtk_window_move_resize): Unset the
gtk_window_resize)() information once we've set the size
once, to avoid it coming back next time we queue a resize.
(#72359)
* gtk/gtkwindow.c (gtk_window_move_resize): Remove
setthing of ->need_default_size from here, Havoc
says that it should correspond more or less exactly
to GTK_WIDGET_MAPPED (window).
Sat Feb 23 23:00:48 2002 Jonathan Blandford <jrb@redhat.com> Sat Feb 23 23:00:48 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.h: add () to function macros as per owen's * gtk/gtktreemodel.h: add () to function macros as per owen's
......
Sat Feb 23 22:37:23 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_init): Sanity check default
font family name and size.
* gtk/gtkwindow.c (gtk_window_set_default_size): Remove
incorrect comment about the geometry widget.
* gtk/gtkwindow.c (gtk_window_move_resize): Unset the
gtk_window_resize)() information once we've set the size
once, to avoid it coming back next time we queue a resize.
(#72359)
* gtk/gtkwindow.c (gtk_window_move_resize): Remove
setthing of ->need_default_size from here, Havoc
says that it should correspond more or less exactly
to GTK_WIDGET_MAPPED (window).
Sat Feb 23 23:00:48 2002 Jonathan Blandford <jrb@redhat.com> Sat Feb 23 23:00:48 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.h: add () to function macros as per owen's * gtk/gtktreemodel.h: add () to function macros as per owen's
......
Sat Feb 23 22:37:23 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_init): Sanity check default
font family name and size.
* gtk/gtkwindow.c (gtk_window_set_default_size): Remove
incorrect comment about the geometry widget.
* gtk/gtkwindow.c (gtk_window_move_resize): Unset the
gtk_window_resize)() information once we've set the size
once, to avoid it coming back next time we queue a resize.
(#72359)
* gtk/gtkwindow.c (gtk_window_move_resize): Remove
setthing of ->need_default_size from here, Havoc
says that it should correspond more or less exactly
to GTK_WIDGET_MAPPED (window).
Sat Feb 23 23:00:48 2002 Jonathan Blandford <jrb@redhat.com> Sat Feb 23 23:00:48 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.h: add () to function macros as per owen's * gtk/gtktreemodel.h: add () to function macros as per owen's
......
Sat Feb 23 22:37:23 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_init): Sanity check default
font family name and size.
* gtk/gtkwindow.c (gtk_window_set_default_size): Remove
incorrect comment about the geometry widget.
* gtk/gtkwindow.c (gtk_window_move_resize): Unset the
gtk_window_resize)() information once we've set the size
once, to avoid it coming back next time we queue a resize.
(#72359)
* gtk/gtkwindow.c (gtk_window_move_resize): Remove
setthing of ->need_default_size from here, Havoc
says that it should correspond more or less exactly
to GTK_WIDGET_MAPPED (window).
Sat Feb 23 23:00:48 2002 Jonathan Blandford <jrb@redhat.com> Sat Feb 23 23:00:48 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.h: add () to function macros as per owen's * gtk/gtktreemodel.h: add () to function macros as per owen's
......
Sat Feb 23 22:37:23 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_init): Sanity check default
font family name and size.
* gtk/gtkwindow.c (gtk_window_set_default_size): Remove
incorrect comment about the geometry widget.
* gtk/gtkwindow.c (gtk_window_move_resize): Unset the
gtk_window_resize)() information once we've set the size
once, to avoid it coming back next time we queue a resize.
(#72359)
* gtk/gtkwindow.c (gtk_window_move_resize): Remove
setthing of ->need_default_size from here, Havoc
says that it should correspond more or less exactly
to GTK_WIDGET_MAPPED (window).
Sat Feb 23 23:00:48 2002 Jonathan Blandford <jrb@redhat.com> Sat Feb 23 23:00:48 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.h: add () to function macros as per owen's * gtk/gtktreemodel.h: add () to function macros as per owen's
......
Sat Feb 23 22:37:23 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_init): Sanity check default
font family name and size.
* gtk/gtkwindow.c (gtk_window_set_default_size): Remove
incorrect comment about the geometry widget.
* gtk/gtkwindow.c (gtk_window_move_resize): Unset the
gtk_window_resize)() information once we've set the size
once, to avoid it coming back next time we queue a resize.
(#72359)
* gtk/gtkwindow.c (gtk_window_move_resize): Remove
setthing of ->need_default_size from here, Havoc
says that it should correspond more or less exactly
to GTK_WIDGET_MAPPED (window).
Sat Feb 23 23:00:48 2002 Jonathan Blandford <jrb@redhat.com> Sat Feb 23 23:00:48 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.h: add () to function macros as per owen's * gtk/gtktreemodel.h: add () to function macros as per owen's
......
Sat Feb 23 22:37:23 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_init): Sanity check default
font family name and size.
* gtk/gtkwindow.c (gtk_window_set_default_size): Remove
incorrect comment about the geometry widget.
* gtk/gtkwindow.c (gtk_window_move_resize): Unset the
gtk_window_resize)() information once we've set the size
once, to avoid it coming back next time we queue a resize.
(#72359)
* gtk/gtkwindow.c (gtk_window_move_resize): Remove
setthing of ->need_default_size from here, Havoc
says that it should correspond more or less exactly
to GTK_WIDGET_MAPPED (window).
Sat Feb 23 23:00:48 2002 Jonathan Blandford <jrb@redhat.com> Sat Feb 23 23:00:48 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.h: add () to function macros as per owen's * gtk/gtktreemodel.h: add () to function macros as per owen's
......
...@@ -486,9 +486,20 @@ gtk_style_init (GtkStyle *style) ...@@ -486,9 +486,20 @@ gtk_style_init (GtkStyle *style)
{ {
gint i; gint i;
const gchar *font_name = _gtk_rc_context_get_default_font_name (gtk_settings_get_default ()); const gchar *font_name = _gtk_rc_context_get_default_font_name (gtk_settings_get_default ());
style->font_desc = pango_font_description_from_string (font_name); style->font_desc = pango_font_description_from_string (font_name);
if (!pango_font_description_get_family (style->font_desc))
{
g_warning ("Default font does not have a family set");
pango_font_description_set_family (style->font_desc, "Sans");
}
if (pango_font_description_get_size (style->font_desc) <= 0)
{
g_warning ("Default font does not have a positive size");
pango_font_description_set_size (style->font_desc, 10 * PANGO_SCALE);
}
style->attach_count = 0; style->attach_count = 0;
style->colormap = NULL; style->colormap = NULL;
style->depth = -1; style->depth = -1;
......
...@@ -2405,11 +2405,6 @@ gtk_window_set_default_size_internal (GtkWindow *window, ...@@ -2405,11 +2405,6 @@ gtk_window_set_default_size_internal (GtkWindow *window,
* For more control over a window's initial size and how resizing works, * For more control over a window's initial size and how resizing works,
* investigate gtk_window_set_geometry_hints(). * investigate gtk_window_set_geometry_hints().
* *
* A useful feature: if you set the "geometry widget" via
* gtk_window_set_geometry_hints(), the default size specified by
* gtk_window_set_default_size() will be the default size of that
* widget, not of the entire window.
*
* For some uses, gtk_window_resize() is a more appropriate function. * For some uses, gtk_window_resize() is a more appropriate function.
* gtk_window_resize() changes the current size of the window, rather * gtk_window_resize() changes the current size of the window, rather
* than the size to be used on initial display. gtk_window_resize() always * than the size to be used on initial display. gtk_window_resize() always
...@@ -2467,8 +2462,8 @@ gtk_window_get_default_size (GtkWindow *window, ...@@ -2467,8 +2462,8 @@ gtk_window_get_default_size (GtkWindow *window,
/** /**
* gtk_window_resize: * gtk_window_resize:
* @window: a #GtkWindow * @window: a #GtkWindow
* @width: width to resize the window to * @width: width in pixels to resize the window to
* @height: height to resize the window to * @height: height in pixels to resize the window to
* *
* Resizes the window as if the user had done so, obeying geometry * Resizes the window as if the user had done so, obeying geometry
* constraints. The default geometry constraint is that windows may * constraints. The default geometry constraint is that windows may
...@@ -4384,8 +4379,9 @@ gtk_window_move_resize (GtkWindow *window) ...@@ -4384,8 +4379,9 @@ gtk_window_move_resize (GtkWindow *window)
* GTK_RESIZE_IMMEDIATE containers) * GTK_RESIZE_IMMEDIATE containers)
*/ */
info->position_constraints_changed = FALSE; info->position_constraints_changed = FALSE;
window->need_default_position = FALSE;
info->initial_pos_set = FALSE; info->initial_pos_set = FALSE;
info->resize_width = -1;
info->resize_height = -1;
/* for GTK_RESIZE_QUEUE toplevels, we are now awaiting a new /* for GTK_RESIZE_QUEUE toplevels, we are now awaiting a new
* configure event in response to our resizing request. * configure event in response to our resizing request.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment