@@ -51,7 +51,6 @@ internal unsafe partial class X11Window : IWindowImpl, IPopupImpl, IXI2Client
51
51
private PixelSize _realSize ;
52
52
private bool _cleaningUp ;
53
53
private IntPtr _handle ;
54
- private IntPtr _parentHandle ;
55
54
private IntPtr _xic ;
56
55
private IntPtr _renderHandle ;
57
56
private IntPtr _xSyncCounter ;
@@ -83,7 +82,6 @@ public X11Window(AvaloniaX11Platform platform, IWindowImpl? popupParent, bool ov
83
82
_mouse = new MouseDevice ( ) ;
84
83
_touch = new TouchDevice ( ) ;
85
84
_keyboard = platform . KeyboardDevice ;
86
- _parentHandle = popupParent != null ? ( ( X11Window ) popupParent ) . _handle : _x11 . RootWindow ;
87
85
88
86
var glfeature = AvaloniaLocator . Current . GetService < IPlatformGraphics > ( ) ;
89
87
XSetWindowAttributes attr = new XSetWindowAttributes ( ) ;
@@ -121,7 +119,7 @@ public X11Window(AvaloniaX11Platform platform, IWindowImpl? popupParent, bool ov
121
119
{
122
120
visual = visualInfo . Value . visual ;
123
121
depth = ( int ) visualInfo . Value . depth ;
124
- attr . colormap = XCreateColormap ( _x11 . Display , _parentHandle , visualInfo . Value . visual , 0 ) ;
122
+ attr . colormap = XCreateColormap ( _x11 . Display , _x11 . RootWindow , visualInfo . Value . visual , 0 ) ;
125
123
valueMask |= SetWindowValuemask . ColorMap ;
126
124
}
127
125
@@ -144,7 +142,7 @@ public X11Window(AvaloniaX11Platform platform, IWindowImpl? popupParent, bool ov
144
142
defaultWidth = Math . Max ( defaultWidth , 300 ) ;
145
143
defaultHeight = Math . Max ( defaultHeight , 200 ) ;
146
144
147
- _handle = XCreateWindow ( _x11 . Display , _parentHandle , 10 , 10 , defaultWidth , defaultHeight , 0 ,
145
+ _handle = XCreateWindow ( _x11 . Display , _x11 . RootWindow , 10 , 10 , defaultWidth , defaultHeight , 0 ,
148
146
depth ,
149
147
( int ) CreateWindowArgs . InputOutput ,
150
148
visual ,
@@ -502,7 +500,7 @@ private void OnEvent(ref XEvent ev)
502
500
_configurePoint = new PixelPoint ( ev . ConfigureEvent . x , ev . ConfigureEvent . y ) ;
503
501
else
504
502
{
505
- XTranslateCoordinates ( _x11 . Display , _handle , _parentHandle ,
503
+ XTranslateCoordinates ( _x11 . Display , _handle , _x11 . RootWindow ,
506
504
0 , 0 ,
507
505
out var tx , out var ty , out _ ) ;
508
506
_configurePoint = new PixelPoint ( tx , ty ) ;
@@ -1071,12 +1069,10 @@ public PixelPoint Position
1071
1069
UpdateSizeHints ( null ) ;
1072
1070
}
1073
1071
1074
- XTranslateCoordinates ( _x11 . Display , _parentHandle , _x11 . RootWindow , 0 , 0 , out var wx , out var wy , out _ ) ;
1075
-
1076
1072
var changes = new XWindowChanges
1077
1073
{
1078
- x = value . X - wx ,
1079
- y = ( int ) value . Y - wy
1074
+ x = value . X ,
1075
+ y = ( int ) value . Y
1080
1076
} ;
1081
1077
1082
1078
XConfigureWindow ( _x11 . Display , _handle , ChangeWindowFlags . CWX | ChangeWindowFlags . CWY ,
@@ -1137,7 +1133,7 @@ private void SendNetWMMessage(IntPtr message_type, IntPtr l0,
1137
1133
}
1138
1134
} ;
1139
1135
xev . ClientMessageEvent . ptr4 = l4 ?? IntPtr . Zero ;
1140
- XSendEvent ( _x11 . Display , _parentHandle , false ,
1136
+ XSendEvent ( _x11 . Display , _x11 . RootWindow , false ,
1141
1137
new IntPtr ( ( int ) ( EventMask . SubstructureRedirectMask | EventMask . SubstructureNotifyMask ) ) , ref xev ) ;
1142
1138
1143
1139
}
0 commit comments