Skip to content

Missing menu in GTK environment #1756

@siraisisatoru

Description

@siraisisatoru

Hi,

We are recently updating our pywebview version from 5.4 to 6.1. We are noticing the whole menu bar is missing in ubuntu24 but works just fine in Windows and MacOS.

I spent some time looking into this and found that

if _state['menu']:

will always None and hence now showing anything. I then look into where _state['menu'] is being set.

if menu:

This chunk of setting the _state['menu'] is after the guilib = initialize(gui), and hence gtk is getting None. The fix here will be to move the whole state menu chunk up before guilib being initialised.


Before:

Image

After:

Image

Method to reproduce:

  1. Clean Ubuntu 24 22 (should be same for 24)
  2. Install pywebview 6.1
  3. Run menu example https://pywebview.flowrl.com/examples/menu.html

The fix does not break MacOs version.

Image

I don't have a Windows on hand, so I can't test that, but I suspect it should be fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions