Browse Source

Fix variable naming

pull/12751/head
Vladyslav Lubenskyi 3 years ago
parent
commit
edb1a7ff30
  1. 29
      src/Avalonia.X11/X11FocusProxy.cs

29
src/Avalonia.X11/X11FocusProxy.cs

@ -1,5 +1,4 @@
using System; using System;
using System.Diagnostics;
using static Avalonia.X11.XLib; using static Avalonia.X11.XLib;
namespace Avalonia.X11 namespace Avalonia.X11
@ -16,17 +15,17 @@ namespace Avalonia.X11
/// </remarks> /// </remarks>
/// ///
/// <see href="https://specifications.freedesktop.org/xembed-spec/xembed-spec-latest.html" /> /// <see href="https://specifications.freedesktop.org/xembed-spec/xembed-spec-latest.html" />
/// <see href="https://gitlab.gnome.org/GNOME/gtk/-/blob/3.22.30/gdk/x11/gdkwindow-x11.c#L823 /> /// <see href="https://gitlab.gnome.org/GNOME/gtk/-/blob/3.22.30/gdk/x11/gdkwindow-x11.c#L823" />
internal class X11FocusProxy internal class X11FocusProxy
{ {
private const int InvisibleBorder = 0; private const int InvisibleBorder = 0;
private const int DepthCopyFromParent = 0; private const int DepthCopyFromParent = 0;
private readonly IntPtr VisualCopyFromParent = IntPtr.Zero; private readonly IntPtr _visualCopyFromParent = IntPtr.Zero;
private readonly (int X, int Y) OutOfScreen = (-1, -1); private readonly (int X, int Y) _outOfScreen = (-1, -1);
private readonly (int Width, int Height) Smallest = (1, 1); private readonly (int Width, int Height) _smallest = (1, 1);
internal readonly IntPtr handle; internal readonly IntPtr _handle;
private readonly X11PlatformThreading.EventHandler ownerEventHandler; private readonly X11PlatformThreading.EventHandler _ownerEventHandler;
/// <summary> /// <summary>
/// Initializes instance and creates the underlying X window. /// Initializes instance and creates the underlying X window.
@ -37,20 +36,20 @@ namespace Avalonia.X11
/// <param name="eventHandler">An event handler that will handle X events that come to the proxy.</param> /// <param name="eventHandler">An event handler that will handle X events that come to the proxy.</param>
public X11FocusProxy(AvaloniaX11Platform platform, IntPtr parent, X11PlatformThreading.EventHandler eventHandler) public X11FocusProxy(AvaloniaX11Platform platform, IntPtr parent, X11PlatformThreading.EventHandler eventHandler)
{ {
handle = PrepareXWindow(platform.Info.Display, parent); _handle = PrepareXWindow(platform.Info.Display, parent);
ownerEventHandler = eventHandler; _ownerEventHandler = eventHandler;
platform.Windows[this.handle] = OnEvent; platform.Windows[_handle] = OnEvent;
} }
private void OnEvent(ref XEvent ev) private void OnEvent(ref XEvent ev)
{ {
if (ev.type == XEventName.FocusIn || ev.type == XEventName.FocusOut) if (ev.type == XEventName.FocusIn || ev.type == XEventName.FocusOut)
{ {
this.ownerEventHandler(ref ev); this._ownerEventHandler(ref ev);
} }
if (ev.type == XEventName.KeyPress || ev.type == XEventName.KeyRelease) if (ev.type == XEventName.KeyPress || ev.type == XEventName.KeyRelease)
{ {
this.ownerEventHandler(ref ev); this._ownerEventHandler(ref ev);
} }
} }
@ -62,12 +61,12 @@ namespace Avalonia.X11
| EventMask.KeyReleaseMask; | EventMask.KeyReleaseMask;
var attrs = new XSetWindowAttributes(); var attrs = new XSetWindowAttributes();
var handle = XCreateWindow(display, parent, var handle = XCreateWindow(display, parent,
OutOfScreen.X, OutOfScreen.Y, _outOfScreen.X, _outOfScreen.Y,
Smallest.Width, Smallest.Height, _smallest.Width, _smallest.Height,
InvisibleBorder, InvisibleBorder,
DepthCopyFromParent, DepthCopyFromParent,
(int)CreateWindowArgs.InputOutput, (int)CreateWindowArgs.InputOutput,
VisualCopyFromParent, _visualCopyFromParent,
new UIntPtr((uint)valueMask), new UIntPtr((uint)valueMask),
ref attrs); ref attrs);
XMapWindow(display, handle); XMapWindow(display, handle);

Loading…
Cancel
Save