summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-07-31 11:37:28 +0000
committerMatthias Clasen <mclasen@redhat.com>2018-07-31 11:37:28 +0000
commitce7956cd50391509305c158cbffbe55905052070 (patch)
tree715ad6bc50ad2954a975a94bb564c532c236bd1c
parent1129febd7d8e251554be02814793ab7b3aafe2e6 (diff)
parentd29b378fa0f8009d9f8dcf0bd310105837006ebd (diff)
downloadgtk+-ce7956cd50391509305c158cbffbe55905052070.tar.gz
Merge branch 'issue1214-tooltips-win32-gtk4' into 'master'
Gdk-Win32: Correct handling of transient state changes See merge request GNOME/gtk!280
-rw-r--r--gdk/win32/gdksurface-win32.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index ee922825fe..d47d67bfdb 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -760,17 +760,11 @@ gdk_win32_surface_destroy (GdkSurface *window,
_gdk_remove_modal_window (window);
/* Remove all our transient children */
- tmp = surface_impl->transient_children;
- while (tmp != NULL)
+ while (surface_impl->transient_children != NULL)
{
- GdkSurface *child = tmp->data;
- GdkSurfaceImplWin32 *child_impl = GDK_SURFACE_IMPL_WIN32 (GDK_SURFACE (child)->impl);
-
- child_impl->transient_owner = NULL;
- tmp = tmp->next;
+ GdkSurface *child = surface_impl->transient_children->data;
+ gdk_surface_set_transient_for (child, NULL);
}
- g_slist_free (surface_impl->transient_children);
- surface_impl->transient_children = NULL;
/* Remove ourself from our transient owner */
if (surface_impl->transient_owner != NULL)
@@ -1672,27 +1666,29 @@ gdk_win32_surface_set_transient_for (GdkSurface *window,
return;
}
- if (parent == NULL)
+ if (surface_impl->transient_owner == parent)
+ return;
+
+ if (GDK_IS_SURFACE (surface_impl->transient_owner))
{
GdkSurfaceImplWin32 *trans_impl = GDK_SURFACE_IMPL_WIN32 (surface_impl->transient_owner->impl);
- if (trans_impl->transient_children != NULL)
- {
- item = g_slist_find (trans_impl->transient_children, window);
- item->data = NULL;
- trans_impl->transient_children = g_slist_delete_link (trans_impl->transient_children, item);
- trans_impl->num_transients--;
+ item = g_slist_find (trans_impl->transient_children, window);
+ item->data = NULL;
+ trans_impl->transient_children = g_slist_delete_link (trans_impl->transient_children, item);
+ trans_impl->num_transients--;
- if (!trans_impl->num_transients)
- {
- trans_impl->transient_children = NULL;
- }
+ if (!trans_impl->num_transients)
+ {
+ trans_impl->transient_children = NULL;
}
+
g_object_unref (G_OBJECT (surface_impl->transient_owner));
g_object_unref (G_OBJECT (window));
surface_impl->transient_owner = NULL;
}
- else
+
+ if (parent)
{
parent_impl = GDK_SURFACE_IMPL_WIN32 (parent->impl);