forked from pyrite-dev/milsko
fix entry widget's use of clipboard
This commit is contained in:
parent
d61e432e97
commit
efbf90945a
2 changed files with 10 additions and 3 deletions
|
|
@ -2385,8 +2385,11 @@ static void MwLLSetClipboardImpl(MwLL handle, const char* text) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLGetClipboardImpl(MwLL handle) {
|
static void MwLLGetClipboardImpl(MwLL handle) {
|
||||||
(void)handle;
|
int i;
|
||||||
/* no-op */
|
for(i = 0; i < arrlen(handle->wayland.clipboard_devices); i++) {
|
||||||
|
wl_clipboard_read(
|
||||||
|
handle->wayland.clipboard_devices[i]);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,11 @@ static void prop_change(MwWidget handle, const char* prop) {
|
||||||
static void clipboard(MwWidget handle, const char* data) {
|
static void clipboard(MwWidget handle, const char* data) {
|
||||||
MwEntry t = handle->internal;
|
MwEntry t = handle->internal;
|
||||||
const char* str = MwGetText(handle, MwNtext);
|
const char* str = MwGetText(handle, MwNtext);
|
||||||
char* out = malloc(strlen(str) + strlen(data) + 1);
|
char* out;
|
||||||
|
if(!str) {
|
||||||
|
str = "";
|
||||||
|
}
|
||||||
|
out = malloc(strlen(str) + strlen(data) + 1);
|
||||||
|
|
||||||
if(str == NULL) str = "";
|
if(str == NULL) str = "";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue