From af7ab9c630bd8dc88e23fc664fb7d98cd03f1f55 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Wed, 12 Dec 2001 21:30:08 +0000 Subject: [PATCH] Remove support for "prepainting" the menu before realizing other than via Wed Dec 12 16:18:26 2001 Owen Taylor * gtk/gtkmenu.c (gtk_menu_realize): Remove support for "prepainting" the menu before realizing other than via gtk_style_set_background() - this was broken when we added menu scroll support. * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the window in the expose event -- fixes problem with border flashing during scrolling. --- ChangeLog | 11 +++++++++++ ChangeLog.pre-2-0 | 11 +++++++++++ ChangeLog.pre-2-10 | 11 +++++++++++ ChangeLog.pre-2-2 | 11 +++++++++++ ChangeLog.pre-2-4 | 11 +++++++++++ ChangeLog.pre-2-6 | 11 +++++++++++ ChangeLog.pre-2-8 | 11 +++++++++++ gtk/gtkmenu.c | 35 ++++++++++++++++++----------------- 8 files changed, 95 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e6efdf7aa..02f0de5c4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Wed Dec 12 16:18:26 2001 Owen Taylor + + * gtk/gtkmenu.c (gtk_menu_realize): Remove support for + "prepainting" the menu before realizing other than + via gtk_style_set_background() - this was broken when + we added menu scroll support. + + * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the + window in the expose event -- fixes problem with border + flashing during scrolling. + Wed Dec 12 15:11:49 2001 Owen Taylor * gtk/gtksettings.c (gtk_settings_get_property): Support diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 6e6efdf7aa..02f0de5c4b 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,14 @@ +Wed Dec 12 16:18:26 2001 Owen Taylor + + * gtk/gtkmenu.c (gtk_menu_realize): Remove support for + "prepainting" the menu before realizing other than + via gtk_style_set_background() - this was broken when + we added menu scroll support. + + * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the + window in the expose event -- fixes problem with border + flashing during scrolling. + Wed Dec 12 15:11:49 2001 Owen Taylor * gtk/gtksettings.c (gtk_settings_get_property): Support diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 6e6efdf7aa..02f0de5c4b 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,14 @@ +Wed Dec 12 16:18:26 2001 Owen Taylor + + * gtk/gtkmenu.c (gtk_menu_realize): Remove support for + "prepainting" the menu before realizing other than + via gtk_style_set_background() - this was broken when + we added menu scroll support. + + * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the + window in the expose event -- fixes problem with border + flashing during scrolling. + Wed Dec 12 15:11:49 2001 Owen Taylor * gtk/gtksettings.c (gtk_settings_get_property): Support diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 6e6efdf7aa..02f0de5c4b 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,14 @@ +Wed Dec 12 16:18:26 2001 Owen Taylor + + * gtk/gtkmenu.c (gtk_menu_realize): Remove support for + "prepainting" the menu before realizing other than + via gtk_style_set_background() - this was broken when + we added menu scroll support. + + * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the + window in the expose event -- fixes problem with border + flashing during scrolling. + Wed Dec 12 15:11:49 2001 Owen Taylor * gtk/gtksettings.c (gtk_settings_get_property): Support diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 6e6efdf7aa..02f0de5c4b 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,14 @@ +Wed Dec 12 16:18:26 2001 Owen Taylor + + * gtk/gtkmenu.c (gtk_menu_realize): Remove support for + "prepainting" the menu before realizing other than + via gtk_style_set_background() - this was broken when + we added menu scroll support. + + * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the + window in the expose event -- fixes problem with border + flashing during scrolling. + Wed Dec 12 15:11:49 2001 Owen Taylor * gtk/gtksettings.c (gtk_settings_get_property): Support diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 6e6efdf7aa..02f0de5c4b 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,14 @@ +Wed Dec 12 16:18:26 2001 Owen Taylor + + * gtk/gtkmenu.c (gtk_menu_realize): Remove support for + "prepainting" the menu before realizing other than + via gtk_style_set_background() - this was broken when + we added menu scroll support. + + * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the + window in the expose event -- fixes problem with border + flashing during scrolling. + Wed Dec 12 15:11:49 2001 Owen Taylor * gtk/gtksettings.c (gtk_settings_get_property): Support diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 6e6efdf7aa..02f0de5c4b 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,14 @@ +Wed Dec 12 16:18:26 2001 Owen Taylor + + * gtk/gtkmenu.c (gtk_menu_realize): Remove support for + "prepainting" the menu before realizing other than + via gtk_style_set_background() - this was broken when + we added menu scroll support. + + * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the + window in the expose event -- fixes problem with border + flashing during scrolling. + Wed Dec 12 15:11:49 2001 Owen Taylor * gtk/gtksettings.c (gtk_settings_get_property): Support diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index e3940b511a..f2b30b99f6 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -84,7 +84,8 @@ static void gtk_menu_size_request (GtkWidget *widget, GtkRequisition *requisition); static void gtk_menu_size_allocate (GtkWidget *widget, GtkAllocation *allocation); -static void gtk_menu_paint (GtkWidget *widget); +static void gtk_menu_paint (GtkWidget *widget, + GdkEventExpose *expose); static void gtk_menu_show (GtkWidget *widget); static gboolean gtk_menu_expose (GtkWidget *widget, GdkEventExpose *event); @@ -1223,8 +1224,6 @@ gtk_menu_realize (GtkWidget *widget) gtk_menu_scroll_item_visible (GTK_MENU_SHELL (widget), GTK_MENU_SHELL (widget)->active_menu_item); - gtk_menu_paint (widget); - gdk_window_show (menu->bin_window); gdk_window_show (menu->view_window); } @@ -1444,20 +1443,22 @@ gtk_menu_size_allocate (GtkWidget *widget, } static void -gtk_menu_paint (GtkWidget *widget) +gtk_menu_paint (GtkWidget *widget, + GdkEventExpose *event) { - gint border_x; - gint border_y; - gint width, height; - gint menu_height; - gint top_pos; GtkMenu *menu; + gint width, height; + gint border_x, border_y; g_return_if_fail (GTK_IS_MENU (widget)); menu = GTK_MENU (widget); - if (GTK_WIDGET_DRAWABLE (widget)) + border_x = GTK_CONTAINER (widget)->border_width + widget->style->xthickness; + border_y = GTK_CONTAINER (widget)->border_width + widget->style->ythickness; + gdk_window_get_size (widget->window, &width, &height); + + if (event->window == widget->window) { gtk_paint_box (widget->style, widget->window, @@ -1465,11 +1466,6 @@ gtk_menu_paint (GtkWidget *widget) GTK_SHADOW_OUT, NULL, widget, "menu", 0, 0, -1, -1); - - border_x = GTK_CONTAINER (widget)->border_width + widget->style->xthickness; - border_y = GTK_CONTAINER (widget)->border_width + widget->style->ythickness; - gdk_window_get_size (widget->window, &width, &height); - if (menu->upper_arrow_visible && !menu->tearoff_active) { gtk_paint_box (widget->style, @@ -1523,7 +1519,12 @@ gtk_menu_paint (GtkWidget *widget) MENU_SCROLL_ARROW_HEIGHT - 2 * border_y - 2, MENU_SCROLL_ARROW_HEIGHT - 2 * border_y - 2); } - + } + else if (event->window == menu->view_window) + { + gint menu_height; + gint top_pos; + if (menu->scroll_offset < 0) gtk_paint_box (widget->style, menu->view_window, @@ -1559,7 +1560,7 @@ gtk_menu_expose (GtkWidget *widget, if (GTK_WIDGET_DRAWABLE (widget)) { - gtk_menu_paint (widget); + gtk_menu_paint (widget, event); (* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event); }