Skip to content

Commit

Permalink
Increase clipboard size from 4k to 256k
Browse files Browse the repository at this point in the history
Beyond 256k, SDL_GetClipboardText() returns an empty text on my machine.

Fixes #1117 <#1117>
  • Loading branch information
rom1v committed Jun 4, 2020
1 parent a4351ba commit 4bd6672
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/src/control_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "android/keycodes.h"
#include "common.h"

#define CONTROL_MSG_MAX_SIZE 4096
#define CONTROL_MSG_MAX_SIZE (1 << 18) // 256k

#define CONTROL_MSG_INJECT_TEXT_MAX_LENGTH 300
// type: 1 byte; length: 4 bytes
Expand Down
2 changes: 1 addition & 1 deletion app/src/device_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "config.h"

#define DEVICE_MSG_MAX_SIZE 4096
#define DEVICE_MSG_MAX_SIZE (1 << 18) // 256k
// type: 1 byte; length: 4 bytes
#define DEVICE_MSG_TEXT_MAX_LENGTH (DEVICE_MSG_MAX_SIZE - 5)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class ControlMessageReader {
static final int INJECT_SCROLL_EVENT_PAYLOAD_LENGTH = 20;
static final int SET_SCREEN_POWER_MODE_PAYLOAD_LENGTH = 1;

private static final int MESSAGE_MAX_SIZE = 4096;
private static final int MESSAGE_MAX_SIZE = 1 << 18; // 256k

public static final int CLIPBOARD_TEXT_MAX_LENGTH = MESSAGE_MAX_SIZE - 5; // type: 1 byte; length: 4 bytes
public static final int INJECT_TEXT_MAX_LENGTH = 300;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class DeviceMessageWriter {

private static final int MESSAGE_MAX_SIZE = 4096;
private static final int MESSAGE_MAX_SIZE = 1 << 18; // 256k
public static final int CLIPBOARD_TEXT_MAX_LENGTH = MESSAGE_MAX_SIZE - 5; // type: 1 byte; length: 4 bytes

private final byte[] rawBuffer = new byte[MESSAGE_MAX_SIZE];
Expand Down

0 comments on commit 4bd6672

Please sign in to comment.