Comments (5)
X11 window uses current position to calculate PointToScreen.
And current position set via OnEvent -
Avalonia/src/Avalonia.X11/X11Window.cs
Lines 546 to 559 in dcae756
As a workaround, you should be able to listen for PositionChanged, and call PointToScreen there.
from avalonia.
What distributive and windowing system are you using? Is it wayland based?
from avalonia.
Thank you @maxkatz6 .
I test it in UOS and Kylin system which both are debian base system and it uses X11.
More info about my system:
>$ loginctl show-session 1 -p Type
Type=x11
UOS:
>$ cat /etc/os-version
[Version]
SystemName=UnionTech OS Desktop
SystemName[zh_CN]=统信桌面操作系统
ProductType=Desktop
ProductType[zh_CN]=桌面
EditionName=E
EditionName[zh_CN]=E
MajorVersion=20
MinorVersion=1050
OsBuild=11068.102
>$ cat /etc/os-release
PRETTY_NAME="UnionTech OS Desktop 20 E"
NAME="uos"
VERSION_ID="20"
VERSION="20"
ID=uos
HOME_URL="https://www.chinauos.com/"
BUG_REPORT_URL="http://bbs.chinauos.com"
VERSION_CODENAME=uranus
>$ uname -r
4.19.0-amd64-desktop
>$ cat /etc/debian_version
10.10
Kylin:
>$ cat /etc/.kyinfo
[dist]
name=Kylin
milestone=Desktop-V10-SP1-General-Release-TSM-lindexi-20230217
arch=arm64
beta=False
time=2023-02-17 19:01:29
>$ uname -r
5.4.18-53sy01-generic
>$ cat /etc/debian_version
bullseye/sid
from avalonia.
@kekekeks can XTranslateCoordinates be used relatively to the desktop root? Or we could at least use XGetWindowProperty
from avalonia.
Thank you @maxkatz6 .
I can get the correct position in PositionChanged event
private void MainWindow_PositionChanged(object? sender, PixelPointEventArgs e)
{
var pointToScreen = this.PointToScreen(new Point(0, 0));
Console.WriteLine($"PositionChanged PointToScreen={pointToScreen}");
}
But I still think it would be better if Avalonia can run as same in Windows and Linux.
from avalonia.
Related Issues (20)
- Arrange control to a smaller Rect can't shrink the size of control HOT 1
- Avalonia sometimes discards the DispatcherOperation with Input or lower priority HOT 4
- MinWidth not applied on UserControl HOT 1
- Custom font crash on Linux with 'Could not create glyphTypeface'. Works under Windows HOT 2
- Crash when tooltip overlaps mouse cursor during drag operation
- The SmallIcon for notifications in android doesn't set to app icon. HOT 3
- DataGridRow template
- The AlignmentX and AlignmentY properties of DrawingBrush class do not work on v11.1.1,v11.1.2,v11.1.3 HOT 6
- Get input device identity HOT 3
- GroupButton control for ToggleButton with RadioBox behavior.
- SelectableTextBlock with Inlines render issue
- Throw exception when Focus() fails. HOT 2
- TextBox text unselected when getting focus trough mouse click. HOT 1
- Can't set UserControl DataContext in XAML with compiled bindings if parent DataContext is set in constructor HOT 1
- Binding not working
- Escape key doesn't work on dialog if any interaction occurs on main window first HOT 7
- Font weights behave differently in Avalonia 11.2.0-beta1
- After Update from 11.0 to 11.1.3 published app has runtime errors with double packed resources HOT 3
- Emojis are rendered in black and white since version 11.1.0 for certain font weights HOT 2
- Application freezes when opening a new window from a menu item click (might be in AOT builds only?)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avalonia.