[dia] Bug 677351 - Idle priority of canvas rendering adapted to GTK+
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] Bug 677351 - Idle priority of canvas rendering adapted to GTK+
- Date: Sat, 23 Jun 2012 11:49:53 +0000 (UTC)
commit 722626f988567a89c90ac58599e9e6c35041980b
Author: Hans Breuer <hans breuer org>
Date: Sat Jun 23 15:37:59 2012 +0200
Bug 677351 - Idle priority of canvas rendering adapted to GTK+
The canvas was rendered with lower priority than both GTK+
redraw and resize leading to suboptimal redraw behavior when
resizing the canvas window. Now the priority is between
resize and redraw of GTK+.
app/display.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/app/display.c b/app/display.c
index 816be9d..d7b6147 100644
--- a/app/display.c
+++ b/app/display.c
@@ -530,8 +530,11 @@ ddisplay_add_display_area(DDisplay *ddisp,
bottom = dia_renderer_get_height_pixels (ddisp->renderer);
/* draw some rectangles to show where updates are...*/
- /* gdk_draw_rectangle(gtk_widget_get_window(ddisp->canvas), gtk_widget_get_style(ddisp->canvas)->black_gc, TRUE, left, top, right-left,bottom-top); */
-
+ /*
+ gdk_draw_rectangle(gtk_widget_get_window(ddisp->canvas),
+ gtk_widget_get_style(ddisp->canvas)->black_gc, TRUE,
+ left, top, right-left,bottom-top);
+ */
/* Temporarily just do a union of all Irectangles: */
if (ddisp->display_areas==NULL) {
r = g_new(IRectangle,1);
@@ -612,9 +615,16 @@ ddisplay_update_handler(DDisplay *ddisp)
void
ddisplay_flush(DDisplay *ddisp)
{
- /* if no update is queued, queue update */
+ /* if no update is queued, queue update
+ *
+ * GTK+ handles resize with higher priority than redraw
+ * http://developer.gnome.org/gtk/2.24/gtk-General.html#GTK-PRIORITY-REDRAW:CAPS
+ * GDK_PRIORITY_REDRAW = (G_PRIORITY_HIGH_IDLE + 20) with gtk-2-22
+ * GTK_PRIORITY_RESIZE = (G_PRIORITY_HIGH_IDLE + 10)
+ * Dia's canvas rendering is in between
+ */
if (!ddisp->update_id)
- ddisp->update_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, (GSourceFunc)ddisplay_update_handler, ddisp, NULL);
+ ddisp->update_id = g_idle_add_full (G_PRIORITY_HIGH_IDLE+15, (GSourceFunc)ddisplay_update_handler, ddisp, NULL);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]