[gtk+] wayland: Survive without primary selection
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] wayland: Survive without primary selection
- Date: Sat, 27 Feb 2016 00:48:17 +0000 (UTC)
commit 914f7bd6e48a09025ae35927813fdee863a53881
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Feb 26 19:41:25 2016 -0500
wayland: Survive without primary selection
I am testing GTK+ master against mutter 3.19.90, so I'd
like GTK+ to survive even when the compositor does not
support the primary selection interface.
gdk/wayland/gdkdevice-wayland.c | 13 ++++++++-----
gdk/wayland/gdkselection-wayland.c | 11 +++++++----
2 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index e093bc0..9b085ad 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -2920,11 +2920,14 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
wl_seat_add_listener (seat->wl_seat, &seat_listener, seat);
wl_seat_set_user_data (seat->wl_seat, seat);
- seat->primary_data_device =
- gtk_primary_selection_device_manager_get_device (display_wayland->primary_selection_manager,
- seat->wl_seat);
- gtk_primary_selection_device_add_listener (seat->primary_data_device,
- &primary_selection_device_listener, seat);
+ if (display_wayland->primary_selection_manager)
+ {
+ seat->primary_data_device =
+ gtk_primary_selection_device_manager_get_device (display_wayland->primary_selection_manager,
+ seat->wl_seat);
+ gtk_primary_selection_device_add_listener (seat->primary_data_device,
+ &primary_selection_device_listener, seat);
+ }
seat->data_device =
wl_data_device_manager_get_data_device (display_wayland->data_device_manager,
diff --git a/gdk/wayland/gdkselection-wayland.c b/gdk/wayland/gdkselection-wayland.c
index 9fcb313..eff802e 100644
--- a/gdk/wayland/gdkselection-wayland.c
+++ b/gdk/wayland/gdkselection-wayland.c
@@ -1089,10 +1089,13 @@ gdk_wayland_selection_get_data_source (GdkWindow *owner,
if (selection == atoms[ATOM_PRIMARY])
{
- source = gtk_primary_selection_device_manager_create_source
(display_wayland->primary_selection_manager);
- gtk_primary_selection_source_add_listener (source,
- &primary_source_listener,
- wayland_selection);
+ if (display_wayland->primary_selection_manager)
+ {
+ source = gtk_primary_selection_device_manager_create_source
(display_wayland->primary_selection_manager);
+ gtk_primary_selection_source_add_listener (source,
+ &primary_source_listener,
+ wayland_selection);
+ }
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]