[goocanvas] Got rid of a few more warnings.
- From: Damon Chaplin <damon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goocanvas] Got rid of a few more warnings.
- Date: Fri, 1 Nov 2013 17:31:13 +0000 (UTC)
commit 59b981af3721c2709084d6dcfad39c27dedfc32e
Author: Damon Chaplin <damon gnome org>
Date: Fri Nov 1 17:30:23 2013 +0000
Got rid of a few more warnings.
src/goocanvas.c | 13 +++++++++----
src/goocanvasgroup.c | 4 ----
src/goocanvaswidget.c | 2 +-
3 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/src/goocanvas.c b/src/goocanvas.c
index c34476f..90dd084 100644
--- a/src/goocanvas.c
+++ b/src/goocanvas.c
@@ -1828,6 +1828,9 @@ request_static_redraw (GooCanvas *canvas,
position, but redraws them at their given new position.
We redraw one item at a time to avoid GTK+ merging the rectangles into
one big one. */
+/* NOTE: GTK+ 3.0 always redraws the entire window when scrolling, so
+ we don't need to do this. */
+#if 0
static void
redraw_static_items_at_position (GooCanvas *canvas,
gint x,
@@ -1867,6 +1870,7 @@ redraw_static_items_at_position (GooCanvas *canvas,
priv->static_window_y = window_y_copy;
}
}
+#endif
/* This makes sure the canvas is all set up correctly, i.e. the scrollbar
@@ -3205,14 +3209,15 @@ goo_canvas_motion (GtkWidget *widget,
GdkEventMotion *event)
{
GooCanvas *canvas = GOO_CANVAS (widget);
+ GdkDevice *device = gdk_event_get_device ((GdkEvent*) event);
if (event->window != canvas->canvas_window)
return FALSE;
- /* For motion notify hint events we need to call gdk_window_get_pointer()
- to let X know we're ready for another pointer event. */
- if (event->is_hint)
- gdk_window_get_pointer (event->window, NULL, NULL, NULL);
+ /* For motion notify hint events we need to request the position to let X
+ know we're ready for another event. */
+ if (event->is_hint && device)
+ gdk_window_get_device_position (event->window, device, NULL, NULL, NULL);
update_pointer_item (canvas, (GdkEvent*) event);
diff --git a/src/goocanvasgroup.c b/src/goocanvasgroup.c
index 8a6e082..01448be 100644
--- a/src/goocanvasgroup.c
+++ b/src/goocanvasgroup.c
@@ -172,12 +172,10 @@ goo_canvas_group_new (GooCanvasItem *parent,
...)
{
GooCanvasItem *item;
- GooCanvasGroup *group;
va_list var_args;
const char *first_property;
item = g_object_new (GOO_TYPE_CANVAS_GROUP, NULL);
- group = (GooCanvasGroup*) item;
va_start (var_args, parent);
first_property = va_arg (var_args, char*);
@@ -894,12 +892,10 @@ goo_canvas_group_model_new (GooCanvasItemModel *parent,
...)
{
GooCanvasItemModel *model;
- GooCanvasGroupModel *gmodel;
va_list var_args;
const char *first_property;
model = g_object_new (GOO_TYPE_CANVAS_GROUP_MODEL, NULL);
- gmodel = (GooCanvasGroupModel*) model;
va_start (var_args, parent);
first_property = va_arg (var_args, char*);
diff --git a/src/goocanvaswidget.c b/src/goocanvaswidget.c
index eab6d63..36fc3f4 100644
--- a/src/goocanvaswidget.c
+++ b/src/goocanvaswidget.c
@@ -214,7 +214,7 @@ goo_canvas_widget_get_widget_size (GooCanvasWidget *witem,
{
/* Get the widget's requested size, if we need it. */
if (witem->width < 0 || witem->height < 0)
- gtk_widget_size_request (witem->widget, &requisition);
+ gtk_widget_get_preferred_size (witem->widget, NULL, &requisition);
*width = witem->width < 0 ? requisition.width : witem->width;
*height = witem->height < 0 ? requisition.height : witem->height;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]