|
|
a9add1 |
From 7b422cce4ebc291d5eff723dc0fd4497ab412ed5 Mon Sep 17 00:00:00 2001
|
|
|
a9add1 |
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
|
a9add1 |
Date: Fri, 4 Dec 2015 14:11:24 +0000
|
|
|
a9add1 |
Subject: [PATCH 1/3] gtk3: avoid empty target clipboard warning
|
|
|
a9add1 |
|
|
|
a9add1 |
Change-Id: Ic6b46eb2c81398f0ab2e7539e5cdb27a508c8893
|
|
|
a9add1 |
(cherry picked from commit 66fedc0966ad0c732cada974ea910d7a98beca15)
|
|
|
a9add1 |
---
|
|
|
a9add1 |
vcl/unx/gtk3/gtk3gtkinst.cxx | 17 ++++++++++-------
|
|
|
a9add1 |
1 file changed, 10 insertions(+), 7 deletions(-)
|
|
|
a9add1 |
|
|
|
a9add1 |
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
|
|
|
a9add1 |
index 9f15db0..e9210d0 100644
|
|
|
a9add1 |
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
|
|
|
a9add1 |
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
|
|
|
a9add1 |
@@ -572,13 +572,16 @@ void VclGtkClipboard::setContents(
|
|
|
a9add1 |
aGtkTargets.push_back(makeGtkTargetEntry(aFlavor));
|
|
|
a9add1 |
}
|
|
|
a9add1 |
|
|
|
a9add1 |
- //if there was a previous gtk_clipboard_set_with_data call then
|
|
|
a9add1 |
- //ClipboardClearFunc will be called now
|
|
|
a9add1 |
- GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection);
|
|
|
a9add1 |
- //use with_owner with m_pOwner so we can distinguish in handle_owner_change
|
|
|
a9add1 |
- //if we have gained or lost ownership of the clipboard
|
|
|
a9add1 |
- gtk_clipboard_set_with_owner(clipboard, aGtkTargets.data(), aGtkTargets.size(),
|
|
|
a9add1 |
- ClipboardGetFunc, ClipboardClearFunc, G_OBJECT(m_pOwner));
|
|
|
a9add1 |
+ if (!aGtkTargets.empty())
|
|
|
a9add1 |
+ {
|
|
|
a9add1 |
+ //if there was a previous gtk_clipboard_set_with_data call then
|
|
|
a9add1 |
+ //ClipboardClearFunc will be called now
|
|
|
a9add1 |
+ GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection);
|
|
|
a9add1 |
+ //use with_owner with m_pOwner so we can distinguish in handle_owner_change
|
|
|
a9add1 |
+ //if we have gained or lost ownership of the clipboard
|
|
|
a9add1 |
+ gtk_clipboard_set_with_owner(clipboard, aGtkTargets.data(), aGtkTargets.size(),
|
|
|
a9add1 |
+ ClipboardGetFunc, ClipboardClearFunc, G_OBJECT(m_pOwner));
|
|
|
a9add1 |
+ }
|
|
|
a9add1 |
m_aGtkTargets = aGtkTargets;
|
|
|
a9add1 |
}
|
|
|
a9add1 |
|
|
|
a9add1 |
--
|
|
|
a9add1 |
2.5.0
|
|
|
a9add1 |
|