[gtk+] widget: Add a defualt snapshot vfunc
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Add a defualt snapshot vfunc
- Date: Thu, 17 Nov 2016 23:48:21 +0000 (UTC)
commit efa1c6cbd53e3e2744afe50ecf9c7da138ab5dff
Author: Benjamin Otte <otte redhat com>
Date: Fri Nov 18 00:46:49 2016 +0100
widget: Add a defualt snapshot vfunc
Just to avoid having to do NULL checks when calling
widget_class->snapshot. We were crashing with drawing areas who don't
have a draw or a snapshot vfunc (woot!).
gtk/gtkwidget.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index c45f9a3..a01a344 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -950,6 +950,13 @@ gtk_widget_draw_marshallerv (GClosure *closure,
}
static void
+gtk_widget_real_snapshot (GtkWidget *widget,
+ GtkSnapshot *snapshot)
+{
+ /* nothing to do here */
+}
+
+static void
gtk_widget_class_init (GtkWidgetClass *klass)
{
static GObjectNotifyContext cpn_context = { 0, NULL, NULL };
@@ -1013,6 +1020,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
klass->grab_notify = NULL;
klass->child_notify = NULL;
klass->draw = NULL;
+ klass->snapshot = gtk_widget_real_snapshot;
klass->mnemonic_activate = gtk_widget_real_mnemonic_activate;
klass->grab_focus = gtk_widget_real_grab_focus;
klass->focus = gtk_widget_real_focus;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]