summaryrefslogtreecommitdiff
path: root/unity-shared
diff options
authorAndrea Azzarone <azzaronea@gmail.com>2014-06-07 16:26:51 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-06-07 16:26:51 +0000
commit231eddcc47df3ad527081598a80dce74da9a36a4 (patch)
tree39563dd36736239226a8c32d39dfa9872fda6cbb /unity-shared
parent3dc6cc4969d58ff9d55d3b26a4a3b5085d0c2e9e (diff)
parent9cdecfdfa063a4cbb52b9f34a037a7425ebbccd0 (diff)
Clear the clipboard when locking the screen. Fixes: 1308911
(bzr r3817)
Diffstat (limited to 'unity-shared')
-rw-r--r--unity-shared/IMTextEntry.cpp7
-rw-r--r--unity-shared/IMTextEntry.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/unity-shared/IMTextEntry.cpp b/unity-shared/IMTextEntry.cpp
index 0e4e383f3..c90701f46 100644
--- a/unity-shared/IMTextEntry.cpp
+++ b/unity-shared/IMTextEntry.cpp
@@ -27,10 +27,14 @@ NUX_IMPLEMENT_OBJECT_TYPE(IMTextEntry);
IMTextEntry::IMTextEntry()
: TextEntry("", NUX_TRACKER_LOCATION)
+ , clipboard_enabled(true)
{}
void IMTextEntry::CopyClipboard()
{
+ if (!clipboard_enabled())
+ return;
+
int start, end;
if (GetSelectionBounds(&start, &end))
@@ -52,6 +56,9 @@ void IMTextEntry::PastePrimaryClipboard()
void IMTextEntry::Paste(bool primary)
{
+ if (!clipboard_enabled())
+ return;
+
GdkAtom origin = primary ? GDK_SELECTION_PRIMARY : GDK_SELECTION_CLIPBOARD;
GtkClipboard* clip = gtk_clipboard_get(origin);
diff --git a/unity-shared/IMTextEntry.h b/unity-shared/IMTextEntry.h
index 194077e90..f3fb15f21 100644
--- a/unity-shared/IMTextEntry.h
+++ b/unity-shared/IMTextEntry.h
@@ -33,6 +33,8 @@ class IMTextEntry : public nux::TextEntry
public:
IMTextEntry();
+ nux::Property<bool> clipboard_enabled;
+
bool im_preedit();
protected: