Skip to content

[Bug]: gtk4 backend does not set guiEvent attribute #28962

Closed
@anntzer

Description

@anntzer

Bug summary

The GTK4 backend does not set the guiEvent attribute on GUI events.

Code for reproduction

from pylab import *; mpl.use("gtk4agg")
gcf().canvas.mpl_connect("button_press_event", lambda e: print(e.guiEvent))
show()

# and click anywhere

Actual outcome

None

Expected outcome

<GdkButtonEvent at 0x...>

Additional information

Probably the fix is simply to pass guiEvent=controller.get_current_event() to each of the event callbacks in backend_gtk4.py

Operating system

macOS, but should be irrelevant

Matplotlib Version

3.10.0.dev786+g60458da93e

Matplotlib Backend

gtk4agg

Python version

3.12

Jupyter version

no

Installation

git checkout

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions