gtk2/gdk
Руслан Ижбулатов d8da6d38db GDK W32: New cursor class
Instead of now-unused GdkWin32Cursor class (a subclass of GdkCursor),
add a stand-alone GdkWin32HCursor class that is a wrapper around
HCURSOR handle.

On creation it's given a display instance, a HCURSOR handle and a boolean
that indicates whether the HCURSOR handle can or cannot be destroyed
(this depends on how the handle was obtained).
That information is stored in a hash table inside the GdkWin32Display
singleton, each entry of that table has reference count.
When the GdkWin32HCursor object is finalized, it reduces the reference
count on the table entry in the GdkWin32Display. When it's created,
it either adds such an entry or refs an existing one.
This way two pieces of code (or the same piece of code called
multiple times) that independently obtain the same HCURSOR from the OS
will get to different GdkWin32HCursor instances, but GdkWin32Display
will know that both use the same handle.

Once the reference count reaches 0 on the table entry, it is freed
and the handle (if destroyable) is put on the destruction list,
and an idle destruction function is queued.

If the same handle is once again registered for use before the
idle destructior is invoked (this happens, for example, when
an old cursor is destroyed and then replaced with a new one),
the handle gets removed from the destruction list.

The destructor just calls DestroyCursor() on each handle, calling
SetCursor(NULL) before doing that when the handle is in use.
This ensures that SetCursor(NULL) (which will cause cursor to disappear,
which is bad by itself, and which will also cause flickering if the
cursor is set to a non-NULL again shortly afterward)
is almost never called, unless GTK messes up and keeps using a cursor
beyond its lifetime.

This scheme also ensures that non-destructable cursors are not destroyed.

It's also possible to call _gdk_win32_display_hcursor_ref()
and _gdk_win32_display_hcursor_unref() manually instead of creating
GdkWin32HCursor objects, but that is not recommended.
2018-03-29 23:59:14 +00:00
..
broadway gdk: Remove GdkSurfaceImpl::shape_combine_region vfunc 2018-03-21 23:28:26 +01:00
quartz gdk: Remove GdkSurfaceImpl::shape_combine_region vfunc 2018-03-21 23:28:26 +01:00
resources/glsl Use GLSL version 110 for OpenGL 2 shaders. 2016-11-01 15:42:46 -03:00
wayland Merge branch 'bz773274' into 'master' 2018-03-25 20:44:44 +00:00
win32 GDK W32: New cursor class 2018-03-29 23:59:14 +00:00
x11 gdk: Remove GdkSurfaceImpl::shape_combine_region vfunc 2018-03-21 23:28:26 +01:00
COPYING
fallback-c89.c fallback-c89: Include config.h 2017-05-03 14:47:14 +01:00
gdk-autocleanup.h GdkWindow -> GdkSurface initial type rename 2018-03-20 11:40:08 +01:00
gdk-private.h Fix up indentation after GdkSurface rename 2018-03-21 09:06:31 +01:00
gdk.c Remove all gdk_threads_* entry points 2018-02-03 12:07:10 +01:00
gdk.h GdkWindow -> GdkSurface: File renames 2018-03-20 11:46:11 +01:00
gdkapplaunchcontext.c The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkapplaunchcontext.h gdk: Include gio.h in gdktypes.h 2017-12-10 01:09:14 +01:00
gdkapplaunchcontextprivate.h gdk: Include gio.h in gdktypes.h 2017-12-10 01:09:14 +01:00
gdkcairo.c GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkcairo.h GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkclipboard.c The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkclipboard.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkclipboardprivate.h clipboard: Add infrastructure to store clipboards 2017-12-03 05:46:48 +01:00
gdkconfig.h.meson gdk/gdkconfig.h.meson: Add GDK_WINDOWING_WIN32 2017-09-15 21:41:15 +08:00
gdkconfig.h.win32
gdkconfig.h.win32_vulkan Visual Studio builds: Support Vulkan builds 2016-12-30 14:42:38 +08:00
gdkcontentdeserializer.c Allow binding GdkContentFormatsBuilder 2018-02-03 16:24:13 +01:00
gdkcontentdeserializer.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkcontentformats.c contentsformat: Avoid a GPtrArray 2018-02-25 16:47:20 +01:00
gdkcontentformats.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkcontentformatsprivate.h gdk: Sanitize GdkContentFormats API 2017-11-20 23:15:11 +01:00
gdkcontentprovider.c The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkcontentprovider.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkcontentproviderimpl.c Allow binding GdkContentFormatsBuilder 2018-02-03 16:24:13 +01:00
gdkcontentproviderimpl.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkcontentproviderprivate.h clipboard: Introduce GdkContentProvider 2017-12-03 05:46:47 +01:00
gdkcontentserializer.c Allow binding GdkContentFormatsBuilder 2018-02-03 16:24:13 +01:00
gdkcontentserializer.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkcursor.c GdkWindow -> GdkSurface initial type rename 2018-03-20 11:40:08 +01:00
gdkcursor.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkcursorprivate.h gdk: Add gdk_cursor_hash() and gdk_cursor_equal() 2017-11-04 00:07:13 +01:00
gdkdevice.c GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkdevice.h GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkdevicepad.c The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkdevicepad.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkdevicepadprivate.h gdk: Add GdkDevicePad 2016-08-23 21:01:44 +02:00
gdkdeviceprivate.h Fix up indentation after GdkSurface rename 2018-03-21 09:06:31 +01:00
gdkdevicetool.c The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkdevicetool.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkdevicetoolprivate.h gdk: Pass hardware ID on gdk_device_tool_new() 2016-08-23 21:01:44 +02:00
gdkdisplay.c surface: Remove GSK_SURFACE_ROOT 2018-03-21 00:58:01 +01:00
gdkdisplay.h GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkdisplaymanager.c The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkdisplaymanager.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkdisplaymanagerprivate.h
gdkdisplayprivate.h Fix up indentation after GdkSurface rename 2018-03-21 09:06:31 +01:00
gdkdnd.c GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkdnd.h GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkdndprivate.h GdkSurface: Rename various functions and variables 2018-03-20 12:05:26 +01:00
gdkdrawcontext.c GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkdrawcontext.h GdkSurface: Rename various functions and variables 2018-03-20 12:05:26 +01:00
gdkdrawcontextprivate.h gdk: Make gdk_window_begin_draw_frame() take a draw context 2016-12-05 15:02:47 +01:00
gdkdrawingcontext.c frameclockidle: Rename header so it's private now 2018-03-29 05:02:15 +02:00
gdkdrawingcontext.h GdkSurface: Rename various functions and variables 2018-03-20 12:05:26 +01:00
gdkdrawingcontextprivate.h drawingcontext: Add a private struct 2016-11-23 18:49:48 +01:00
gdkenumtypes.c.template
gdkenumtypes.h.template
gdkevents.c GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkevents.h GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkeventsprivate.h gdk: Remove unused area member from GdkEventExpose 2018-03-21 00:43:28 +01:00
gdkframeclock.c Add proper annotation for gdk_frame_clock_get_refresh_info 2018-03-12 16:07:39 +01:00
gdkframeclock.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkframeclockidle.c frameclockidle: Rename header so it's private now 2018-03-29 05:02:15 +02:00
gdkframeclockidleprivate.h frameclockidle: Rename header so it's private now 2018-03-29 05:02:15 +02:00
gdkframeclockprivate.h frametimings: reuse previous frame timing in common case 2016-04-26 09:06:07 -04:00
gdkframetimings.c The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkframetimings.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkgl.c GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkglcontext.c GdkGLContext: Add a GL debug message callback 2018-03-25 21:04:36 +02:00
gdkglcontext.h GdkSurface: Rename various functions and variables 2018-03-20 12:05:26 +01:00
gdkglcontextprivate.h gdkgl: Add gdk_gl_context_get_damage() 2016-12-05 15:02:47 +01:00
gdkglobals.c gdk: Reorganize env vars 2018-01-14 17:05:04 -05:00
gdkgltexture.c GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkgltexture.h gltexture: Rename variable 2018-03-18 18:42:20 +01:00
gdkgltextureprivate.h texture: Expose subclasses as subclasses 2018-03-18 05:57:07 +01:00
gdkinternals.h surface: Make process_updates no longer be a vfunc 2018-03-21 23:28:26 +01:00
gdkintl.h
gdkkeynames.c
gdkkeys.c gdk: Add some more docs 2018-02-11 00:41:31 +00:00
gdkkeys.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkkeysprivate.h gdkkeys: Add support to _get_scroll_lock_state() 2015-04-27 20:07:52 -03:00
gdkkeysyms-update.pl Remove gdkkeysyms-compat.h 2017-05-03 14:54:37 +01:00
gdkkeysyms.h
gdkkeyuni.c Replace gdk_keymap_get_for_display by gdk_display_get_keymap 2017-12-15 07:44:58 -05:00
gdkmarshalers.list x11: Refactor xevent filtering some more 2017-12-13 01:55:56 +01:00
gdkmemorytexture.c texture: Change download vfunc 2018-03-12 17:21:45 +01:00
gdkmemorytexture.h texture: Expose subclasses as subclasses 2018-03-18 05:57:07 +01:00
gdkmemorytextureprivate.h texture: Expose subclasses as subclasses 2018-03-18 05:57:07 +01:00
gdkmonitor.c GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkmonitor.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkmonitorprivate.h monitor: Add a ::valid property 2017-11-01 14:17:20 -04:00
gdkpaintable.c GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkpaintable.h snapshot: Turn into GObject 2018-03-18 19:21:33 +01:00
gdkpango.c GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkpango.h Drop gdk_pango_context_get_for_display 2017-10-31 18:15:50 -04:00
gdkpipeiostream.c clipboard: Implement local fallback clipboard transfers 2017-12-03 05:46:47 +01:00
gdkpipeiostreamprivate.h clipboard: Implement local fallback clipboard transfers 2017-12-03 05:46:47 +01:00
gdkpixbuf-drawable.c GdkWindow -> GdkSurface: File renames 2018-03-20 11:46:11 +01:00
gdkpixbuf.h API: gdk: Remove ability to render window contents 2016-11-20 11:47:44 +01:00
gdkproperty.c Drop gdk_atom_intern 2017-12-13 23:39:03 -05:00
gdkproperty.h Drop gdk_atom_intern 2017-12-13 23:39:03 -05:00
gdkrectangle.c The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkrectangle.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkrgba.c gdkrgba: Add a missing apostrophe in a doc comment 2018-03-19 15:14:20 +00:00
gdkrgba.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkseat.c GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkseat.h GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkseatdefault.c GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkseatdefaultprivate.h GdkSeatDefault: Add functions to add/remove tools 2016-04-06 15:43:29 +02:00
gdkseatprivate.h GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkselection.c The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdksnapshot.c snapshot: Turn into GObject 2018-03-18 19:21:33 +01:00
gdksnapshot.h snapshot: Turn into GObject 2018-03-18 19:21:33 +01:00
gdksnapshotprivate.h snapshot: Turn into GObject 2018-03-18 19:21:33 +01:00
gdksurface.c frameclockidle: Rename header so it's private now 2018-03-29 05:02:15 +02:00
gdksurface.h Fix up indentation after GdkSurface rename 2018-03-21 09:06:31 +01:00
gdksurfaceimpl.c surface: Make process_updates no longer be a vfunc 2018-03-21 23:28:26 +01:00
gdksurfaceimpl.h surface: Make process_updates no longer be a vfunc 2018-03-21 23:28:26 +01:00
gdktexture.c rendernode: Check cairo surface status after creation 2018-03-20 09:37:59 +01:00
gdktexture.h gdk: Remove gdk_texture_new_from_data() 2018-03-18 05:57:07 +01:00
gdktextureprivate.h texture: Change download vfunc 2018-03-12 17:21:45 +01:00
gdktypes.h GdkSurface: Rename lots of stuff from window->surface 2018-03-20 15:14:10 +01:00
gdkversionmacros.h.in The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkvulkancontext.c vulkan: Reserve 4 images in the swapchain by default 2018-03-29 05:02:15 +02:00
gdkvulkancontext.h The big versioning cleanup 2018-02-06 01:16:32 -05:00
gdkvulkancontextprivate.h vulkan: Fix release builds 2018-01-21 15:23:17 +01:00
gen-gdk-gresources-xml.py meson: gdk: update and sync with Makefiles 2017-05-03 15:10:53 +01:00
gen-keyname-table.pl
keyname-table.h gdk: Translate some more key names 2017-10-09 20:33:14 +02:00
keynames-translate.txt gdk: Translate some more key names 2017-10-09 20:33:14 +02:00
keynames.txt
meson.build GdkWindow -> GdkSurface: File renames 2018-03-20 11:46:11 +01:00