Skip to content

Conversation

Sunderland93
Copy link
Contributor

See individual commit messages

The MetaWaylandSurface corresponding to a MetaWaylandGtkSurface can be
destroyed before the MetaWaylandGtkSurface is destroyed. In its destroy
function MetaWaylandSurface however was unsetting the destructor of the
correspnding resource along with the gtk_surface1 interface
implementation. This was done to prevent further gtk_surface1 requests
on a NULLed MetaWaylandSurface, if it has been destroyed before the
MetaWaylandGtkSurface.

It would be enough to just unset the resource implementation, while
keeping the destructor to fix this leak. However the following commit
will rely on the implementation being available after the
MetaWaylandSurface has been destroyed. So instead introduce NULL checks
for all functions that can be called on the gtk_surface1 interface and
do not unset the implementation.

Original Mutter commit: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1307/diffs?commit_id=b41c4aec2677a48e30a54f731b3d7ef9924b48ea
Previously the wl_resource and MetaWaylandGtkSurface corresponding to
any client gtk_surface have been kept around until the exit of the
client due to the client side destroy method not signaling the
destruction to the server. Ideally the protocol would have specified a
destroy request marked as destructor to handle this automatically,
however this is no longer possible due to the destroy method being
implicitly generated in the absence of an explicit request in the
protocol. Adding a destroy request marked as destructor now would
generate a new destroy method that unconditionally would send the
request to the server, which would break clients running on servers not
supporting that request.

So instead of modifying the destroy request add a new "release"
destructor, that indicates to the server that it can release the
resource. This can be optionally be used by clients depending on the
server protocol version.

Original Mutter commit: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1307/diffs?commit_id=c9aa43aa7a40bb0a74c9d98836599825441fc154
Added titlebar_gesture request. This allows client to delegate titlebar gestures to the compositor,
which allows for better consistency with server-side decorations,
and a wider range of actions (including lower-on-middle-click).

Original Mutter MR: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1944
No actual changes. We will use this version to hint GTK about
the availability of non broken wl_surface.offset support for
pointer cursors.
@Sunderland93
Copy link
Contributor Author

Tested, no visual regressions is found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant