summaryrefslogtreecommitdiff
path: root/Userland/paste.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-23 09:36:25 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-23 09:36:25 +0200
commit87e768f0e3e2c6207341e1f705306b904d9f6378 (patch)
treec405c74076eb5ca55f763c7c5e4e3e59b1ab33cc /Userland/paste.cpp
parenta1907011b258edbb86a9f27e5f1ba1430e281dfd (diff)
downloadserenity-87e768f0e3e2c6207341e1f705306b904d9f6378.zip
Userland: Unbreak "copy" and "paste" after GEventLoop removal
Have these programs instantiate a GApplication to ensure they get a connection to the WindowServer, otherwise the clipboard will not work. Sorry Sergey! :^)
Diffstat (limited to 'Userland/paste.cpp')
-rw-r--r--Userland/paste.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Userland/paste.cpp b/Userland/paste.cpp
index 947463dd37..78c91e4ced 100644
--- a/Userland/paste.cpp
+++ b/Userland/paste.cpp
@@ -1,5 +1,5 @@
#include <AK/String.h>
-#include <LibCore/CEventLoop.h>
+#include <LibGUI/GApplication.h>
#include <LibGUI/GClipboard.h>
#include <getopt.h>
#include <stdio.h>
@@ -62,9 +62,9 @@ Options parse_options(int argc, char* argv[])
int main(int argc, char* argv[])
{
- Options options = parse_options(argc, argv);
+ GApplication app(argc, argv);
- CEventLoop loop;
+ Options options = parse_options(argc, argv);
GClipboard& clipboard = GClipboard::the();
auto data_and_type = clipboard.data_and_type();
@@ -78,4 +78,6 @@ int main(int argc, char* argv[])
} else {
printf("%s\n", data_and_type.type.characters());
}
+
+ return 0;
}