mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 16:32:50 -05:00
core/wayland: thread-safety meta fixes + cleanups + hypr workaround
- fork go-wayland/client and modify to make it thread-safe internally - use sync.Map and atomic values in many places to cut down on mutex boilerplate - do not create extworkspace client unless explicitly requested
This commit is contained in:
24
core/pkg/go-wayland/wayland/client/util.go
Normal file
24
core/pkg/go-wayland/wayland/client/util.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package client
|
||||
|
||||
import "math"
|
||||
|
||||
// From wayland/wayland-util.h
|
||||
|
||||
func fixedToFloat64(f int32) float64 {
|
||||
u_i := (1023+44)<<52 + (1 << 51) + int64(f)
|
||||
u_d := math.Float64frombits(uint64(u_i))
|
||||
return u_d - (3 << 43)
|
||||
}
|
||||
|
||||
func fixedFromfloat64(d float64) int32 {
|
||||
u_d := d + (3 << (51 - 8))
|
||||
u_i := int64(math.Float64bits(u_d))
|
||||
return int32(u_i)
|
||||
}
|
||||
|
||||
func PaddedLen(l int) int {
|
||||
if (l & 0x3) != 0 {
|
||||
return l + (4 - (l & 0x3))
|
||||
}
|
||||
return l
|
||||
}
|
||||
Reference in New Issue
Block a user