@@ -49,6 +49,7 @@ import * as ElectronWindow from "../electron/ElectronWindow.ts";
4949import {
5050 MENU_ACTION_CHANNEL ,
5151 SNAP_SHOT_EVENT_CHANNEL ,
52+ TRACKPAD_SCROLL_END_CHANNEL ,
5253 WINDOW_FULLSCREEN_STATE_CHANNEL ,
5354} from "../ipc/channels.ts" ;
5455import * as DesktopServerExposure from "../backend/DesktopServerExposure.ts" ;
@@ -709,6 +710,30 @@ describe("DesktopWindow", () => {
709710 } ) ,
710711 ) ;
711712
713+ it . effect ( "forwards native trackpad release to the renderer" , ( ) =>
714+ Effect . gen ( function * ( ) {
715+ const fakeWindow = makeFakeBrowserWindow ( ) ;
716+ const send = vi . spyOn ( fakeWindow . window . webContents , "send" ) ;
717+ const createCount = yield * Ref . make ( 0 ) ;
718+ const mainWindow = yield * Ref . make < Option . Option < Electron . BrowserWindow > > ( Option . none ( ) ) ;
719+ const layer = makeTestLayer ( { window : fakeWindow . window , createCount, mainWindow } ) ;
720+
721+ yield * Effect . gen ( function * ( ) {
722+ const desktopWindow = yield * DesktopWindow . DesktopWindow ;
723+ yield * desktopWindow . handleBackendReady ( new URL ( "http://127.0.0.1:3773" ) ) ;
724+ const onInput = fakeWindow . webContentsListeners . get ( "input-event" ) ;
725+ if ( ! onInput ) return yield * Effect . die ( "input-event listener was not registered" ) ;
726+ onInput ( { } , { type : "gestureScrollUpdate" } ) ;
727+ assert . notInclude (
728+ send . mock . calls . map ( ( [ channel ] ) => channel ) ,
729+ TRACKPAD_SCROLL_END_CHANNEL ,
730+ ) ;
731+ onInput ( { } , { type : "gestureScrollEnd" } ) ;
732+ assert . isTrue ( send . mock . calls . some ( ( [ channel ] ) => channel === TRACKPAD_SCROLL_END_CHANNEL ) ) ;
733+ } ) . pipe ( Effect . provide ( layer ) ) ;
734+ } ) ,
735+ ) ;
736+
712737 // Chromium hands the main window's zoom level down to embedded preview
713738 // guests, so every app zoom has to put the preview browser back at its own
714739 // zoom or zooming the UI drags the previewed page with it.
0 commit comments