Skip to content

Commit

Permalink
Temporarily disable X11 read
Browse files Browse the repository at this point in the history
  • Loading branch information
Slackadays committed Jan 3, 2023
1 parent dfa5e13 commit 8c7c921
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions src/clipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,27 +202,27 @@ void createTempDirectory() {
fs::create_directories(persistent_filepath);
}

void syncWithGUIClipboard() {
//check if the clipboard number is the default ("0")
//if it is, check if the system clipboard is newer than main_filepath (check the last write time), and if it is newer, write the contents of the system clipboard to main_filepath
#if defined(X11_AVAILABLE)
auto text = getX11Clipboard();
if (text.has_value()) {
forceClearTempDirectory();
std::ofstream file(main_filepath / pipe_file);
file << *text;
}
#endif
void syncWithGUIClipboard() {
if (clipboard_name == default_clipboard_name) { //also check if the system clipboard is newer than main_filepath (check the last write time), and if it is newer, write the contents of the system clipboard to main_filepath
#if defined(X11_AVAILABLE)
/*auto text = getX11Clipboard();
if (text.has_value()) {
forceClearTempDirectory();
std::ofstream file(main_filepath / pipe_file);
file << *text;
}*/
#endif

#if defined(WAYLAND_AVAILABLE)
#if defined(WAYLAND_AVAILABLE)

#endif
#endif

#if defined(_WIN32) || defined(_WIN64)
syncWithWindowsClipboard();
#elif defined(__APPLE__)
#if defined(_WIN32) || defined(_WIN64)
syncWithWindowsClipboard();
#elif defined(__APPLE__)

#endif
#endif
}
}

void showClipboardStatus() {
Expand Down Expand Up @@ -741,9 +741,7 @@ int main(int argc, char *argv[]) {

createTempDirectory();

if (clipboard_name == default_clipboard_name) {
syncWithGUIClipboard();
}
syncWithGUIClipboard();

setupAction(argc, argv);

Expand Down

0 comments on commit 8c7c921

Please sign in to comment.