Enable screen sharing in Dingtalk meetings on Wayland.
Dingtalk uses legacy X11 APIs (XShm*) for screen capture. On Wayland sessions (via Xwayland), this produces a blank/black screen. This project hooks the X11 capture path and injects frames from a native Wayland screencast via xdg-desktop-portal and PipeWire.
Dingtalk (tblive)
│
├─ XShmCreateImage ──→ hook tracks the capture buffer
├─ XShmAttach (2nd) ──→ hook starts xdg-desktop-portal screencast
│ ├─ portal dialog: user picks what to share
│ ├─ PipeWire stream connects
│ └─ injector thread starts (~30 fps)
│
└─ reads shm buffer ←── injector writes PipeWire frames into it
The hook writes the captured content to all monitor regions in the shared memory buffer, so it works regardless of which screen the user selects in Dingtalk's own screen picker.
yay -S dingtalk-wayland-screenshare-gitDependencies:
sudo pacman -S libportal pipewire wireplumber xdg-desktop-portal opencv libxrandr libxcompositeBuild:
git clone https://github.com/yatli/dingtalk-hook.git
cd dingtalk-hook
mkdir -p build && cd build
cmake ../src -GNinja -DCMAKE_BUILD_TYPE=Release
ninjaInstall (system-wide):
cd dingtalk-hook
makepkg -siOr run directly:
LD_PRELOAD=$(readlink -f build/libdingtalk_hook.so) dingtalkAfter installation, launch from the application menu as "DingTalk (Wayland Screen Share)", or from the terminal:
dingtalk-wayland-screenshareWhen you start screen sharing in a Dingtalk meeting:
- Dingtalk's screen selector appears — pick any screen
- The xdg-desktop-portal screen picker appears — pick what you actually want to share
- Screen sharing starts with the portal-selected content
Note: For best results, select the same monitor in both dialogs. If they don't match, the shared content will be stretched.
- Arch Linux, KDE Plasma 6 (Wayland)
- NVIDIA GPU (driver 590.x) with Xwayland
- Dingtalk 8.1.0 (
dingtalk-binfrom AUR) - Multi-monitor setup (3840×2160 + 1920×1536)
- Two screen pickers appear (Dingtalk's + portal). The portal decides the actual content.
- Small memory leak per sharing session (old PipeWire objects not freed on stop).
- Only full-screen sharing is supported (window sharing not tested).
This project is inspired by and builds upon wemeet-wayland-screenshare by xuwd1, which solved the same problem for Tencent Meeting (腾讯会议). The PipeWire screencast infrastructure, framebuffer management, and OpenCV image processing code are adapted from that project.
MIT