@ -53,7 +53,6 @@ namespace Avalonia.X11
private PixelSize _ realSize ;
private bool _ cleaningUp ;
private IntPtr _ handle ;
private IntPtr _ parentHandle ;
private IntPtr _ xic ;
private IntPtr _ renderHandle ;
private IntPtr _ xSyncCounter ;
@ -85,7 +84,6 @@ namespace Avalonia.X11
_ mouse = new MouseDevice ( ) ;
_ touch = new TouchDevice ( ) ;
_ keyboard = platform . KeyboardDevice ;
_ parentHandle = popupParent ! = null ? ( ( X11Window ) popupParent ) . _ handle : _ x11 . RootWindow ;
var glfeature = AvaloniaLocator . Current . GetService < IPlatformGraphics > ( ) ;
XSetWindowAttributes attr = new XSetWindowAttributes ( ) ;
@ -123,7 +121,7 @@ namespace Avalonia.X11
{
visual = visualInfo . Value . visual ;
depth = ( int ) visualInfo . Value . depth ;
attr . colormap = XCreateColormap ( _ x11 . Display , _ parentHandle , visualInfo . Value . visual , 0 ) ;
attr . colormap = XCreateColormap ( _ x11 . Display , _ x11 . RootWindow , visualInfo . Value . visual , 0 ) ;
valueMask | = SetWindowValuemask . ColorMap ;
}
@ -146,7 +144,7 @@ namespace Avalonia.X11
defaultWidth = Math . Max ( defaultWidth , 3 0 0 ) ;
defaultHeight = Math . Max ( defaultHeight , 2 0 0 ) ;
_ handle = XCreateWindow ( _ x11 . Display , _ parentHandle , 1 0 , 1 0 , defaultWidth , defaultHeight , 0 ,
_ handle = XCreateWindow ( _ x11 . Display , _ x11 . RootWindow , 1 0 , 1 0 , defaultWidth , defaultHeight , 0 ,
depth ,
( int ) CreateWindowArgs . InputOutput ,
visual ,
@ -517,7 +515,7 @@ namespace Avalonia.X11
_ configurePoint = new PixelPoint ( ev . ConfigureEvent . x , ev . ConfigureEvent . y ) ;
else
{
XTranslateCoordinates ( _ x11 . Display , _ handle , _ parentHandle ,
XTranslateCoordinates ( _ x11 . Display , _ handle , _ x11 . RootWindow ,
0 , 0 ,
out var tx , out var ty , out _ ) ;
_ configurePoint = new PixelPoint ( tx , ty ) ;
@ -1100,12 +1098,10 @@ namespace Avalonia.X11
UpdateSizeHints ( null ) ;
}
XTranslateCoordinates ( _ x11 . Display , _ parentHandle , _ x11 . RootWindow , 0 , 0 , out var wx , out var wy , out _ ) ;
var changes = new XWindowChanges
{
x = value . X - wx ,
y = ( int ) value . Y - wy
x = value . X ,
y = ( int ) value . Y
} ;
XConfigureWindow ( _ x11 . Display , _ handle , ChangeWindowFlags . CWX | ChangeWindowFlags . CWY ,
@ -1168,7 +1164,7 @@ namespace Avalonia.X11
}
} ;
xev . ClientMessageEvent . ptr4 = l4 ? ? IntPtr . Zero ;
XSendEvent ( _ x11 . Display , _ parentHandle , false ,
XSendEvent ( _ x11 . Display , _ x11 . RootWindow , false ,
new IntPtr ( ( int ) ( EventMask . SubstructureRedirectMask | EventMask . SubstructureNotifyMask ) ) , ref xev ) ;
}