Archived
2
0

workaround for .

This commit is contained in:
m1k1o
2021-04-07 22:19:50 +02:00
parent 89dd22727c
commit 1a09442f26
4 changed files with 9 additions and 24 deletions
server/internal

@ -166,13 +166,6 @@ short XGetScreenRate() {
return XRRConfigCurrentRate(conf);
}
void SetKeyboardLayout(char *layout) {
// TOOD: refactor, use native API.
char cmd[13] = "setxkbmap ";
strncat(cmd, layout, 2);
int r = system(cmd);
}
void SetKeyboardModifiers(int num_lock, int caps_lock, int scroll_lock) {
Display *display = getXDisplay();

@ -10,7 +10,6 @@ import "C"
import (
"fmt"
"regexp"
"sync"
"time"
"unsafe"
@ -211,20 +210,6 @@ func GetScreenSize() *types.ScreenSize {
return nil
}
func SetKeyboardLayout(layout string) {
mu.Lock()
defer mu.Unlock()
if !regexp.MustCompile(`^[a-zA-Z]+$`).MatchString(layout) {
return
}
layoutUnsafe := C.CString(layout)
defer C.free(unsafe.Pointer(layoutUnsafe))
C.SetKeyboardLayout(layoutUnsafe)
}
func SetKeyboardModifiers(num_lock int, caps_lock int, scroll_lock int) {
mu.Lock()
defer mu.Unlock()

@ -40,7 +40,6 @@
void XDisplayClose(void);
void XDisplaySet(char *input);
void SetKeyboardLayout(char *layout);
void SetKeyboardModifiers(int num_lock, int caps_lock, int scroll_lock);
#endif