[maemo-commits] [maemo-commits] r19119 - in projects/haf/trunk/gtk+: . gtk
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Tue Aug 11 16:02:54 EEST 2009
- Previous message: [maemo-commits] r19118 - projects/haf/tags/hildon-control-panel/1:2.2.14-1
- Next message: [maemo-commits] r19120 - in projects/haf/trunk/sapwood: . engine
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: herzi Date: 2009-08-11 16:02:15 +0300 (Tue, 11 Aug 2009) New Revision: 19119 Modified: projects/haf/trunk/gtk+/ChangeLog projects/haf/trunk/gtk+/gtk/gtktextview.c Log: 2009-08-11 Alejandro G. Castro <alex at igalia.com> Fixes: NB#131431 (gdk_flush in sapwood is causing tearing) * gtk/gtktextview.c, (gtk_text_view_size_allocate): Added a condition to test if the size is going to be too big during the rendering. Modified: projects/haf/trunk/gtk+/ChangeLog =================================================================== --- projects/haf/trunk/gtk+/ChangeLog 2009-08-11 11:16:49 UTC (rev 19118) +++ projects/haf/trunk/gtk+/ChangeLog 2009-08-11 13:02:15 UTC (rev 19119) @@ -1,3 +1,11 @@ +2009-08-11 Alejandro G. Castro <alex at igalia.com> + + Fixes: NB#131431 (gdk_flush in sapwood is causing tearing) + + * gtk/gtktextview.c, + (gtk_text_view_size_allocate): Added a condition to test if the + size is going to be too big during the rendering. + 2009-08-11 Sven Herzberg <herzi at lanedo.com> About: NB#129361 - [AF checked] compositing issues with rgba Modified: projects/haf/trunk/gtk+/gtk/gtktextview.c =================================================================== --- projects/haf/trunk/gtk+/gtk/gtktextview.c 2009-08-11 11:16:49 UTC (rev 19118) +++ projects/haf/trunk/gtk+/gtk/gtktextview.c 2009-08-11 13:02:15 UTC (rev 19119) @@ -89,6 +89,11 @@ #define DEBUG_VALIDATION_AND_SCROLLING #endif + +#ifdef MAEMO_CHANGES +#define TEXT_VIEW_MAX_WINDOW_SIZE 16384 +#endif + #ifdef DEBUG_VALIDATION_AND_SCROLLING #define DV(x) (x) #else @@ -3379,13 +3384,36 @@ widget->allocation.width != allocation->width || widget->allocation.height != allocation->height; - widget->allocation = *allocation; +#ifdef MAEMO_CHANGES + widget->allocation.x = allocation->x; + widget->allocation.y = allocation->y; + if (allocation->width > TEXT_VIEW_MAX_WINDOW_SIZE) + { + widget->allocation.width = TEXT_VIEW_MAX_WINDOW_SIZE; + g_warning ("gtk_text_view_size_allocate: the text view requires too much width %d, add it directly to a scrollable widget instead of using a viewport", allocation->width); + } + else + { + widget->allocation.width = allocation->width; + } + + if (allocation->height > TEXT_VIEW_MAX_WINDOW_SIZE) + { + widget->allocation.height = TEXT_VIEW_MAX_WINDOW_SIZE; + g_warning ("gtk_text_view_size_allocate: the text view requires too much height %d, add it directly to a scrollable widget instead of using a viewport", allocation->height); + } + else + { + widget->allocation.height = allocation->height; + } +#endif + if (GTK_WIDGET_REALIZED (widget)) { gdk_window_move_resize (widget->window, - allocation->x, allocation->y, - allocation->width, allocation->height); + widget->allocation.x, widget->allocation.y, + widget->allocation.width, widget->allocation.height); } /* distribute width/height among child windows. Ensure all @@ -3402,7 +3430,7 @@ else focus_edge_width = focus_width; - width = allocation->width - focus_edge_width * 2 - GTK_CONTAINER (text_view)->border_width * 2; + width = widget->allocation.width - focus_edge_width * 2 - GTK_CONTAINER (text_view)->border_width * 2; if (text_view->left_window) left_rect.width = text_view->left_window->requisition.width; @@ -3424,7 +3452,7 @@ bottom_rect.width = text_rect.width; - height = allocation->height - focus_edge_width * 2 - GTK_CONTAINER (text_view)->border_width * 2; + height = widget->allocation.height - focus_edge_width * 2 - GTK_CONTAINER (text_view)->border_width * 2; if (text_view->top_window) top_rect.height = text_view->top_window->requisition.height;
- Previous message: [maemo-commits] r19118 - projects/haf/tags/hildon-control-panel/1:2.2.14-1
- Next message: [maemo-commits] r19120 - in projects/haf/trunk/sapwood: . engine
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]