aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakamichi Horikawa <takamichiho@gmail.com>2017-03-30 21:50:41 +0900
committerTakamichi Horikawa <takamichiho@gmail.com>2017-03-30 21:50:41 +0900
commita86bb48b9f3acb081afa92e5efc50d0192c4f68c (patch)
tree439344fb0a07a33a80e0cbda14e9e5a1befe0e51
parent49dcbbb9ed087c7823bcb70cf781e00f75a8cfec (diff)
gtk: add support for gtk 3.14
-rw-r--r--gtk/toneview.c7
1 files changed, 7 insertions, 0 deletions
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);