Add a getter for GdkAppLaunchContext::display

This commit is contained in:
Matthias Clasen 2020-02-24 07:39:20 -05:00
parent 3735c9d155
commit 4ca0a93324
3 changed files with 28 additions and 7 deletions

View File

@ -994,6 +994,7 @@ gdk_wayland_surface_get_type
<TITLE>Application launching</TITLE>
<FILE>gdkapplaunchcontext</FILE>
GdkAppLaunchContext
gdk_app_launch_context_get_display
gdk_app_launch_context_set_desktop
gdk_app_launch_context_set_timestamp
gdk_app_launch_context_set_icon

View File

@ -60,9 +60,9 @@
*/
static void gdk_app_launch_context_finalize (GObject *object);
static gchar * gdk_app_launch_context_get_display (GAppLaunchContext *context,
GAppInfo *info,
GList *files);
static gchar * gdk_app_launch_context_get_display_name (GAppLaunchContext *context,
GAppInfo *info,
GList *files);
static gchar * gdk_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
GAppInfo *info,
GList *files);
@ -125,7 +125,7 @@ gdk_app_launch_context_class_init (GdkAppLaunchContextClass *klass)
gobject_class->finalize = gdk_app_launch_context_finalize;
context_class->get_display = gdk_app_launch_context_get_display;
context_class->get_display = gdk_app_launch_context_get_display_name;
context_class->get_startup_notify_id = gdk_app_launch_context_get_startup_notify_id;
context_class->launch_failed = gdk_app_launch_context_launch_failed;
@ -158,9 +158,9 @@ gdk_app_launch_context_finalize (GObject *object)
}
static gchar *
gdk_app_launch_context_get_display (GAppLaunchContext *context,
GAppInfo *info,
GList *files)
gdk_app_launch_context_get_display_name (GAppLaunchContext *context,
GAppInfo *info,
GList *files)
{
GdkAppLaunchContext *ctx = GDK_APP_LAUNCH_CONTEXT (context);
GdkDisplay *display;
@ -173,6 +173,22 @@ gdk_app_launch_context_get_display (GAppLaunchContext *context,
return g_strdup (gdk_display_get_name (display));
}
/**
* gdk_app_launch_context_get_display:
* @context: a #GdkAppLaunchContext
*
* Gets the #GdkDispolat that @context is for.
*
* Returns: the display of @context
*/
GdkDisplay *
gdk_app_launch_context_get_display (GdkAppLaunchContext *context)
{
g_return_val_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context), NULL);
return context->display;
}
/**
* gdk_app_launch_context_set_desktop:
* @context: a #GdkAppLaunchContext

View File

@ -38,6 +38,9 @@ G_BEGIN_DECLS
GDK_AVAILABLE_IN_ALL
GType gdk_app_launch_context_get_type (void);
GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_app_launch_context_get_display (GdkAppLaunchContext *context);
GDK_AVAILABLE_IN_ALL
void gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context,
gint desktop);
@ -51,6 +54,7 @@ GDK_AVAILABLE_IN_ALL
void gdk_app_launch_context_set_icon_name (GdkAppLaunchContext *context,
const char *icon_name);
G_END_DECLS
#endif /* __GDK_APP_LAUNCH_CONTEXT_H__ */