#13608·tauri

[bug] Wayland: Context menu position error

Author: wyhayaCreated Jun 12, 2025Updated Sep 13, 2026
Labelstype: bugplatform: Linuxstatus: needs triage

Describe the bug

Wayland

"decorations": true:

  • Position not provided: Context menu always appears at screen center
  • Position provided: Almost correct, but with approximately 26,24 pixel offset

"decorations": false:

  • Position not provided: Context menu always appears at screen center
  • Position provided: Accurate

X11 / Windows / macOS

Accurate

Reproduction

pnpm create tauri-app
# Default ...

main.ts

import { Menu } from '@tauri-apps/api/menu'

document.body.addEventListener('click', async (e) => {
  let menu = await Menu.new({
    items: [{
      text: 'hello',
      action() {}
    }]
  })
  await menu.popup()
})

Expected behavior

The context menu appears in the correct position.

Full tauri info output

↪ time pnpm tauri info

> [email protected] tauri /home/../Documents/tauri-app
> tauri info


[✔] Environment
    - OS: Fedora 42.0.0 aarch64 (X64) (gnome on wayland)
    ✔ webkit2gtk-4.1: 2.48.2
    ✔ rsvg2: 2.60.0
    ✔ rustc: 1.87.0 (17067e9ac 2025-05-09)
    ✔ cargo: 1.87.0 (99624be96 2025-05-06)
    ✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
    ✔ Rust toolchain: stable-aarch64-unknown-linux-gnu (default)
    - node: 22.15.1
    - pnpm: 10.12.1
    - npm: 10.9.2

[-] Packages
    - tauri : 2.5.1
    - tauri-build : 2.2.0
    - wry : 0.51.2
    - tao : 0.33.0
    - @tauri-apps/api : 2.5.0
    - @tauri-apps/cli : 2.5.0

[-] Plugins
    - tauri-plugin-opener : 2.2.7
    - @tauri-apps/plugin-opener : 2.2.7

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - bundler: Vite

________________________________________________________
Executed in   12.41 secs    fish           external
   usr time    1.19 secs    0.00 millis    1.19 secs
   sys time    0.46 secs    1.71 millis    0.46 secs

Stack trace

Running `target/debug/tauri-app`
libEGL warning: egl: failed to create dri2 screen
libEGL warning: DRI2: failed to create screen
libEGL warning: egl: failed to create dri2 screen
libEGL warning: DRI2: failed to create screen

(tauri-app:5905): Gdk-WARNING **: 10:15:12.868: Couldn't map as window 0xaaab12670150 as popup because it doesn't have a parent

(tauri-app:5905): Gdk-WARNING **: 10:15:14.180: Couldn't map as window 0xaaab12502af0 as popup because it doesn't have a parent

(tauri-app:5905): Gdk-WARNING **: 10:15:15.171: Couldn't map as window 0xaaab15d14480 as popup because it doesn't have a parent

(tauri-app:5905): Gdk-WARNING **: 10:15:16.289: Couldn't map as window 0xaaab1244c5a0 as popup because it doesn't have a parent

(tauri-app:5905): Gdk-WARNING **: 10:15:20.815: Couldn't map as window 0xaaab12457b00 as popup because it doesn't have a parent

(tauri-app:5905): Gdk-WARNING **: 10:15:24.274: Couldn't map as window 0xaaab124618d0 as popup because it doesn't have a parent

Additional context

No response