summaryrefslogtreecommitdiff
path: root/gtk/gtkapplication-wayland.c
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2015-03-23 13:08:09 +0800
committerJonas Ådahl <jadahl@gmail.com>2015-03-31 12:37:50 +0800
commit71256a0f94972be8220049b1c99dc2db61e56b5a (patch)
tree4ee8a5e3cd7ee24bc3ccdfa1bba21ec445a19ebc /gtk/gtkapplication-wayland.c
parent5a0d718239992680d99e4fda8a54992b19abd897 (diff)
downloadgtk+-71256a0f94972be8220049b1c99dc2db61e56b5a.tar.gz
wayland: Set a more correct xdg_surface application id
The "app_id" of a xdg_surface should be the ID that can potentially be used to get the DBUS name or the .desktop file. For GtkApplication programs this is often the ID passed when creating the GtkApplication object, so when available lets use that. As fallbacks, first try g_get_prgname as it often corresponds to the basename part of the .dektop file for non-GtkApplication programs. Otherwise use gdk_get_program_class, even though that string usually doesn't conform to the expectations of xdg_surface.set_application_id. https://bugzilla.gnome.org/show_bug.cgi?id=746435
Diffstat (limited to 'gtk/gtkapplication-wayland.c')
-rw-r--r--gtk/gtkapplication-wayland.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gtk/gtkapplication-wayland.c b/gtk/gtkapplication-wayland.c
index c0b18bd22c..84df82c275 100644
--- a/gtk/gtkapplication-wayland.c
+++ b/gtk/gtkapplication-wayland.c
@@ -35,9 +35,11 @@ typedef struct
G_DEFINE_TYPE (GtkApplicationImplWayland, gtk_application_impl_wayland, GTK_TYPE_APPLICATION_IMPL_DBUS)
static void
-gtk_application_impl_wayland_handle_window_map (GtkApplicationImpl *impl,
- GtkWindow *window)
+gtk_application_impl_wayland_handle_window_realize (GtkApplicationImpl *impl,
+ GtkWindow *window)
{
+ GtkApplicationImplClass *impl_class =
+ GTK_APPLICATION_IMPL_CLASS (gtk_application_impl_wayland_parent_class);
GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) impl;
GdkWindow *gdk_window;
gchar *window_path;
@@ -54,6 +56,8 @@ gtk_application_impl_wayland_handle_window_map (GtkApplicationImpl *impl,
window_path, dbus->object_path, dbus->unique_name);
g_free (window_path);
+
+ impl_class->handle_window_realize (impl, window);
}
static void
@@ -66,5 +70,6 @@ gtk_application_impl_wayland_class_init (GtkApplicationImplWaylandClass *class)
{
GtkApplicationImplClass *impl_class = GTK_APPLICATION_IMPL_CLASS (class);
- impl_class->handle_window_map = gtk_application_impl_wayland_handle_window_map;
+ impl_class->handle_window_realize =
+ gtk_application_impl_wayland_handle_window_realize;
}