@@ -53,7 +53,6 @@ internal unsafe partial class X11Window : IWindowImpl, IPopupImpl, IXI2Client
53
53
private PixelSize _realSize ;
54
54
private bool _cleaningUp ;
55
55
private IntPtr _handle ;
56
- private IntPtr _parentHandle ;
57
56
private IntPtr _xic ;
58
57
private IntPtr _renderHandle ;
59
58
private IntPtr _xSyncCounter ;
@@ -85,7 +84,6 @@ public X11Window(AvaloniaX11Platform platform, IWindowImpl? popupParent, bool ov
85
84
_mouse = new MouseDevice ( ) ;
86
85
_touch = new TouchDevice ( ) ;
87
86
_keyboard = platform . KeyboardDevice ;
88
- _parentHandle = popupParent != null ? ( ( X11Window ) popupParent ) . _handle : _x11 . RootWindow ;
89
87
90
88
var glfeature = AvaloniaLocator . Current . GetService < IPlatformGraphics > ( ) ;
91
89
XSetWindowAttributes attr = new XSetWindowAttributes ( ) ;
@@ -123,7 +121,7 @@ public X11Window(AvaloniaX11Platform platform, IWindowImpl? popupParent, bool ov
123
121
{
124
122
visual = visualInfo . Value . visual ;
125
123
depth = ( int ) visualInfo . Value . depth ;
126
- attr . colormap = XCreateColormap ( _x11 . Display , _parentHandle , visualInfo . Value . visual , 0 ) ;
124
+ attr . colormap = XCreateColormap ( _x11 . Display , _x11 . RootWindow , visualInfo . Value . visual , 0 ) ;
127
125
valueMask |= SetWindowValuemask . ColorMap ;
128
126
}
129
127
@@ -146,7 +144,7 @@ public X11Window(AvaloniaX11Platform platform, IWindowImpl? popupParent, bool ov
146
144
defaultWidth = Math . Max ( defaultWidth , 300 ) ;
147
145
defaultHeight = Math . Max ( defaultHeight , 200 ) ;
148
146
149
- _handle = XCreateWindow ( _x11 . Display , _parentHandle , 10 , 10 , defaultWidth , defaultHeight , 0 ,
147
+ _handle = XCreateWindow ( _x11 . Display , _x11 . RootWindow , 10 , 10 , defaultWidth , defaultHeight , 0 ,
150
148
depth ,
151
149
( int ) CreateWindowArgs . InputOutput ,
152
150
visual ,
@@ -517,7 +515,7 @@ private void OnEvent(ref XEvent ev)
517
515
_configurePoint = new PixelPoint ( ev . ConfigureEvent . x , ev . ConfigureEvent . y ) ;
518
516
else
519
517
{
520
- XTranslateCoordinates ( _x11 . Display , _handle , _parentHandle ,
518
+ XTranslateCoordinates ( _x11 . Display , _handle , _x11 . RootWindow ,
521
519
0 , 0 ,
522
520
out var tx , out var ty , out _ ) ;
523
521
_configurePoint = new PixelPoint ( tx , ty ) ;
@@ -1100,12 +1098,10 @@ public PixelPoint Position
1100
1098
UpdateSizeHints ( null ) ;
1101
1099
}
1102
1100
1103
- XTranslateCoordinates ( _x11 . Display , _parentHandle , _x11 . RootWindow , 0 , 0 , out var wx , out var wy , out _ ) ;
1104
-
1105
1101
var changes = new XWindowChanges
1106
1102
{
1107
- x = value . X - wx ,
1108
- y = ( int ) value . Y - wy
1103
+ x = value . X ,
1104
+ y = ( int ) value . Y
1109
1105
} ;
1110
1106
1111
1107
XConfigureWindow ( _x11 . Display , _handle , ChangeWindowFlags . CWX | ChangeWindowFlags . CWY ,
@@ -1168,7 +1164,7 @@ private void SendNetWMMessage(IntPtr message_type, IntPtr l0,
1168
1164
}
1169
1165
} ;
1170
1166
xev . ClientMessageEvent . ptr4 = l4 ?? IntPtr . Zero ;
1171
- XSendEvent ( _x11 . Display , _parentHandle , false ,
1167
+ XSendEvent ( _x11 . Display , _x11 . RootWindow , false ,
1172
1168
new IntPtr ( ( int ) ( EventMask . SubstructureRedirectMask | EventMask . SubstructureNotifyMask ) ) , ref xev ) ;
1173
1169
1174
1170
}
0 commit comments