mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 04:31:09 +00:00
wayland: use g_signal_handler_disconnect()
Use of g_signal_handlers_disconnect_by_func() needs to do more work than necessary to find all the matching handlers. Instead, just hold on to the signal identifier and remove it directly so we hit the fast path. Not terribly ground breaking in terms of performance gains, but its done enough to be worthwhile. https://bugzilla.gnome.org/show_bug.cgi?id=766049
This commit is contained in:
parent
c27b8b48ab
commit
ebb894cd64
@ -161,6 +161,8 @@ struct _GdkWindowImplWayland
|
||||
|
||||
int saved_width;
|
||||
int saved_height;
|
||||
|
||||
gulong parent_surface_committed_handler;
|
||||
};
|
||||
|
||||
struct _GdkWindowImplWaylandClass
|
||||
@ -1144,9 +1146,9 @@ on_parent_surface_committed (GdkWindowImplWayland *parent_impl,
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (parent_impl,
|
||||
(gpointer) on_parent_surface_committed,
|
||||
window);
|
||||
g_signal_handler_disconnect (parent_impl,
|
||||
impl->parent_surface_committed_handler);
|
||||
impl->parent_surface_committed_handler = 0;
|
||||
|
||||
wl_subsurface_set_desync (impl->display_server.wl_subsurface);
|
||||
}
|
||||
@ -1180,9 +1182,10 @@ gdk_wayland_window_create_subsurface (GdkWindow *window)
|
||||
* content, wait with making the subsurface desynchronized until after
|
||||
* the parent was committed.
|
||||
*/
|
||||
g_signal_connect_object (parent_impl, "committed",
|
||||
G_CALLBACK (on_parent_surface_committed),
|
||||
window, 0);
|
||||
impl->parent_surface_committed_handler =
|
||||
g_signal_connect_object (parent_impl, "committed",
|
||||
G_CALLBACK (on_parent_surface_committed),
|
||||
window, 0);
|
||||
gdk_window_request_transient_parent_commit (window);
|
||||
}
|
||||
}
|
||||
@ -1761,9 +1764,12 @@ unmap_subsurface (GdkWindow *window)
|
||||
|
||||
parent_impl = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl);
|
||||
wl_subsurface_destroy (impl->display_server.wl_subsurface);
|
||||
g_signal_handlers_disconnect_by_func (parent_impl,
|
||||
(gpointer) on_parent_surface_committed,
|
||||
window);
|
||||
if (impl->parent_surface_committed_handler)
|
||||
{
|
||||
g_signal_handler_disconnect (parent_impl,
|
||||
impl->parent_surface_committed_handler);
|
||||
impl->parent_surface_committed_handler = 0;
|
||||
}
|
||||
impl->display_server.wl_subsurface = NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user