gdk: Add GDK_DISABLE=aerosnap

Disables the Aerosnap hook for Windows which is particularly useful
when debugging because the aerosnap hook slows down keyboard input.
This commit is contained in:
Benjamin Otte
2024-10-25 19:04:43 +02:00
parent 4b32ac3341
commit a7670bfcc5
4 changed files with 8 additions and 0 deletions

View File

@@ -358,6 +358,9 @@ disable certain features.
`color-mgmt`
: Disable color management
`aerosnap`
: Disable Aerosnap support on Windows
### `GDK_GL_DISABLE`
This variable can be set to a list of values, which cause GDK to

View File

@@ -158,6 +158,7 @@ static const GdkDebugKey gdk_feature_keys[] = {
{ "dmabuf", GDK_FEATURE_DMABUF, "Disable dmabuf support" },
{ "offload", GDK_FEATURE_OFFLOAD, "Disable graphics offload" },
{ "color-mgmt", GDK_FEATURE_COLOR_MANAGEMENT, "Disable color management" },
{ "aerosnap", GDK_FEATURE_AEROSNAP, "Disable Aerosnap support on Windows" },
};

View File

@@ -64,6 +64,7 @@ typedef enum {
GDK_FEATURE_DMABUF = 1 << 7,
GDK_FEATURE_OFFLOAD = 1 << 8,
GDK_FEATURE_COLOR_MANAGEMENT = 1 << 9,
GDK_FEATURE_AEROSNAP = 1 << 10,
} GdkFeatures;
#define GDK_ALL_FEATURES ((1 << 10) - 1)

View File

@@ -391,6 +391,9 @@ set_up_low_level_keyboard_hook (GdkDisplay *display)
{
HHOOK hook_handle;
if (!gdk_has_feature (GDK_FEATURE_AEROSNAP))
return;
if (GDK_WIN32_DISPLAY (display)->event_record->aerosnap_keyboard_hook != NULL)
return;