diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-12-15 02:37:03 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-12-21 12:07:00 -0500 |
commit | 6c16ddc2d361f6c644550e22b01fb90bf6ab1ed1 (patch) | |
tree | 172f83e2081d7f7c30c5bcc709ae7a3e64c5cb58 /gdk/gdkapplaunchcontext.c | |
parent | fa33839d72e54e67fa01e9063e2b03a7e1fdaf68 (diff) | |
download | gtk+-6c16ddc2d361f6c644550e22b01fb90bf6ab1ed1.tar.gz |
Make GdkAppLaunchContext work again
We didn't set the display, ever. Add a construct-only property
for this purpose.
Diffstat (limited to 'gdk/gdkapplaunchcontext.c')
-rw-r--r-- | gdk/gdkapplaunchcontext.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/gdk/gdkapplaunchcontext.c b/gdk/gdkapplaunchcontext.c index 075f8fd890..88d5a538d0 100644 --- a/gdk/gdkapplaunchcontext.c +++ b/gdk/gdkapplaunchcontext.c @@ -66,19 +66,69 @@ static void gdk_app_launch_context_launch_failed (GAppLaunchContext *context, const gchar *startup_notify_id); +enum +{ + PROP_0, + PROP_DISPLAY +}; + G_DEFINE_TYPE (GdkAppLaunchContext, gdk_app_launch_context, G_TYPE_APP_LAUNCH_CONTEXT) static void +gdk_app_launch_context_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdkAppLaunchContext *context = GDK_APP_LAUNCH_CONTEXT (object); + + switch (prop_id) + { + case PROP_DISPLAY: + g_value_set_object (value, context->display); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +gdk_app_launch_context_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdkAppLaunchContext *context = GDK_APP_LAUNCH_CONTEXT (object); + + switch (prop_id) + { + case PROP_DISPLAY: + context->display = g_value_dup_object (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void gdk_app_launch_context_class_init (GdkAppLaunchContextClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GAppLaunchContextClass *context_class = G_APP_LAUNCH_CONTEXT_CLASS (klass); + gobject_class->set_property = gdk_app_launch_context_set_property, + gobject_class->get_property = gdk_app_launch_context_get_property; + gobject_class->finalize = gdk_app_launch_context_finalize; context_class->get_display = gdk_app_launch_context_get_display; context_class->get_startup_notify_id = gdk_app_launch_context_get_startup_notify_id; context_class->launch_failed = gdk_app_launch_context_launch_failed; + + g_object_class_install_property (gobject_class, PROP_DISPLAY, + g_param_spec_object ("display", P_("Display"), P_("Display"), + GDK_TYPE_DISPLAY, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); } static void |