mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-10 12:40:10 +00:00
win32: Stop sending clipboard_hwnd to main thread
With the switch to using the glib main context in the clipboard thread, the clipboard hwnd is no longer used for sending messages. This means it's not necessary to know it in the main thread. And that means there's no small window where the clipboard thread spins up and the window doesn't exist and any copy operation fails. The main context can be created before spinning up the thread so that is avoided. Fixes the gtk/textbuffer test in the testsuite.
This commit is contained in:
parent
4b4e7276f6
commit
06d61c5d39
@ -456,18 +456,6 @@ _gdk_win32_format_uses_hdata (UINT w32format)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* This function is called in the main thread */
|
||||
static gboolean
|
||||
clipboard_hwnd_created (gpointer user_data)
|
||||
{
|
||||
GdkWin32Clipdrop *clipdrop = gdk_win32_display_get_clipdrop (gdk_display_get_default ());
|
||||
|
||||
clipdrop->clipboard_hwnd = (HWND) user_data;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
/* This function is called in the main thread */
|
||||
static gboolean
|
||||
clipboard_owner_changed (gpointer user_data)
|
||||
@ -1369,8 +1357,6 @@ register_clipboard_notification (GdkWin32Clipdrop *clipdrop)
|
||||
goto failed;
|
||||
}
|
||||
|
||||
g_idle_add_full (G_PRIORITY_DEFAULT, clipboard_hwnd_created, (gpointer) CLIPDROP_CB_THREAD_MEMBER (clipdrop, clipboard_hwnd), NULL);
|
||||
|
||||
return TRUE;
|
||||
|
||||
failed:
|
||||
@ -2725,8 +2711,6 @@ _gdk_win32_advertise_clipboard_contentformats (GdkClipboard *cb,
|
||||
gsize mime_types_len;
|
||||
gsize i;
|
||||
|
||||
g_assert (clipdrop->clipboard_hwnd != NULL);
|
||||
|
||||
adv->parent.item_type = GDK_WIN32_CLIPBOARD_THREAD_QUEUE_ITEM_ADVERTISE;
|
||||
adv->parent.start_time = g_get_monotonic_time ();
|
||||
adv->parent.end_time = adv->parent.start_time + CLIPBOARD_OPERATION_TIMEOUT;
|
||||
@ -2761,8 +2745,6 @@ _gdk_win32_retrieve_clipboard_contentformats (GdkClipboard *cb,
|
||||
gsize mime_types_len;
|
||||
gsize i;
|
||||
|
||||
g_assert (clipdrop->clipboard_hwnd != NULL);
|
||||
|
||||
retr->parent.item_type = GDK_WIN32_CLIPBOARD_THREAD_QUEUE_ITEM_RETRIEVE;
|
||||
retr->parent.start_time = g_get_monotonic_time ();
|
||||
retr->parent.end_time = retr->parent.start_time + CLIPBOARD_OPERATION_TIMEOUT;
|
||||
@ -2870,8 +2852,6 @@ _gdk_win32_store_clipboard_contentformats (GdkClipboard *cb,
|
||||
GdkWin32Clipdrop *clipdrop = gdk_win32_display_get_clipdrop (gdk_clipboard_get_display (cb));
|
||||
GdkWin32ClipboardStorePrep *prep;
|
||||
|
||||
g_assert (clipdrop->clipboard_hwnd != NULL);
|
||||
|
||||
mime_types = gdk_content_formats_get_mime_types (contentformats, &n_mime_types);
|
||||
|
||||
pairs = g_array_sized_new (FALSE,
|
||||
|
@ -169,13 +169,6 @@ struct _GdkWin32Clipdrop
|
||||
*/
|
||||
GAsyncQueue *clipboard_render_queue;
|
||||
|
||||
/* Window handle for the clipboard surface that we
|
||||
* receive from the clipboard thread. We use that
|
||||
* to wake up the clipboard surface main loop by
|
||||
* posting a message to it.
|
||||
*/
|
||||
HWND clipboard_hwnd;
|
||||
|
||||
/* The thread that calls DoDragDrop (), which would
|
||||
* normally block our main thread, as it runs its own
|
||||
* Windows message loop.
|
||||
|
Loading…
Reference in New Issue
Block a user