From a86bb48b9f3acb081afa92e5efc50d0192c4f68c Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Thu, 30 Mar 2017 21:50:41 +0900 Subject: gtk: add support for gtk 3.14 --- gtk/toneview.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gtk/toneview.c b/gtk/toneview.c index 47c8f86..cc63af3 100644 --- a/gtk/toneview.c +++ b/gtk/toneview.c @@ -60,10 +60,17 @@ static void on_copy_clicked(GtkButton *button, gpointer ptr) { (void)button; int c = (intptr_t)ptr; if (!g.clipboard) { +#if GTK_MINOR_VERSION < 16 + GdkAtom selection = gdk_atom_intern("CLIPBOARD", TRUE); + if (selection) { + g.clipboard = gtk_clipboard_get(selection); + } +#else GdkDisplay *disp = gdk_display_get_default(); if (disp) { g.clipboard = gtk_clipboard_get_default(disp); } +#endif } if (g.clipboard) { tonedata_ch_string(g.format, g.strbuf, &g.tonedata_n.ch[c], 0); -- cgit v1.2.3