diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-03-31 16:18:56 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-31 19:52:50 +0200 |
commit | 9378ca720d08a17ba7d73dfeb106410e4b50afd7 (patch) | |
tree | af8bcc0efaf30571e35c290deca50c6f69b2bf8c /src/core | |
parent | 1f07d2929a21e51f7a920cbe5b64fb706036c88d (diff) |
Update clipboard selection when selection changes
Update the selection when selection changes similar to what is done by
Gtk and Aura RenderWidgetHostView's.
Change-Id: I92ddd2925c6401693b001baf9ff9f5858c9c504b
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/render_widget_host_view_qt.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index a2ed37b36..f1c141fee 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -60,6 +60,7 @@ #include "third_party/WebKit/public/platform/WebColor.h" #include "third_party/WebKit/public/platform/WebCursorInfo.h" #include "third_party/WebKit/public/web/WebCompositionUnderline.h" +#include "ui/base/clipboard/scoped_clipboard_writer.h" #include "ui/events/event.h" #include "ui/gfx/size_conversions.h" #include "webkit/common/cursors/webcursor.h" @@ -644,6 +645,14 @@ void RenderWidgetHostViewQt::SelectionChanged(const string16 &text, size_t offse { content::RenderWidgetHostViewBase::SelectionChanged(text, offset, range); m_adapterClient->selectionChanged(); + +#if defined(USE_X11) && !defined(OS_CHROMEOS) + // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. + ui::ScopedClipboardWriter clipboard_writer( + ui::Clipboard::GetForCurrentThread(), + ui::CLIPBOARD_TYPE_SELECTION); + clipboard_writer.WriteText(text); +#endif } bool RenderWidgetHostViewQt::CanDispatchToConsumer(ui::GestureConsumer *consumer) |