Only draw in expose callback in read linear window
This commit is contained in:
committed by
Stéphane Lesimple
parent
58a35bc565
commit
fb7198c1e9
@@ -47,9 +47,7 @@ static void update_geometry(void);
|
|||||||
|
|
||||||
static gboolean max_speed_idle_func(gpointer data)
|
static gboolean max_speed_idle_func(gpointer data)
|
||||||
{
|
{
|
||||||
gdk_window_clear(gtk_widget_get_window(Closure->readLinearCurveArea));
|
gtk_widget_queue_draw(Closure->readLinearCurveArea);
|
||||||
update_geometry();
|
|
||||||
redraw_curve();
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -203,7 +201,7 @@ void GuiAddCurveValues(void *rc_ptr, int percent, int color, int c2)
|
|||||||
|
|
||||||
static gboolean curve_mark_idle_func(gpointer data)
|
static gboolean curve_mark_idle_func(gpointer data)
|
||||||
{
|
{
|
||||||
GuiDrawSpiral(Closure->readLinearSpiral);
|
gtk_widget_queue_draw(Closure->readLinearSpiral->widget);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -328,29 +326,20 @@ void GuiResetLinearReadWindow()
|
|||||||
|
|
||||||
GuiZeroCurve(Closure->readLinearCurve);
|
GuiZeroCurve(Closure->readLinearCurve);
|
||||||
GuiFillSpiral(Closure->readLinearSpiral, Closure->background);
|
GuiFillSpiral(Closure->readLinearSpiral, Closure->background);
|
||||||
GuiDrawSpiral(Closure->readLinearSpiral);
|
if (Closure->readLinearSpiral->widget)
|
||||||
|
gtk_widget_queue_draw(Closure->readLinearSpiral->widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Re-layout and redraw the read window while it is in use.
|
* Re-layout and redraw the curve drawing area while it is in use.
|
||||||
* Required to add the information that CRC data is available,
|
* Required to add the information that CRC data is available,
|
||||||
* since this happens when the the initial rendering of the window
|
* since this happens when the the initial rendering of the window
|
||||||
* contents have already been carried out.
|
* contents have already been carried out.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static gboolean redraw_idle_func(gpointer data)
|
static gboolean redraw_idle_func(gpointer data)
|
||||||
{ GdkRectangle rect;
|
{
|
||||||
GdkWindow *window;
|
gtk_widget_queue_draw(Closure->readLinearCurveArea);
|
||||||
gint ignore;
|
|
||||||
|
|
||||||
/* Trigger an expose event for the drawing area. */
|
|
||||||
|
|
||||||
window = gtk_widget_get_parent_window(Closure->readLinearCurveArea);
|
|
||||||
if(window)
|
|
||||||
{ gdk_window_get_geometry(window, &rect.x, &rect.y, &rect.width, &rect.height, &ignore);
|
|
||||||
|
|
||||||
gdk_window_invalidate_rect(window, &rect, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user