summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-04-15 15:00:53 +0200
committerMatthias Clasen <mclasen@redhat.com>2023-04-21 09:20:53 +0200
commit56503cd6230007671d99cc64c2ca809b82ee84db (patch)
tree133e02c7e1d1af98f2b94cf40346c74b93968e53
parent47070e56630f34a81f6c38a54afa129a492070c1 (diff)
downloadgtk+-56503cd6230007671d99cc64c2ca809b82ee84db.tar.gz
wayland: Improve logging for primary selection
-rw-r--r--gdk/wayland/gdkprimary-wayland.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gdk/wayland/gdkprimary-wayland.c b/gdk/wayland/gdkprimary-wayland.c
index b501deb66b..9a9640d852 100644
--- a/gdk/wayland/gdkprimary-wayland.c
+++ b/gdk/wayland/gdkprimary-wayland.c
@@ -99,7 +99,7 @@ gdk_wayland_primary_claim_remote (GdkWaylandPrimary *cb,
if (cb->source)
{
- GDK_DISPLAY_DEBUG (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, "%p: Ignoring clipboard offer for self", cb);
+ GDK_DISPLAY_DEBUG (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, "%p: Ignoring primary offer for self", cb);
gdk_content_formats_unref (formats);
g_clear_pointer (&offer, zwp_primary_selection_offer_v1_destroy);
return;
@@ -111,7 +111,7 @@ gdk_wayland_primary_claim_remote (GdkWaylandPrimary *cb,
if (GDK_DISPLAY_DEBUG_CHECK (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD))
{
char *s = gdk_content_formats_to_string (formats);
- gdk_debug_message ("%p: remote clipboard claim for %s", cb, s);
+ gdk_debug_message ("%p: remote primary claim for %s", cb, s);
g_free (s);
}
#endif
@@ -119,8 +119,7 @@ gdk_wayland_primary_claim_remote (GdkWaylandPrimary *cb,
cb->offer_formats = formats;
cb->offer = offer;
- gdk_clipboard_claim_remote (GDK_CLIPBOARD (cb),
- cb->offer_formats);
+ gdk_clipboard_claim_remote (GDK_CLIPBOARD (cb), cb->offer_formats);
}
static void
@@ -271,6 +270,14 @@ gdk_wayland_primary_claim (GdkClipboard *clipboard,
{
GdkWaylandPrimary *cb = GDK_WAYLAND_PRIMARY (clipboard);
+#ifdef G_ENABLE_DEBUG
+ if (GDK_DISPLAY_DEBUG_CHECK (gdk_clipboard_get_display (clipboard), CLIPBOARD))
+ {
+ char *s = gdk_content_formats_to_string (formats);
+ gdk_debug_message ("%p: claim primary (%s) for %s", cb, local ? "local" : "remote", s);
+ g_free (s);
+ }
+#endif
if (local)
{
GdkWaylandDisplay *wdisplay = GDK_WAYLAND_DISPLAY (gdk_clipboard_get_display (clipboard));