Enabling pass-through mode for external windows
The enablePassthrough option in an app’s app.config.json file allows startup applications to customize the browser window by controlling the browser window’s transparency and mouse events programmatically. The window will not be resizable or movable by the user unless the movablePassthroughWindow option is also set. For an in-depth example of how to do this, reach out to the iTwin Studio team. The enablePassthrough option enables advanced workflows such as integrating with external rendering engines.
Configuration
Section titled “Configuration”To enable pass-through mode, add the following configuration to the browserWindow property in your app’s app.config.json file:
{ "browserWindow": { "enablePassthrough": true }}API Usage
Section titled “API Usage”Startup applications can use the following APIs to control the window’s transparency and mouse event handling:
Toggle Transparency
Section titled “Toggle Transparency”The StudioStartupApp.setTransparentBackground method allows toggling the transparency of the browser window (excluding the header, navigation sidebar, and widgets/tools):
await StudioStartupApp.setTransparentBackground(true); // Enable transparencyawait StudioStartupApp.setTransparentBackground(false); // Disable transparencyIgnore Mouse Events
Section titled “Ignore Mouse Events”The StudioStartupApp.setIgnoreMouseEvents method allows the transparent window to ignore or capture mouse events:
await StudioStartupApp.setIgnoreMouseEvents(true); // Ignore mouse eventsawait StudioStartupApp.setIgnoreMouseEvents(false); // Capture mouse events- This feature is experimental and intended for advanced use cases.
- Ensure proper testing when using
enablePassthroughto avoid unexpected behavior. - When
movablePassthroughWindowis enabled, iTwin Studio disables window resizing while maximized and allows double-clicking the header to toggle the maximize state.