diff options
Diffstat (limited to 'tools/gtk_clipboard_dump')
-rw-r--r-- | tools/gtk_clipboard_dump/gtk_clipboard_dump.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/gtk_clipboard_dump/gtk_clipboard_dump.cc b/tools/gtk_clipboard_dump/gtk_clipboard_dump.cc index a064792..c96ee00 100644 --- a/tools/gtk_clipboard_dump/gtk_clipboard_dump.cc +++ b/tools/gtk_clipboard_dump/gtk_clipboard_dump.cc @@ -19,6 +19,11 @@ void PrintClipboardContents(GtkClipboard* clip) { GtkSelectionData* target_data = gtk_clipboard_wait_for_contents(clip, gdk_atom_intern("TARGETS", false)); + if (!target_data) { + printf("failed to get the contents!\n"); + return; + } + gtk_selection_data_get_targets(target_data, &targets, &num_targets); printf("%d available targets:\n---------------\n", num_targets); |