Skip to content

[bug] setIgnoreCursorEvents( ) not work  #11461

Description

@Donald2010

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions