Skip to content

Window focus and blur events are not being emitted on macOS and Linux #2485

@elvinaspredkelis

Description

@elvinaspredkelis

Describe the bug

tauri://focus and tauri://blur are not being emitted on macOS (and on Linux it seems).

Other events are working just fine.

To Reproduce

Add window event listeners:

appWindow.listen("tauri://focus", ({event, payload}) => {
  console.log(event)
  console.log(payload)
})
appWindow.listen("tauri://blur", ({event, payload}) => {
  console.log(event)
  console.log(payload)
})

Expected behavior

Events being emitted.

Platform and Versions (required):

Operating System - Mac OS, version 11.2.3 X64

Node.js environment
  Node.js - 16.6.2
  @tauri-apps/cli - 1.0.0-beta.7
  @tauri-apps/api - 1.0.0-beta.6

Global packages
  npm - 7.20.3
  yarn - 1.22.11

Rust environment
  rustc - 1.54.0
  cargo - 1.54.0

App directory structure
/node_modules
/public
/src-tauri
/lib
/.git
/src

App
  tauri.rs - 1.0.0-beta.7
  build-type - bundle
  CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
  distDir - Set automatically by Vue CLI plugin
  devPath - Set automatically by Vue CLI plugin
  framework - Vue.js (Vue CLI)
  bundler - Webpack

Additional context

Add any other context about the problem here.

Stack Trace

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions