mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
[broadway] Track window<->id mapping
This commit is contained in:
parent
cdd274a55c
commit
d211d78eef
@ -59,6 +59,7 @@ _gdk_display_broadway_class_init (GdkDisplayBroadwayClass * class)
|
||||
static void
|
||||
_gdk_display_broadway_init (GdkDisplayBroadway *display)
|
||||
{
|
||||
display->id_ht = g_hash_table_new (NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -49,6 +49,8 @@ struct _GdkDisplayBroadway
|
||||
GdkScreen *default_screen;
|
||||
GdkScreen **screens;
|
||||
|
||||
GHashTable *id_ht;
|
||||
|
||||
GSource *event_source;
|
||||
GdkWindow *mouse_in_toplevel;
|
||||
|
||||
|
@ -251,6 +251,7 @@ gdk_window_impl_broadway_finalize (GObject *object)
|
||||
GdkWindowObject *wrapper;
|
||||
GdkDrawableImplBroadway *draw_impl;
|
||||
GdkWindowImplBroadway *window_impl;
|
||||
GdkDisplayBroadway *display_broadway;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW_IMPL_BROADWAY (object));
|
||||
|
||||
@ -259,6 +260,9 @@ gdk_window_impl_broadway_finalize (GObject *object)
|
||||
|
||||
wrapper = (GdkWindowObject*) draw_impl->wrapper;
|
||||
|
||||
display_broadway = GDK_DISPLAY_BROADWAY (gdk_window_get_display (wrapper));
|
||||
g_hash_table_remove (display_broadway->id_ht, window_impl->id);
|
||||
|
||||
if (window_impl->cursor)
|
||||
gdk_cursor_unref (window_impl->cursor);
|
||||
|
||||
@ -330,6 +334,7 @@ _gdk_window_impl_new (GdkWindow *window,
|
||||
impl = g_object_new (_gdk_window_impl_get_type (), NULL);
|
||||
private->impl = (GdkDrawable *)impl;
|
||||
impl->id = current_id++;
|
||||
g_hash_table_insert (display_broadway->id_ht, impl->id, window);
|
||||
draw_impl = GDK_DRAWABLE_IMPL_BROADWAY (impl);
|
||||
draw_impl->wrapper = GDK_DRAWABLE (window);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user