Skip to content

Commit

Permalink
fix(x11): make keyboard inputs work even when the pointer is outside …
Browse files Browse the repository at this point in the history
…the window
  • Loading branch information
ramezgerges committed Jan 24, 2025
1 parent f09c944 commit 29893be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Uno.UI.Runtime.Skia.X11/X11XamlRootHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@ internal partial class X11XamlRootHost : IXamlRootHost
private const int DefaultColorDepth = 32;
private const int FallbackColorDepth = 24;

// Note For KeyPress/KeyRelease: subscribing on the top window prevents key inputs from hitting when the pointer
// is outside the window. https://github.com/unoplatform/uno/issues/19310
private const IntPtr RootEventsMask =
(IntPtr)EventMask.ExposureMask |
(IntPtr)EventMask.StructureNotifyMask |
(IntPtr)EventMask.VisibilityChangeMask |
(IntPtr)EventMask.KeyPressMask |
(IntPtr)EventMask.KeyReleaseMask |
(IntPtr)EventMask.NoEventMask;
private const IntPtr TopEventsMask =
(IntPtr)EventMask.ExposureMask |
(IntPtr)EventMask.ButtonPressMask |
(IntPtr)EventMask.ButtonReleaseMask |
(IntPtr)EventMask.PointerMotionMask |
(IntPtr)EventMask.KeyPressMask |
(IntPtr)EventMask.KeyReleaseMask |
(IntPtr)EventMask.EnterWindowMask |
(IntPtr)EventMask.LeaveWindowMask |
(IntPtr)EventMask.FocusChangeMask |
Expand Down

0 comments on commit 29893be

Please sign in to comment.