diff --git a/ChangeLog b/ChangeLog index 93f007353a..27b4be117d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Fri Mar 27 17:58:41 1998 Owen Taylor + + * gtk/gtkhandlebox.c (gtk_handle_box_paint): Don't clear + the window on an expose event. On draws, just clear the + portion we are redrawing. + + * gdk/gdkfont.c (gdk_fontset_load): Corrected calculation + of fontset ascent/descent. + + * gtk/gtkwidget.[ch]: Added new function to show a toplevel + window and wait for it to be mapped, gtk_window_show_now () + Fri Mar 27 08:51:17 PST 1998 Shawn T. Amundson * docs/Makefile.sgml: some stuff for doing plain text and diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 93f007353a..27b4be117d 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,15 @@ +Fri Mar 27 17:58:41 1998 Owen Taylor + + * gtk/gtkhandlebox.c (gtk_handle_box_paint): Don't clear + the window on an expose event. On draws, just clear the + portion we are redrawing. + + * gdk/gdkfont.c (gdk_fontset_load): Corrected calculation + of fontset ascent/descent. + + * gtk/gtkwidget.[ch]: Added new function to show a toplevel + window and wait for it to be mapped, gtk_window_show_now () + Fri Mar 27 08:51:17 PST 1998 Shawn T. Amundson * docs/Makefile.sgml: some stuff for doing plain text and diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 93f007353a..27b4be117d 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +Fri Mar 27 17:58:41 1998 Owen Taylor + + * gtk/gtkhandlebox.c (gtk_handle_box_paint): Don't clear + the window on an expose event. On draws, just clear the + portion we are redrawing. + + * gdk/gdkfont.c (gdk_fontset_load): Corrected calculation + of fontset ascent/descent. + + * gtk/gtkwidget.[ch]: Added new function to show a toplevel + window and wait for it to be mapped, gtk_window_show_now () + Fri Mar 27 08:51:17 PST 1998 Shawn T. Amundson * docs/Makefile.sgml: some stuff for doing plain text and diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 93f007353a..27b4be117d 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,15 @@ +Fri Mar 27 17:58:41 1998 Owen Taylor + + * gtk/gtkhandlebox.c (gtk_handle_box_paint): Don't clear + the window on an expose event. On draws, just clear the + portion we are redrawing. + + * gdk/gdkfont.c (gdk_fontset_load): Corrected calculation + of fontset ascent/descent. + + * gtk/gtkwidget.[ch]: Added new function to show a toplevel + window and wait for it to be mapped, gtk_window_show_now () + Fri Mar 27 08:51:17 PST 1998 Shawn T. Amundson * docs/Makefile.sgml: some stuff for doing plain text and diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 93f007353a..27b4be117d 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,15 @@ +Fri Mar 27 17:58:41 1998 Owen Taylor + + * gtk/gtkhandlebox.c (gtk_handle_box_paint): Don't clear + the window on an expose event. On draws, just clear the + portion we are redrawing. + + * gdk/gdkfont.c (gdk_fontset_load): Corrected calculation + of fontset ascent/descent. + + * gtk/gtkwidget.[ch]: Added new function to show a toplevel + window and wait for it to be mapped, gtk_window_show_now () + Fri Mar 27 08:51:17 PST 1998 Shawn T. Amundson * docs/Makefile.sgml: some stuff for doing plain text and diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 93f007353a..27b4be117d 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,15 @@ +Fri Mar 27 17:58:41 1998 Owen Taylor + + * gtk/gtkhandlebox.c (gtk_handle_box_paint): Don't clear + the window on an expose event. On draws, just clear the + portion we are redrawing. + + * gdk/gdkfont.c (gdk_fontset_load): Corrected calculation + of fontset ascent/descent. + + * gtk/gtkwidget.[ch]: Added new function to show a toplevel + window and wait for it to be mapped, gtk_window_show_now () + Fri Mar 27 08:51:17 PST 1998 Shawn T. Amundson * docs/Makefile.sgml: some stuff for doing plain text and diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 93f007353a..27b4be117d 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +Fri Mar 27 17:58:41 1998 Owen Taylor + + * gtk/gtkhandlebox.c (gtk_handle_box_paint): Don't clear + the window on an expose event. On draws, just clear the + portion we are redrawing. + + * gdk/gdkfont.c (gdk_fontset_load): Corrected calculation + of fontset ascent/descent. + + * gtk/gtkwidget.[ch]: Added new function to show a toplevel + window and wait for it to be mapped, gtk_window_show_now () + Fri Mar 27 08:51:17 PST 1998 Shawn T. Amundson * docs/Makefile.sgml: some stuff for doing plain text and diff --git a/gdk/gdkfont.c b/gdk/gdkfont.c index c0c19ca2c9..8b45be3940 100644 --- a/gdk/gdkfont.c +++ b/gdk/gdkfont.c @@ -86,13 +86,22 @@ gdk_fontset_load (gchar *fontset_name) } else { - XFontSetExtents *extent = XExtentsOfFontSet(fontset); - + gint num_fonts; + gint i; + XFontStruct **font_structs; + gchar **font_names; + private->xfont = fontset; font->type = GDK_FONT_FONTSET; - /* how to define ascent and descent for fontset ??? */ - font->ascent = extent->max_logical_extent.height; - font->descent = font->ascent / 4 ; + num_fonts = XFontsOfFontSet (fontset, &font_structs, &font_names); + + font->ascent = font->descent = 0; + + for (i = 0; i < num_fonts; i++) + { + font->ascent = MAX (font->ascent, font_structs[i]->ascent); + font->descent = MAX (font->descent, font_structs[i]->descent); + } } return font; } diff --git a/gdk/x11/gdkfont-x11.c b/gdk/x11/gdkfont-x11.c index c0c19ca2c9..8b45be3940 100644 --- a/gdk/x11/gdkfont-x11.c +++ b/gdk/x11/gdkfont-x11.c @@ -86,13 +86,22 @@ gdk_fontset_load (gchar *fontset_name) } else { - XFontSetExtents *extent = XExtentsOfFontSet(fontset); - + gint num_fonts; + gint i; + XFontStruct **font_structs; + gchar **font_names; + private->xfont = fontset; font->type = GDK_FONT_FONTSET; - /* how to define ascent and descent for fontset ??? */ - font->ascent = extent->max_logical_extent.height; - font->descent = font->ascent / 4 ; + num_fonts = XFontsOfFontSet (fontset, &font_structs, &font_names); + + font->ascent = font->descent = 0; + + for (i = 0; i < num_fonts; i++) + { + font->ascent = MAX (font->ascent, font_structs[i]->ascent); + font->descent = MAX (font->descent, font_structs[i]->descent); + } } return font; } diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c index 1e12f1a766..e0f44ceaea 100644 --- a/gtk/gtkhandlebox.c +++ b/gtk/gtkhandlebox.c @@ -620,8 +620,14 @@ gtk_handle_box_paint (GtkWidget *widget, width = widget->allocation.width; height = widget->allocation.height - DRAG_HANDLE_SIZE; } - - gdk_window_clear (hb->bin_window); + + if (!event) + gdk_window_clear_area (hb->bin_window, + area->x, + area->y, + area->width, + area->height); + gtk_draw_shadow (widget->style, hb->bin_window, GTK_WIDGET_STATE (widget), diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index cd0cd339fc..23405b5f2a 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -1240,6 +1240,48 @@ gtk_widget_show (GtkWidget *widget) gtk_signal_emit (GTK_OBJECT (widget), widget_signals[SHOW]); } + +/************************************************************* + * gtk_widget_show_now: + * Show a widget, and if it is an unmapped toplevel widget + * wait for the map_event before returning + * + * Warning: This routine will call the main loop recursively. + * + * arguments: + * + * results: + *************************************************************/ + +static void +gtk_widget_show_map_callback (GtkWidget *widget, GdkEvent *event, gint *flag) +{ + *flag = TRUE; + gtk_signal_disconnect_by_data (GTK_OBJECT (widget), flag); +} + +void +gtk_widget_show_now (GtkWidget *widget) +{ + gint flag = FALSE; + + /* make sure we will get event */ + if (!GTK_WIDGET_MAPPED (widget) && + GTK_WIDGET_TOPLEVEL (widget)) + { + gtk_widget_show (widget); + + gtk_signal_connect (GTK_OBJECT (widget), "map_event", + GTK_SIGNAL_FUNC (gtk_widget_show_map_callback), + &flag); + + while (!flag) + gtk_main_iteration(); + } + else + gtk_widget_show (widget); +} + /***************************************** * gtk_widget_hide: * diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h index a313a2af0d..438696d267 100644 --- a/gtk/gtkwidget.h +++ b/gtk/gtkwidget.h @@ -377,6 +377,7 @@ void gtk_widget_setv (GtkWidget *widget, GtkArg *args); void gtk_widget_unparent (GtkWidget *widget); void gtk_widget_show (GtkWidget *widget); +void gtk_widget_show_now (GtkWidget *widget); void gtk_widget_hide (GtkWidget *widget); void gtk_widget_show_all (GtkWidget *widget); void gtk_widget_hide_all (GtkWidget *widget); diff --git a/gtk/testgtkrc b/gtk/testgtkrc index 7ea894aa70..a1b376a173 100644 --- a/gtk/testgtkrc +++ b/gtk/testgtkrc @@ -12,8 +12,8 @@ pixmap_path "." style "default" { - fontset = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*" -# font = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1" +# fontset = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*" + font = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*" } style "window" diff --git a/tests/testgtkrc b/tests/testgtkrc index 7ea894aa70..a1b376a173 100644 --- a/tests/testgtkrc +++ b/tests/testgtkrc @@ -12,8 +12,8 @@ pixmap_path "." style "default" { - fontset = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*" -# font = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1" +# fontset = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*" + font = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*" } style "window"