Introduction¶
The DSH browser side cannot directly call Win32 APIs to make a desktop application window topmost. This plugin forwards button clicks to the host through the Remote namespace, and the host side performs the SetWindowPos operation.
What It Is¶
This is a lightweight tool that provides an always-on-top toggle for DSH desktop applications. It is maintained by MARIOMLY and released under the MIT license.
Core Features¶
Sidebar Control¶
A pin button is displayed in the bottom bar of the left sidebar (to the left of the Settings button).
* Hollow pin: not topmost; click to keep the window in the foreground.
* Filled pin + highlighted: topmost enabled; click to disable it.
Model Tool¶
The window_pin tool is registered, allowing window topmost control directly through instructions:
window_pin { action: "status" | "on" | "off" | "toggle" }
State Memory and Automatic Detection¶
- State memory: The topmost state is remembered. What is persisted is the “intent” rather than a window handle. After the desktop window is rebuilt (for example, after restarting the service or restoring from the tray), the page automatically restores the topmost state according to the “intent” when loaded.
- Automatic detection: The target window is automatically detected. By default, detection is based on the title containing
DeepSeek Harness. The detection order is: last surviving window -> foreground window -> visible Chromium--appwindow -> first visible window.
Installation and Enablement¶
Use the official installation command:
dsh plugin --profile web add <本包目录>
This command injects window-pin into the profile’s combination tree, and it takes effect after restarting DSH.
Notes¶
- Platform limitation: Only the Windows platform is supported.
- No tray item: There is no tray menu item.
- Operation latency: A single operation takes approximately 400-500 ms (PowerShell startup + C# compilation).
- Script constraints:
- The helper script
window-topmost.ps1must be ASCII-only and BOM-free. - Child processes must use
spawn;execFilecannot be used (to avoid pipe-reading issues).
- The helper script
Conclusion¶
This tool solves the pain point that browsers cannot directly control native window topmost status, making it suitable for scenarios where the topmost state needs to be toggled frequently during development or daily use.