Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when linux tray icon's visibility is toggled on/off. #15582

Merged
merged 3 commits into from
May 2, 2024

Conversation

jmacato
Copy link
Member

@jmacato jmacato commented May 1, 2024

We had to access the internal RemoveMethodHandler api so that we can "dispose" of the SNI handler on the dbus connection. Some sub-optimal distros is quite sensitive to this so they crash the app instead.

Seems like the protocol itself is broken so we're forced to make a new DBus connection for each trayicon object we made on avalonia side and to hide/show, we'll just create/destroy the service name and preserve the handlers to avoid the reflection hacks needed to call RemoveMethodHandler.

@jmacato jmacato changed the title Fix crash when linux tray icon's visibility is toggled on/off. Hackfix crash when linux tray icon's visibility is toggled on/off. May 1, 2024
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0047996-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@jmacato jmacato enabled auto-merge May 1, 2024 21:04
@jmacato jmacato disabled auto-merge May 1, 2024 21:10
@jmacato jmacato force-pushed the dbus-remove-handler-hack branch from 323620d to 84a4dde Compare May 1, 2024 21:16
@jmacato jmacato enabled auto-merge May 1, 2024 21:16
@jmacato jmacato changed the title Hackfix crash when linux tray icon's visibility is toggled on/off. Fix crash when linux tray icon's visibility is toggled on/off. May 1, 2024
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0048010-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@jmacato jmacato added this pull request to the merge queue May 1, 2024
Merged via the queue into master with commit d84d923 May 2, 2024
12 checks passed
@jmacato jmacato deleted the dbus-remove-handler-hack branch May 2, 2024 00:37
@maxkatz6 maxkatz6 added the backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch label May 2, 2024
maxkatz6 pushed a commit that referenced this pull request May 8, 2024
* Call RemoveMethodHandlers to "dispose" method handlers in dbus tray icons.

* just move the handler to the ctor and remove the reflection hacks
@maxkatz6 maxkatz6 added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants