GDK W32: Another massive clipboard and DnD update

Desktop / GNOME / GTK - Руслан Ижбулатов [gmail.com] - 29 March 2018 17:43 EDT

Rename GdkWin32Selection to GdkWin32Clipdrop, since GdkSelection is mostly gone, and the word "selection" does not reflect the functionality of this object too well.

Clipboard is now handled by a separate thread, most of the code for it now lives in gdkclipdrop-win32.c, gdkclipboard-win32.c just uses clipdrop as a backend.

The DnD source part is also put into a thread. The DnD target part does not spin the main loop, it just emits a GDK event and returns a default value if it doesn't get a reply by the time the event is processed.

Both clipboard and DnD use a new GOutputStream subclass to get data from GTK and put it into a HGLOBAL.

GdkWin32DragContext is split into GdkWin32DragContext and GdkWin32DropContext, anticipating a similar change that slated to happen to GdkDragContext.

OLE2 DnD protocol is now used by default, set GDK_WIN32_OLE2_DND envvar to 0 to make GDK use the old LOCAL and DROPFILES protocols.

https://bugzilla.gnome.org/show_bug.cgi?id=773299

54a4307128 GDK W32: Another massive clipboard and DnD update
gdk/win32/gdkclipboard-win32.c | 299 +++
gdk/win32/gdkclipboard-win32.h | 39 +
gdk/win32/gdkclipdrop-win32.c | 3289 ++++++++++++++++++++++++++++++++
gdk/win32/gdkclipdrop-win32.h | 278 +++
gdk/win32/gdkdisplay-win32.c | 192 +-
gdk/win32/gdkdisplay-win32.h | 1 -
gdk/win32/gdkdrag-win32.c | 2893 ++++++++++++++++++++++++++++
gdk/win32/gdkdrop-win32.c | 1262 ++++++++++++
gdk/win32/gdkevents-win32.c | 148 +-
gdk/win32/gdkglobals-win32.c | 6 +-
gdk/win32/gdkhdataoutputstream-win32.c | 403 ++++
gdk/win32/gdkhdataoutputstream-win32.h | 63 +
gdk/win32/gdkmain-win32.c | 2 +-
gdk/win32/gdkprivate-win32.h | 23 +-
gdk/win32/gdkwin32dnd-private.h | 73 +-
gdk/win32/gdkwin32dnd.h | 17 +
gdk/win32/meson.build | 7 +-
17 files changed, 8637 insertions(+), 358 deletions(-)

Upstream: git.gnome.org


  • Share