Commit e151058d authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Make gdk logging per-display

As far as possible, use per-display debug flags.

This will minimize the debug spew that we get from
the inspector if it is running on a separate display.
parent c5fc8412
......@@ -22,10 +22,6 @@ void gdk_window_thaw_toplevel_updates (GdkWindow *window);
gboolean gdk_window_supports_edge_constraints (GdkWindow *window);
GdkDebugFlags gdk_display_get_debug_flags (GdkDisplay *display);
void gdk_display_set_debug_flags (GdkDisplay *display,
GdkDebugFlags flags);
void gdk_window_move_to_rect (GdkWindow *window,
const GdkRectangle *rect,
GdkGravity rect_anchor,
......
......@@ -1505,7 +1505,7 @@ gdk_display_make_gl_context_current (GdkDisplay *display,
GdkDebugFlags
gdk_display_get_debug_flags (GdkDisplay *display)
{
return display->debug_flags;
return display ? display->debug_flags : _gdk_debug_flags;
}
void
......
......@@ -455,6 +455,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
cairo_region_t *region)
{
GdkGLContext *paint_context;
GdkDisplay *display;
cairo_surface_t *image;
double device_x_offset, device_y_offset;
cairo_rectangle_int_t rect, e;
......@@ -469,8 +470,13 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
guint target;
paint_context = gdk_gl_context_get_current ();
if (GDK_DEBUG_CHECK (GL_SOFTWARE) == 0 &&
paint_context &&
if (paint_context)
display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (paint_context));
else
display = NULL;
if (paint_context &&
GDK_DISPLAY_DEBUG_CHECK (display, GL_SOFTWARE) == 0 &&
GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface &&
GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface (paint_context, surface, region))
return;
......
......@@ -555,6 +555,7 @@ gdk_gl_context_set_required_version (GdkGLContext *context,
int minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
GdkDisplay *display;
int version, min_ver;
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
......@@ -571,7 +572,9 @@ gdk_gl_context_set_required_version (GdkGLContext *context,
/* Enforce a minimum context version number of 3.2 */
version = (major * 100) + minor;
if (priv->use_es > 0 || GDK_DEBUG_CHECK (GL_GLES))
display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
if (priv->use_es > 0 || GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES))
min_ver = 200;
else
min_ver = 302;
......@@ -602,12 +605,15 @@ gdk_gl_context_get_required_version (GdkGLContext *context,
int *minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
GdkDisplay *display;
int default_major, default_minor;
int maj, min;
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
if (priv->use_es > 0 || GDK_DEBUG_CHECK (GL_GLES))
display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
if (priv->use_es > 0 || GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES))
{
default_major = 2;
default_minor = 0;
......@@ -769,6 +775,7 @@ static void
gdk_gl_context_check_extensions (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
GdkDisplay *display;
gboolean has_npot, has_texture_rectangle;
if (!priv->realized)
......@@ -812,7 +819,9 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
priv->is_legacy = TRUE;
}
if (!priv->use_es && GDK_DEBUG_CHECK (GL_TEXTURE_RECT))
display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
if (!priv->use_es && GDK_DISPLAY_DEBUG_CHECK (display, GL_TEXTURE_RECT))
priv->use_texture_rectangle = TRUE;
else if (has_npot)
priv->use_texture_rectangle = FALSE;
......@@ -821,8 +830,8 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
else
g_warning ("GL implementation doesn't support any form of non-power-of-two textures");
GDK_NOTE (OPENGL,
g_message ("%s version: %d.%d (%s)\n"
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("%s version: %d.%d (%s)\n"
"* GLSL version: %s\n"
"* Extensions checked:\n"
" - GL_ARB_texture_non_power_of_two: %s\n"
......
......@@ -87,25 +87,28 @@ extern GdkWindow *_gdk_parent_root;
extern guint _gdk_debug_flags;
GdkDebugFlags gdk_display_get_debug_flags (GdkDisplay *display);
void gdk_display_set_debug_flags (GdkDisplay *display,
GdkDebugFlags flags);
#ifdef G_ENABLE_DEBUG
#define GDK_DEBUG_CHECK(type) G_UNLIKELY (_gdk_debug_flags & GDK_DEBUG_##type)
#define GDK_NOTE(type,action) G_STMT_START { \
if (GDK_DEBUG_CHECK (type)) \
{ action; }; } G_STMT_END
#define GDK_DISPLAY_DEBUG_CHECK(display,type) G_UNLIKELY(gdk_display_get_debug_flags (display) & GDK_DEBUG_##type)
#define GDK_DISPLAY_DEBUG_CHECK(display,type) \
G_UNLIKELY (gdk_display_get_debug_flags (display) & GDK_DEBUG_##type)
#define GDK_DISPLAY_NOTE(display,type,action) G_STMT_START { \
if (GDK_DISPLAY_DEBUG_CHECK (display,type)) \
{ action; }; } G_STMT_END
#else /* !G_ENABLE_DEBUG */
#define GDK_DEBUG_CHECK(type) 0
#define GDK_NOTE(type,action)
#define GDK_DISPLAY_DEBUG_CHECK(display,type) 0
#define GDK_DISPLAY_NOTE(display,type,action)
#endif /* G_ENABLE_DEBUG */
#define GDK_DEBUG_CHECK(type) GDK_DISPLAY_DEBUG_CHECK (NULL,type)
#define GDK_NOTE(type,action) GDK_DISPLAY_NOTE (NULL,type,action)
/* Event handling */
typedef struct _GdkEventPrivate GdkEventPrivate;
......
......@@ -245,7 +245,8 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
}
else
{
GDK_NOTE (VULKAN, g_warning ("Vulkan swapchain doesn't do transparency. Using opaque swapchain instead."));
GDK_DISPLAY_NOTE (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)),
VULKAN, g_warning ("Vulkan swapchain doesn't do transparency. Using opaque swapchain instead."));
composite_alpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
}
......@@ -762,7 +763,7 @@ gdk_display_create_vulkan_device (GdkDisplay *display,
}
}
if (list_devices || GDK_DEBUG_CHECK (VULKAN))
if (list_devices || GDK_DISPLAY_DEBUG_CHECK (display, VULKAN))
{
for (i = 0; i < n_devices; i++)
{
......@@ -824,7 +825,7 @@ gdk_display_create_vulkan_device (GdkDisplay *display,
{
if (queue_props[j].queueFlags & VK_QUEUE_GRAPHICS_BIT)
{
GDK_NOTE (VULKAN, g_print ("Using Vulkan device %u, queue %u\n", i, j));
GDK_DISPLAY_NOTE (display, VULKAN, g_print ("Using Vulkan device %u, queue %u\n", i, j));
if (GDK_VK_CHECK (vkCreateDevice, devices[i],
&(VkDeviceCreateInfo) {
VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
......@@ -913,11 +914,12 @@ gdk_display_create_vulkan_instance (GdkDisplay *display,
for (i = 0; i < n_extensions; i++)
{
GDK_NOTE (VULKAN, g_print ("Extension available: %s v%u.%u.%u\n",
if (GDK_DISPLAY_DEBUG_CHECK (display, VULKAN))
g_print ("Extension available: %s v%u.%u.%u\n",
extensions[i].extensionName,
VK_VERSION_MAJOR (extensions[i].specVersion),
VK_VERSION_MINOR (extensions[i].specVersion),
VK_VERSION_PATCH (extensions[i].specVersion)));
VK_VERSION_PATCH (extensions[i].specVersion));
if (g_str_equal (extensions[i].extensionName, VK_EXT_DEBUG_REPORT_EXTENSION_NAME))
{
......@@ -935,13 +937,14 @@ gdk_display_create_vulkan_instance (GdkDisplay *display,
for (i = 0; i < n_layers; i++)
{
GDK_NOTE (VULKAN, g_print ("Layer available: %s v%u.%u.%u (%s)\n",
if (GDK_DISPLAY_DEBUG_CHECK (display, VULKAN))
g_print ("Layer available: %s v%u.%u.%u (%s)\n",
layers[i].layerName,
VK_VERSION_MAJOR (layers[i].specVersion),
VK_VERSION_MINOR (layers[i].specVersion),
VK_VERSION_PATCH (layers[i].specVersion),
layers[i].description));
if (GDK_DEBUG_CHECK (VULKAN_VALIDATE) &&
layers[i].description);
if (GDK_DISPLAY_DEBUG_CHECK (display, VULKAN_VALIDATE) &&
g_str_equal (layers[i].layerName, "VK_LAYER_LUNARG_standard_validation"))
{
g_ptr_array_add (used_layers, (gpointer) "VK_LAYER_LUNARG_standard_validation");
......@@ -949,7 +952,7 @@ gdk_display_create_vulkan_instance (GdkDisplay *display,
}
}
if (GDK_DEBUG_CHECK (VULKAN_VALIDATE) && !validate)
if (GDK_DISPLAY_DEBUG_CHECK (display, VULKAN_VALIDATE) && !validate)
{
g_warning ("Vulkan validation layers were requested, but not found. Running without.");
}
......
......@@ -60,9 +60,7 @@ gdk_vulkan_handle_result (VkResult res,
const char *called_function)
{
if (res != VK_SUCCESS)
{
GDK_NOTE (VULKAN,g_printerr ("%s(): %s (%d)\n", called_function, gdk_vulkan_strerror (res), res));
}
GDK_NOTE (VULKAN, g_printerr ("%s(): %s (%d)\n", called_function, gdk_vulkan_strerror (res), res));
return res;
}
......@@ -78,7 +76,7 @@ static inline gboolean
gdk_display_ref_vulkan (GdkDisplay *display,
GError **error)
{
GDK_NOTE (VULKAN, g_print ("Support for Vulkan disabled at compile-time"));
GDK_NOTE (display, VULKAN, g_print ("Support for Vulkan disabled at compile-time"));
g_set_error_literal (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_UNSUPPORTED,
"Vulkan support was not enabled at compile time.");
......
......@@ -998,7 +998,7 @@ gdk_window_new (GdkDisplay *display,
g_signal_connect (display, "seat-removed", G_CALLBACK (seat_removed_cb), window);
if (GDK_DEBUG_CHECK (GL_ALWAYS))
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_ALWAYS))
{
GError *error = NULL;
......@@ -1871,7 +1871,7 @@ gdk_window_get_paint_gl_context (GdkWindow *window,
{
GError *internal_error = NULL;
if (GDK_DEBUG_CHECK (GL_DISABLE))
if (GDK_DISPLAY_DEBUG_CHECK (window->display, GL_DISABLE))
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
......@@ -1976,7 +1976,7 @@ gdk_window_create_vulkan_context (GdkWindow *window,
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
if (GDK_DEBUG_CHECK (VULKAN_DISABLE))
if (GDK_DISPLAY_DEBUG_CHECK (window->display, VULKAN_DISABLE))
{
g_set_error_literal (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
_("Vulkan support disabled via GDK_DEBUG"));
......@@ -5781,13 +5781,13 @@ gdk_window_create_similar_surface (GdkWindow * window,
sx = sy = 1;
cairo_surface_get_device_scale (window_surface, &sx, &sy);
if (GDK_DEBUG_CHECK (CAIRO_RECORDING))
if (GDK_DISPLAY_DEBUG_CHECK (window->display, CAIRO_RECORDING))
{
cairo_rectangle_t rect = { 0, 0, width * sx, height *sy };
surface = cairo_recording_surface_create (content, &rect);
cairo_surface_set_device_scale (surface, sx, sy);
}
else if (GDK_DEBUG_CHECK (CAIRO_IMAGE))
else if (GDK_DISPLAY_DEBUG_CHECK (window->display, CAIRO_IMAGE))
{
surface = cairo_image_surface_create (content == CAIRO_CONTENT_COLOR ? CAIRO_FORMAT_RGB24 :
content == CAIRO_CONTENT_ALPHA ? CAIRO_FORMAT_A8 : CAIRO_FORMAT_ARGB32,
......
......@@ -77,7 +77,7 @@ gdk_wayland_clipboard_data_source_target (void *data,
struct wl_data_source *source,
const char *mime_type)
{
GDK_NOTE (CLIPBOARD, g_printerr ("%p: Huh? data_source.target() events?\n", data));
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_printerr ("%p: Huh? data_source.target() events?\n", data));
}
static void
......@@ -89,7 +89,7 @@ gdk_wayland_clipboard_write_done (GObject *clipboard,
if (!gdk_clipboard_write_finish (GDK_CLIPBOARD (clipboard), result, &error))
{
GDK_NOTE(CLIPBOARD, g_printerr ("%p: failed to write stream: %s\n", clipboard, error->message));
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (clipboard)), CLIPBOARD, g_printerr ("%p: failed to write stream: %s\n", clipboard, error->message));
g_error_free (error);
}
}
......@@ -103,7 +103,7 @@ gdk_wayland_clipboard_data_source_send (void *data,
GdkWaylandClipboard *cb = GDK_WAYLAND_CLIPBOARD (data);
GOutputStream *stream;
GDK_NOTE (CLIPBOARD, g_printerr ("%p: data source send request for %s on fd %d\n",
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_printerr ("%p: data source send request for %s on fd %d\n",
source, mime_type, fd));
mime_type = gdk_intern_mime_type (mime_type);
......@@ -125,7 +125,7 @@ gdk_wayland_clipboard_data_source_cancelled (void *data,
{
GdkWaylandClipboard *cb = GDK_WAYLAND_CLIPBOARD (data);
GDK_NOTE (CLIPBOARD, g_printerr ("%p: data source cancelled\n", data));
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_printerr ("%p: data source cancelled\n", data));
if (cb->source == source)
{
......@@ -138,14 +138,16 @@ static void
gdk_wayland_clipboard_data_source_dnd_drop_performed (void *data,
struct wl_data_source *source)
{
GDK_NOTE (CLIPBOARD, g_printerr ("%p: Huh? data_source.dnd_drop_performed() events?\n", data));
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)),
CLIPBOARD, g_printerr ("%p: Huh? data_source.dnd_drop_performed() events?\n", data));
}
static void
gdk_wayland_clipboard_data_source_dnd_finished (void *data,
struct wl_data_source *source)
{
GDK_NOTE (CLIPBOARD, g_printerr ("%p: Huh? data_source.dnd_finished() events?\n", data));
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)),
CLIPBOARD, g_printerr ("%p: Huh? data_source.dnd_finished() events?\n", data));
}
static void
......@@ -153,7 +155,8 @@ gdk_wayland_clipboard_data_source_action (void *data,
struct wl_data_source *source,
uint32_t action)
{
GDK_NOTE (CLIPBOARD, g_printerr ("%p: Huh? data_source.action() events?\n", data));
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)),
CLIPBOARD, g_printerr ("%p: Huh? data_source.action() events?\n", data));
}
static const struct wl_data_source_listener data_source_listener = {
......@@ -218,7 +221,7 @@ gdk_wayland_clipboard_read_async (GdkClipboard *clipboard,
g_task_set_priority (task, io_priority);
g_task_set_source_tag (task, gdk_wayland_clipboard_read_async);
GDK_NOTE (CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
g_printerr ("%p: read for %s\n", cb, s);
g_free (s); );
mime_type = gdk_content_formats_match_mime_type (formats, cb->offer_formats);
......@@ -302,14 +305,14 @@ gdk_wayland_clipboard_claim_remote (GdkWaylandClipboard *cb,
if (cb->source)
{
GDK_NOTE (CLIPBOARD, g_printerr ("%p: Ignoring clipboard offer for self\n", cb));
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, g_printerr ("%p: Ignoring clipboard offer for self\n", cb));
gdk_content_formats_unref (formats);
return;
}
gdk_wayland_clipboard_discard_offer (cb);
GDK_NOTE (CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
g_printerr ("%p: remote clipboard claim for %s\n", cb, s);
g_free (s); );
cb->offer_formats = formats;
......
This diff is collapsed.
......@@ -133,7 +133,7 @@ xdg_shell_ping (void *data,
_gdk_wayland_display_update_serial (display_wayland, serial);
GDK_NOTE (EVENTS,
GDK_DISPLAY_NOTE (GDK_DISPLAY (data), EVENTS,
g_message ("ping, shell %p, serial %u\n", xdg_shell, serial));
zxdg_shell_v6_pong (xdg_shell, serial);
......
......@@ -335,7 +335,7 @@ gdk_wayland_drag_context_read_async (GdkDragContext *context,
g_task_set_priority (task, io_priority);
g_task_set_source_tag (task, gdk_wayland_drag_context_read_async);
GDK_NOTE (DND, char *s = gdk_content_formats_to_string (formats);
GDK_DISPLAY_NOTE (display, DND, char *s = gdk_content_formats_to_string (formats);
g_printerr ("%p: read for %s\n", context, s);
g_free (s); );
dnd_formats = gdk_wayland_selection_get_targets (display);
......
......@@ -56,9 +56,9 @@ gdk_wayland_gl_context_realize (GdkGLContext *context,
gdk_gl_context_get_required_version (context, &major, &minor);
debug_bit = gdk_gl_context_get_debug_enabled (context);
forward_bit = gdk_gl_context_get_forward_compatible (context);
legacy_bit = GDK_DEBUG_CHECK (GL_LEGACY) ||
legacy_bit = GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY) ||
(share != NULL && gdk_gl_context_is_legacy (share));
use_es = GDK_DEBUG_CHECK (GL_GLES) ||
use_es = GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES) ||
(share != NULL && gdk_gl_context_get_use_es (share));
flags = 0;
......@@ -102,7 +102,8 @@ gdk_wayland_gl_context_realize (GdkGLContext *context,
context_attribs[i++] = EGL_NONE;
g_assert (i < N_EGL_ATTRS);
GDK_NOTE (OPENGL, g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
major, minor,
debug_bit ? "yes" : "no",
forward_bit ? "yes" : "no",
......@@ -129,7 +130,8 @@ gdk_wayland_gl_context_realize (GdkGLContext *context,
legacy_bit = TRUE;
use_es = FALSE;
GDK_NOTE (OPENGL, g_message ("eglCreateContext failed, switching to legacy"));
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("eglCreateContext failed, switching to legacy"));
ctx = eglCreateContext (display_wayland->egl_display,
context_wayland->egl_config,
share != NULL ? GDK_WAYLAND_GL_CONTEXT (share)->egl_context
......@@ -145,7 +147,7 @@ gdk_wayland_gl_context_realize (GdkGLContext *context,
return FALSE;
}
GDK_NOTE (OPENGL, g_message ("Created EGL context[%p]", ctx));
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Created EGL context[%p]", ctx));
context_wayland->egl_context = ctx;
......@@ -338,7 +340,7 @@ gdk_wayland_display_init_gl (GdkDisplay *display)
display_wayland->have_egl_surfaceless_context =
epoxy_has_egl_extension (dpy, "EGL_KHR_surfaceless_context");
GDK_NOTE (OPENGL,
GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("EGL API version %d.%d found\n"
" - Vendor: %s\n"
" - Version: %s\n"
......@@ -472,7 +474,7 @@ gdk_wayland_gl_context_dispose (GObject *gobject)
eglMakeCurrent(display_wayland->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
GDK_NOTE (OPENGL, g_message ("Destroying EGL context"));
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Destroying EGL context"));
eglDestroyContext (display_wayland->egl_display,
context_wayland->egl_context);
......
......@@ -625,7 +625,7 @@ _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
return;
}
GDK_NOTE(INPUT, g_print ("keymap:\n%s\n", map_str));
GDK_DISPLAY_NOTE (keymap->display, INPUT, g_print ("keymap:\n%s\n", map_str));
xkb_keymap = xkb_keymap_new_from_string (context, map_str, format, 0);
munmap (map_str, size);
......@@ -638,7 +638,7 @@ _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
return;
}
GDK_NOTE(INPUT, print_modifiers (xkb_keymap));
GDK_DISPLAY_NOTE (keymap->display, INPUT, print_modifiers (xkb_keymap));
xkb_keymap_unref (keymap_wayland->xkb_keymap);
keymap_wayland->xkb_keymap = xkb_keymap;
......
......@@ -99,14 +99,14 @@ gdk_wayland_primary_claim_remote (GdkWaylandPrimary *cb,
if (cb->source)
{
GDK_NOTE (CLIPBOARD, g_printerr ("%p: Ignoring clipboard offer for self\n", cb));
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, g_printerr ("%p: Ignoring clipboard offer for self\n", cb));
gdk_content_formats_unref (formats);
return;
}
gdk_wayland_primary_discard_offer (cb);
GDK_NOTE (CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
g_printerr ("%p: remote clipboard claim for %s\n", cb, s);
g_free (s); );
cb->offer_formats = formats;
......@@ -125,7 +125,7 @@ primary_offer_offer (void *data,
if (cb->pending != offer)
{
GDK_NOTE (SELECTION, g_printerr ("%p: offer for unknown selection %p of %s\n",
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), SELECTION, g_printerr ("%p: offer for unknown selection %p of %s\n",
cb, offer, type));
return;
}
......@@ -144,7 +144,7 @@ primary_selection_data_offer (void *data,
{
GdkWaylandPrimary *cb = data;
GDK_NOTE (SELECTION, g_printerr ("%p: new primary offer %p\n",
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), SELECTION, g_printerr ("%p: new primary offer %p\n",
cb, offer));
gdk_wayland_primary_discard_pending (cb);
......@@ -173,7 +173,7 @@ primary_selection_selection (void *data,
if (cb->pending != offer)
{
GDK_NOTE (SELECTION, g_printerr ("%p: ignoring unknown data offer %p\n",
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), SELECTION, g_printerr ("%p: ignoring unknown data offer %p\n",
cb, offer));
return;
}
......@@ -199,7 +199,7 @@ gdk_wayland_primary_write_done (GObject *clipboard,
if (!gdk_clipboard_write_finish (GDK_CLIPBOARD (clipboard), result, &error))
{
GDK_NOTE (SELECTION, g_printerr ("%p: failed to write stream: %s\n", clipboard, error->message));
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (clipboard)), SELECTION, g_printerr ("%p: failed to write stream: %s\n", clipboard, error->message));
g_error_free (error);
}
}
......@@ -213,7 +213,7 @@ gdk_wayland_primary_data_source_send (void *data,
GdkWaylandPrimary *cb = GDK_WAYLAND_PRIMARY (data);
GOutputStream *stream;
GDK_NOTE (SELECTION, g_printerr ("%p: data source send request for %s on fd %d\n",
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), SELECTION, g_printerr ("%p: data source send request for %s on fd %d\n",
source, mime_type, fd));
mime_type = gdk_intern_mime_type (mime_type);
......@@ -235,7 +235,7 @@ gdk_wayland_primary_data_source_cancelled (void *
{
GdkWaylandPrimary *cb = GDK_WAYLAND_PRIMARY (data);
GDK_NOTE (CLIPBOARD, g_printerr ("%p: data source cancelled\n", data));
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_printerr ("%p: data source cancelled\n", data));
if (cb->source == source)
{
......@@ -302,7 +302,7 @@ gdk_wayland_primary_read_async (GdkClipboard *clipboard,
g_task_set_priority (task, io_priority);
g_task_set_source_tag (task, gdk_wayland_primary_read_async);
GDK_NOTE (CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
GDK_DISPLAY_NOTE (gdk_clipboard_get_display (clipboard), CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
g_printerr ("%p: read for %s\n", cb, s);
g_free (s); );
mime_type = gdk_content_formats_match_mime_type (formats, cb->offer_formats);
......
......@@ -159,7 +159,7 @@ data_offer_source_actions (void *data,
drop_context->actions = _wl_to_gdk_actions (source_actions);
GDK_NOTE (EVENTS,
GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("data offer source actions, offer %p, actions %d", wl_data_offer, source_actions));
if (gdk_drag_context_get_dest_window (drop_context))
......@@ -311,7 +311,7 @@ gdk_wayland_drag_context_write_done (GObject *context,
if (!gdk_drag_context_write_finish (GDK_DRAG_CONTEXT (context), result, &error))
{
GDK_NOTE(DND, g_printerr ("%p: failed to write stream: %s\n", context, error->message));
GDK_DISPLAY_NOTE (gdk_drag_context_get_display (GDK_DRAG_CONTEXT (context)), DND, g_printerr ("%p: failed to write stream: %s\n", context, error->message));
g_error_free (error);
}
}
......@@ -329,7 +329,7 @@ data_source_send (void *data,
if (!context)
return;
GDK_NOTE (DND, g_printerr ("%p: data source send request for %s on fd %d\n",
GDK_DISPLAY_NOTE (gdk_drag_context_get_display (context), DND, g_printerr ("%p: data source send request for %s on fd %d\n",
source, mime_type, fd));
//mime_type = gdk_intern_mime_type (mime_type);
......@@ -354,11 +354,11 @@ data_source_cancelled (void *data,
GdkDragContext *context;
GdkDisplay *display;
GDK_NOTE (EVENTS,
g_message ("data source cancelled, source = %p", source));
display = gdk_display_get_default ();
GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("data source cancelled, source = %p", source));
if (source != wayland_selection->dnd_source)
return;
......@@ -405,15 +405,14 @@ data_source_action (void *data,
{
GdkDragContext *context;
GDK_NOTE (EVENTS,
g_message ("data source action, source = %p action=%x",
source, action));
context = gdk_wayland_drag_context_lookup_by_data_source (source);
if (!context)
return;
GDK_DISPLAY_NOTE (gdk_drag_context_get_display (context), EVENTS,
g_message ("data source action, source = %p action=%x",
source, action));
context->action = _wl_to_gdk_actions (action);
g_signal_emit_by_name (context, "action-changed", context->action);
}
......
......@@ -444,8 +444,7 @@ frame_callback (void *data,