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