mirror of
https://github.com/VallierDev/uu-remote-linux.git
synced 2026-11-16 08:50:40 +01:00
niri 实验性支持:三屏切换、90°/180°/270° 旋转输出的采集与指针映射、手机中文文本输入,全部 gated 在 NIRI_SOCKET,不影响 Hyprland/X11 路径。新增 wayland_transform.h 及其 ASAN 单测。 感谢 @WALKERKILLER 的贡献与 CachyOS + niri 实机验收。 🤖 Generated with [Claude Code](https://claude.com/claude-code)
15 lines
630 B
C
15 lines
630 B
C
#include <stdint.h>
|
|
/* Map upright output pixels to untransformed capture/device coordinates (Smithay Transform). */
|
|
static inline void uu_source_pixel(int transform,uint32_t w,uint32_t h,uint32_t x,uint32_t y,uint32_t *sx,uint32_t *sy) {
|
|
*sx=x;*sy=y;
|
|
switch(transform) {
|
|
case 1:*sx=y;*sy=h-1-x;break;
|
|
case 2:*sx=w-1-x;*sy=h-1-y;break;
|
|
case 3:*sx=w-1-y;*sy=x;break;
|
|
}
|
|
}
|
|
/* Rotated capture and pointer mapping have hardware acceptance only on niri. */
|
|
static inline int uu_output_transform_supported(int transform,int niri) {
|
|
return transform==0 || (niri && transform>=1 && transform<=3);
|
|
}
|