gtk/gdk
Руслан Ижбулатов 8caba9536c W32: Massive W32 DnD fix
Massive changes to OLE2 DnD protocol, which was completely broken before:
* Keep GdkDragContext and OLE2 objects separate (don't ref/unref them
  together, don't necessarily create them together).
* Keep IDataObject formats in the object itself, not in a global variable.
* Fix getdata() to look up the request target in its format list, not in the
  global hash table
* Create target GdkDragContext on each drag_enter, destroy it on drag_leave,
  whereas IDropTarget is created when a window becomes a drag destination
  and is re-used indefinitely.
* Query the source IDataObject for its supported types, cache them in the
  target (!) context. This is how GTK+ works, honestly.
* Remember current_src_object when we initiate a drag, to be able
  to detect later on that the data object is ours and use a
  shortcut when querying targets
* Make sure GDK_DRAG_MOTION is only sent when something changes
* Support GTK drag cursors
* Ensure that exotic GTK clipboard formats are registered
  (but try to avoid registering formats that can't be used between applications).
* Don't enumerate internal formats
* Ensure that DnD indicator window can't accept drags or receive any kind of input
  (use WS_EX_TRANSPARENT).
* Remove unneeded indentation in _gdk_win32_dnd_do_dragdrop()
* Fix indentation in gdk_win32_drag_context_drop_finish()
* Remove obsolete comments in _gdk_win32_window_register_dnd()
* Check for DnD in progress when processing WM_KILLFOCUS, don't emit a grab
  break event in such cases (this allows alt-tabbing while DnD is in progress,
  though there may be lingering issues with focus after dropping...)
* Support Shell ID List -> text/uri-list conversion, now it's possible
  to drop files (dragged from Explorer) on GTK+ applications
* Explicitly use RegisterClipboardFormatA() when we know that the string
  is not in unicode. Otherwise explicitly use RegisterClipboardFormatW()
  with a UTF8->UTF16 converted string
* Fix _gdk_win32_display_get_selection_owner() to correctly bail
  when selection owner HWND is NULL (looking up GdkWindow for NULL
  HWND always succeeds and returns the root window - not the intended
  effect)
* More logging
* Send DROP_FINISHED event after DnD loop ends
* Send STATUS event on feedback
* Move GetKeyboardState() and related code into _gdk_win32_window_drag_begin(),
  so that it's closer to the point where last_pt and start_pt are set
* Use & 0x80 to check for the key being pressed. Windows will set low-order bit
  to 1 for all mouse buttons to indicate that they are toggled, so simply
  checking for the value not being 0 is not enough anymore.
  This is probably a new thing in modern W32 that didn't exist before
  (OLE2 DnD code is old).
* Fixed (hopefully) and simplified HiDPI parts of the code.

Also adds managed DnD implementation for W32 GDK backend (for both
OLE2 and LOCAL protocols). Mostly a copy of the X11 backend code, but
there are some minor differences:
* doesn't use drag_window field in GdkDragContext,
  uses the one in GdkWin32DragContext exclusively
* subtracts hotspot offset from the window coordinates when showing
  the dragback animation
* tries to consistently support scaling and caches the scale
  in the context
* Some keynav code is removed (places where grabbing/ungrabbing should
  happen is marked with TODOs), and the rest is probably inert.

Also significantly changes the way selection (and clipboard) is handled
(as MSDN rightly notes, the handling for DnD and Clipboard
 formats is virtually the same, so it makes sense to handle
 both with the same code):
* Don't spam GDK_OWNER_CHANGE, send them only when owner
  actually changes
* Open clipboard when our process becomes the clipboard owner
  (we are doing it anyway, to empty the clipboard and *become* the owner),
  and then don't close it until a scheduled selection request event
  (with TARGETS target) is received. Process that event by announcing
  all of our supported formats (by that time add_targets() should have
  been called up the stack, thus the formats are known; just in case,
  add_targets() will also schedule a selection request, if one isn't
  scheduled already, so that late-coming formats can still be announced).
* Allow clipboard opening for selection_convert() to be delayed if it
  fails initially.
* The last two points above should fix all the bugs about GTK+ rising
  too much ruckus over OpenClipboard() failures, as owner change
  *is allowed* to fail (though not all callers currently handle
  that case), and selection_convert() is asynchronous to begin with.
  Still, this is somewhat risky, as there's a possibility that the
  code will work in unexpected ways and the clipboard will remain open.
  There's now logging to track the clipboard being opened and closed,
  and a number of failsafes that try to ensure that it isn't kept open
  for no reason.
* Added copious notes on the way clipboard works on X11, Windows and GDK-W32,
  also removed old comments in DnD implementation, replaced some of them
  with the new ones
* A lot of crufty module-global variables are stuffed into a singleton
  object, GdkWin32Selection. It's technically possible to make it a
  sub-object of the Display object (the way Wayland backend does),
  but since Display object on W32 is a singleton anyway... why bother?
* Fixed the send_change_events() a bit (was slightly broken in one of the
  previous iterations)
* Ensure that there's no confusion between selection conversion (an artifact
  term from X11) and selection transmutation (changing the data to be W32-compatible)
* Put all the transmutation code and format-target-matching code into gdkselection-win32.c,
  now this code isn't spread across multiple files.
* Consequently, moved some code away from gdkproperty-win32.c and gdkdnd-win32.c
* Extensive format transmutation checks for OLE2 DnD and clipboard.
  We now keep track of which format mappings are for transmutations,
  and which aren't (for example, when formats are passed as-is, or when
  a registered name is just an alias)
* Put transmutation code into separate functions

* Ensure that drop target keeps a format->target map for supported formats,
  this is useful when selection_convert() is called, as it only receives a
  single target and no hints on the format from which the data should
  be transmuted into this target.
* Add clear_targets() on W32, to de called by GTK
* Use g_set_object() instead of g_ref_object() where it is allowed.
* Fix indentation (and convert tabs to spaces), remove unused variables

https://bugzilla.gnome.org/show_bug.cgi?id=786509
2017-11-25 15:44:40 +00:00
..
broadway build: Disable deprecation warnings in broadway 2017-05-09 14:30:40 +01:00
deprecated gdkcolor.h: Use GDK_DEPRECATED_IN_3_14_FOR() throughout 2015-04-17 11:16:30 -05:00
mir mir: clean up an ugly function 2017-04-03 13:29:59 -04:00
quartz Update API for El Capitan+ 2017-07-18 14:54:11 -04:00
resources/glsl Use GLSL version 110 for OpenGL 2 shaders. 2016-11-01 11:58:16 -03:00
wayland wayland: Distribute protocol/server-decoration.xml in tarballs 2017-10-30 02:16:21 +00:00
win32 W32: Massive W32 DnD fix 2017-11-25 15:44:40 +00:00
x11 Revert "gdkscreen-x11: Enable RandR on VirtualBox" 2017-10-28 10:29:12 -04:00
COPYING
fallback-c89.c fallback-c89: Include config.h 2017-05-22 14:26:32 +01:00
gdk-autocleanup.h
gdk-private.c gdkwindow: add gdk_window_move_to_rect () 2016-07-19 09:38:54 -04:00
gdk-private.h gdkwindow: add gdk_window_move_to_rect () 2016-07-19 09:38:54 -04:00
gdk.c gdk: actually fix the previous commit 2016-06-29 15:10:39 +02:00
gdk.h gdk: Add GdkDevicePad 2016-08-23 21:01:44 +02:00
gdkapplaunchcontext.c Deprecate more to-be-removed screen apis 2016-10-20 13:44:23 -04:00
gdkapplaunchcontext.h
gdkapplaunchcontextprivate.h
gdkcairo.c
gdkcairo.h gdk: Deprecate gdk_cairo_create() 2016-06-09 17:45:40 +01:00
gdkconfig.h.win32
gdkconfig.h.win32_broadway
gdkcursor.c Update cursor docs 2016-05-17 14:16:39 -04:00
gdkcursor.h Update docs 2015-05-08 13:34:25 -04:00
gdkcursorprivate.h
gdkdeprecated.c
gdkdevice.c Deprecate more to-be-removed screen apis 2016-10-20 13:44:23 -04:00
gdkdevice.h gdkdevice: Add GDK_SOURCE_TABLET_PAD input source type for GdkDevices 2016-08-23 21:01:44 +02:00
gdkdevicemanager.c doc: Replace uses of #NULL with %NULL 2017-11-22 20:58:00 +00:00
gdkdevicemanager.h gdk: Deprecate GdkDeviceManager and gdk_device_grab/ungrab() 2015-12-15 00:40:21 +01:00
gdkdevicemanagerprivate.h
gdkdevicepad.c gdk: Add GdkDevicePad 2016-08-23 21:01:44 +02:00
gdkdevicepad.h gdk: Add GdkDevicePad 2016-08-23 21:01:44 +02:00
gdkdevicepadprivate.h gdk: Add GdkDevicePad 2016-08-23 21:01:44 +02:00
gdkdeviceprivate.h gdk: Add a private getter for GdkDevice::input-mode 2016-04-30 20:52:23 -04:00
gdkdevicetool.c gdk: Pass hardware ID on gdk_device_tool_new() 2016-08-23 21:01:44 +02:00
gdkdevicetool.h gdk: Add a getter for the hardware id of a GdkDeviceTool 2016-08-23 21:01:44 +02:00
gdkdevicetoolprivate.h gdk: Pass hardware ID on gdk_device_tool_new() 2016-08-23 21:01:44 +02:00
gdkdisplay.c GdkDisplay: Call the correct push|pop_error_trap() 2017-08-15 20:34:12 +01:00
gdkdisplay.h gdk: Fix parameter name mismatch 2016-05-08 15:34:28 +02:00
gdkdisplaymanager.c mir: try mir before x11 2017-03-13 03:52:06 -04:00
gdkdisplaymanager.h
gdkdisplaymanagerprivate.h
gdkdisplayprivate.h display: Add vfunc for get_monitor_at_window 2016-05-18 19:07:27 +02:00
gdkdnd.c Add some missing (nullable) annotations 2016-09-22 14:02:07 +02:00
gdkdnd.h gdk: Add GdkDragCancelReason enum as argument to GdkDragContext::cancel 2016-02-15 18:35:51 +01:00
gdkdndprivate.h gdk/dnd: Don't use default display when getting cursor 2016-04-26 23:03:24 +08:00
gdkdrawingcontext.c gdk: Unset the DrawingContext <-> cairo_t link on dispose 2016-06-12 18:55:34 +01:00
gdkdrawingcontext.h Add GdkDrawingContext 2016-06-09 17:45:40 +01:00
gdkdrawingcontextprivate.h Add GdkDrawingContext 2016-06-09 17:45:40 +01:00
gdkenumtypes.c.template
gdkenumtypes.h.template
gdkevents.c gdk: Add pad event structs, enum values, and event mask bit 2016-08-23 21:01:44 +02:00
gdkevents.h gdk: introduce edge constraint states 2017-10-03 20:06:43 -03:00
gdkframeclock.c frame-clock: Fix typo in API documentation 2017-11-22 15:25:55 +01:00
gdkframeclock.h
gdkframeclockidle.c frame-clock: avoid g_signal_emit_by_name() 2016-04-18 15:33:53 -07:00
gdkframeclockidle.h
gdkframeclockprivate.h frametimings: reuse previous frame timing in common case 2016-04-26 09:06:07 -04:00
gdkframetimings.c frametimings: reuse previous frame timing in common case 2016-04-26 09:06:07 -04:00
gdkframetimings.h
gdkgl.c gl: Check for GL_EXT_framebuffer_blit before using glBlitFramebuffer 2016-12-14 20:55:21 +00:00
gdkglcontext.c doc: Replace uses of #NULL with %NULL 2017-11-22 20:58:00 +00:00
gdkglcontext.h gdk/gl: Allow autodetection for GL/GLES 2016-10-21 11:41:43 -04:00
gdkglcontextprivate.h gl: Use a uniform to flip R and B colors on GLES 2016-04-25 14:33:36 +01:00
gdkglobals.c
gdkinternals.h gdkwindow: Avoid re-setting the opaque region if it doesn't change 2017-08-18 18:58:19 +02:00
gdkintl.h
gdkkeynames.c
gdkkeys.c Add some missing (nullable) annotations 2016-09-22 14:02:07 +02:00
gdkkeys.h gdkkeys: Add support to _get_scroll_lock_state() 2015-04-27 20:07:52 -03:00
gdkkeysprivate.h gdkkeys: Add support to _get_scroll_lock_state() 2015-04-27 20:07:52 -03:00
gdkkeysyms-compat.h
gdkkeysyms-update.pl
gdkkeysyms.h
gdkkeyuni.c GDK W32: Cache multiple keyboard layouts simultaneously 2016-08-04 16:37:18 +00:00
gdkmain.h Deprecate more to-be-removed screen apis 2016-10-20 13:44:23 -04:00
gdkmarshalers.list gdkwindow: add gdk_window_move_to_rect () 2016-07-19 09:38:54 -04:00
gdkmonitor.c gdkmonitor: Fix typo 2017-10-31 18:27:34 +00:00
gdkmonitor.h gdk: Fix parameter name mismatch 2016-05-08 15:34:28 +02:00
gdkmonitorprivate.h Add GdkMonitor 2016-04-27 23:18:16 -04:00
gdkoffscreenwindow.c gdkoffscreenwindow: use embedder to derive surfaces & scale factor 2015-12-03 21:47:29 +00:00
gdkpango.c Add docs for new API 2016-04-18 11:46:58 -04:00
gdkpango.h Add gdk_pango_context_get_for_display 2016-04-18 07:04:44 -04:00
gdkpixbuf-drawable.c Fix the fix to the last commit 2015-12-16 12:42:27 +00:00
gdkpixbuf.h
gdkprivate.h Make gdk_event_get_pointer_emulated public 2016-05-10 15:16:45 -04:00
gdkproperty.c
gdkproperty.h
gdkrectangle.c Clarify docs for gdk_rectangle_union 2016-01-20 13:44:34 -05:00
gdkrectangle.h gdk: Add gdk_rectangle_equal() 2015-10-03 22:26:27 -04:00
gdkrgba.c GdkRGBA: Fix typo precentage => percentage 2017-07-06 13:59:53 +01:00
gdkrgba.h
gdkscreen.c gdk: Fix gdk_screen_get_monitor_workarea not returning work area 2017-10-12 09:03:13 +13:00
gdkscreen.h Deprecate more to-be-removed screen apis 2016-10-20 13:44:23 -04:00
gdkscreenprivate.h
gdkseat.c gdk: Add GdkSeat::tool-added/removed signals 2016-04-06 15:43:29 +02:00
gdkseat.h GdkSeat: Add G_BEGIN_DECLS and G_END_DECLS 2015-12-22 10:33:41 +01:00
gdkseatdefault.c gdkseatdefault: Grab touch events where applicable 2017-09-20 19:19:31 +01:00
gdkseatdefaultprivate.h GdkSeatDefault: Add functions to add/remove tools 2016-04-06 15:43:29 +02:00
gdkseatprivate.h gdk: Add GdkSeat::tool-added/removed signals 2016-04-06 15:43:29 +02:00
gdkselection.c
gdkselection.h
gdktestutils.h
gdkthreads.h
gdktypes.h gdk: Fix GDK_ALL_EVENTS_MASK 2017-11-13 23:42:51 +01:00
gdkversionmacros.h.in Revert "Add GDK_AVAILABLE_IN_3_90" 2016-10-06 16:42:22 +02:00
gdkvisual.c visual: Deprecate querying APIs 2016-10-28 06:04:58 +02:00
gdkvisual.h visual: Deprecate querying APIs 2016-10-28 06:04:58 +02:00
gdkvisualprivate.h gdk: calculate pixel color shift and precision lazily 2016-02-27 12:27:54 +01:00
gdkwindow.c gdk: Clear GL context when window is withdrawn 2017-10-25 09:34:47 -04:00
gdkwindow.h Deprecate gdk_window_process[_all]_updates 2017-01-10 20:25:15 -05:00
gdkwindowimpl.c gdkwindow: Use toplevel for getting root cords in move_to_rect() 2016-08-18 04:51:57 -04:00
gdkwindowimpl.h gdkwindow: add gdk_window_move_to_rect () 2016-07-19 09:38:54 -04:00
gdkx.h
gen-keyname-table.pl
keyname-table.h gdk: Translate some more key names 2017-10-09 20:31:58 +02:00
keynames-translate.txt gdk: Translate some more key names 2017-10-09 20:31:58 +02:00
keynames.txt
Makefile.am build: Don't include the marshallers header file 2017-05-09 14:19:51 +01:00
makefile.msc