summaryrefslogtreecommitdiff
path: root/Servers/WindowServer/WSEventLoop.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-14 09:19:05 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-14 09:19:05 +0200
commitc543ee5c5bcfbb7dd31ab70f3a64e91933485275 (patch)
tree9dd18415b69620cf290ace0f647c4c2fa4cbf8f4 /Servers/WindowServer/WSEventLoop.cpp
parent9d2c4d223a9eb0c9cbe488f7f36e42c8d84b1578 (diff)
downloadserenity-c543ee5c5bcfbb7dd31ab70f3a64e91933485275.zip
WindowServer+LibGUI: Store a "data type" with the clipboard content
This will allow us to distinguish between different types of data stored on the clipboard.
Diffstat (limited to 'Servers/WindowServer/WSEventLoop.cpp')
-rw-r--r--Servers/WindowServer/WSEventLoop.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Servers/WindowServer/WSEventLoop.cpp b/Servers/WindowServer/WSEventLoop.cpp
index 94e6de2109..df6a2e1a73 100644
--- a/Servers/WindowServer/WSEventLoop.cpp
+++ b/Servers/WindowServer/WSEventLoop.cpp
@@ -1,3 +1,4 @@
+#include "WSClipboard.h"
#include <Kernel/KeyCode.h>
#include <Kernel/MousePacket.h>
#include <LibCore/CLocalSocket.h>
@@ -47,6 +48,12 @@ WSEventLoop::WSEventLoop()
m_mouse_notifier = make<CNotifier>(m_mouse_fd, CNotifier::Read);
m_mouse_notifier->on_ready_to_read = [this] { drain_mouse(); };
+
+ WSClipboard::the().on_content_change = [&] {
+ WSClientConnection::for_each_client([&](auto& client) {
+ client.notify_about_clipboard_contents_changed();
+ });
+ };
}
WSEventLoop::~WSEventLoop()