Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dingtalk-wayland-screenshare

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.

How it works

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.

Installation (Arch Linux)

From AUR (TODO)

yay -S dingtalk-wayland-screenshare-git

Manual build

Dependencies:

sudo pacman -S libportal pipewire wireplumber xdg-desktop-portal opencv libxrandr libxcomposite

Build:

git clone https://github.com/yatli/dingtalk-hook.git
cd dingtalk-hook
mkdir -p build && cd build
cmake ../src -GNinja -DCMAKE_BUILD_TYPE=Release
ninja

Install (system-wide):

cd dingtalk-hook
makepkg -si

Or run directly:

LD_PRELOAD=$(readlink -f build/libdingtalk_hook.so) dingtalk

Usage

After installation, launch from the application menu as "DingTalk (Wayland Screen Share)", or from the terminal:

dingtalk-wayland-screenshare

When you start screen sharing in a Dingtalk meeting:

  1. Dingtalk's screen selector appears — pick any screen
  2. The xdg-desktop-portal screen picker appears — pick what you actually want to share
  3. 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.

Tested environment

  • Arch Linux, KDE Plasma 6 (Wayland)
  • NVIDIA GPU (driver 590.x) with Xwayland
  • Dingtalk 8.1.0 (dingtalk-bin from AUR)
  • Multi-monitor setup (3840×2160 + 1920×1536)

Known limitations

  • 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).

Acknowledgements

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.

License

MIT

About

Linux Dingtalk wayland screencast hook

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages