tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
85.73k stars 2.6k forks source link

[bug] setIgnoreCursorEvents( ) not work #11461

Open Donald2010 opened 1 month ago

Donald2010 commented 1 month ago

Describe the bug

I created a webview window with button click in main window, but can't do mouse click through the webview window with setIgnoreCursorEvents(true), even when the appwindow is also set. I'm working on win10.

Reproduction

1, In main window, there is a button to open a webview window 2, set webviewwindow to ignore cursor event.

<template>
   <div>
         <button @click="createChild"> Find Elements</button>
    </div>
</template>
<script setup lang=ts>
      import { appWindow, WebviewWindow } from "@tauri-apps/api/window";
      function createChild( )
      {
         const webview= new WebviewWindow('Childwidow',{url:'/page-a',width: 600,   height: 400, transparent:true,decorations:false}); 
         webview.once('tauri://created', function(e) { 
              webview.setIgnoreCursorEvents(true);
              appWindow.setIgnoreCursorEvents(true);
          });
      }
</script>

In page-a

<template>
   <div>
       Hello, hello, hello, hello, hello
   </div
</template
<script setup lang="ts">   </script>
<style>
    html, body {
    background-color:  transparent;
    pointer-events: none;
  }
</style>

Expected behavior

Is there workaround to click through the webviewwindow, and at the same time script in webview window can get position of mouse cursor ?

Full tauri info output

Can't click through the webview window

Stack trace

No response

Additional context

No response

amrbashir commented 1 month ago

please add the tauri info output