Fix IPC socket deleted on multi-output setups - #2
Open
apostolosSotiropoulos wants to merge 1 commit into
Open
apostolosSotiropoulos wants to merge 1 commit into
apostolosSotiropoulos wants to merge 1 commit into
Conversation
The i3-ipc plugin extends per_output_plugin_instance_t, so one instance is created per output. This caused two issues: 1. serve() was called once per output, each call unlinking the previous socket file before creating a new one. With N outputs, the socket was created and deleted N times. 2. When an output was disabled/removed, fini() triggered handle_display_destroy() which closed and unlinked the socket, even though other output instances still needed it. Fix serve() to only initialize the socket once (guard on ipc_socket > 0), and simplify fini() to only unbind events without destroying the server. The server cleanup on actual shutdown is already handled by the wl_display_add_destroy_listener registered in serve().
Owner
|
I think you're right, this plugin shouldn't be instantiated "per output" because it can lead to unexpected behaviors, and what's more, it's useless in this case... this plugin was initially a singleton plugin, so replacing "per_output_plugin_instance_t" with "plugin_interface_t" should do the trick. My advice is to revert your changes and try to do only this: Let me know if it works for you, and if so, can you please modify your PR to only contains thoses changes, thanks... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The i3-ipc plugin extends per_output_plugin_instance_t, so one instance is created per output. This caused two issues:
serve() was called once per output, each call unlinking the previous socket file before creating a new one. With N outputs, the socket was created and deleted N times.
When an output was disabled/removed, fini() triggered handle_display_destroy() which closed and unlinked the socket, even though other output instances still needed it.
Fix serve() to only initialize the socket once (guard on ipc_socket > 0), and simplify fini() to only unbind events without destroying the server. The server cleanup on actual shutdown is already handled by the wl_display_add_destroy_listener registered in serve().