Stop using the gdk_draw_* API
authorKristian Høgsberg <krh@bitplanet.net>
Thu, 15 Jul 2010 13:57:23 +0000 (09:57 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 15 Jul 2010 13:57:23 +0000 (09:57 -0400)
Only one gdk_draw_rectangle() call let.

src/vte.c

index d52f131..9b84a98 100644 (file)
--- a/src/vte.c
+++ b/src/vte.c
@@ -4839,26 +4839,29 @@ void
 _vte_terminal_visible_beep(VteTerminal *terminal)
 {
        GtkWidget *widget;
+       GtkAllocation allocation;
+       GtkStyle *style;
+       PangoColor color;
 
        widget = &terminal->widget;
 
        if (gtk_widget_get_realized (widget)) {
-               GtkStyle *style;
-               GtkAllocation allocation;
 
                style = gtk_widget_get_style (widget);
                gtk_widget_get_allocation (widget, &allocation);
-
-               /* Fill the screen with the default foreground color, and then
-                * repaint everything, to provide visual bell. */
-               gdk_draw_rectangle (gtk_widget_get_window (widget),
-                                   style->fg_gc[gtk_widget_get_state (widget)],
-                                   TRUE, 0, 0, allocation.width, allocation.height);
-
-               gdk_flush ();
-
-               /* Force the repaint. */
-               _vte_invalidate_all (terminal); /* max delay of UPDATE_REPEAT_TIMEOUT */
+               color.red = style->fg[gtk_widget_get_state (widget)].red;
+               color.green = style->fg[gtk_widget_get_state (widget)].green;
+               color.blue = style->fg[gtk_widget_get_state (widget)].blue;
+
+               _vte_draw_start(terminal->pvt->draw);
+               _vte_draw_fill_rectangle(terminal->pvt->draw,
+                                        0, 0,
+                                        allocation.width, allocation.height,
+                                        &color, VTE_DRAW_OPAQUE);
+               _vte_draw_end(terminal->pvt->draw);
+
+               /* Force the repaint, max delay of UPDATE_REPEAT_TIMEOUT */
+               _vte_invalidate_all (terminal);
        }
 }