~eliasnaur/gio-patches

gio: app: prevent default Windows event handler from running for WM_SYSKEYUP/DOWN v3 PROPOSED

aarzilli
aarzilli: 1
 app: prevent default Windows event handler from running for WM_SYSKEYUP/DOWN

 1 files changed, 5 insertions(+), 0 deletions(-)
build pending: apple.yml
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~eliasnaur/gio-patches/patches/21954/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH gio v3] app: prevent default Windows event handler from running for WM_SYSKEYUP/DOWN Export this patch

aarzilli
F10 has a special meaning on Windows, if the default handler runs the
first key press following F10 will not generate a key.Press event and
if the first key press after F10 is space the window menu will be
opened instead.

Fixes #213

Signed-off-by: aarzilli <alessandro.arzilli@gmail.com>
---
 app/internal/wm/os_windows.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/app/internal/wm/os_windows.go b/app/internal/wm/os_windows.go
index 05d440e..ad9ce2d 100644
--- a/app/internal/wm/os_windows.go
+++ b/app/internal/wm/os_windows.go
@@ -249,7 +249,12 @@ func windowProc(hwnd syscall.Handle, msg uint32, wParam, lParam uintptr) uintptr
			if msg == windows.WM_KEYUP || msg == windows.WM_SYSKEYUP {
				e.State = key.Release
			}

			w.w.Event(e)

			if (wParam == windows.VK_F10) && (msg == windows.WM_SYSKEYDOWN || msg == windows.WM_SYSKEYUP) {
				return 0
			}
		}
	case windows.WM_LBUTTONDOWN:
		w.pointerButton(pointer.ButtonPrimary, true, lParam, getModifiers())
-- 
2.17.1
Thanks, merged.