Asahi Linux fixes

This commit is contained in:
crschnick 2023-12-21 16:20:55 +00:00
parent 270ef73cc1
commit 9b9fed3ec6
2 changed files with 7 additions and 3 deletions

View file

@ -111,14 +111,18 @@ public class AppWindowHelper {
Alert a = AppWindowHelper.createEmptyAlert();
AppFont.normal(a.getDialogPane());
var s = (Stage) a.getDialogPane().getScene().getWindow();
a.getDialogPane().getScene().getWindow().setOnShown(event -> {
clampWindow((Stage) a.getDialogPane().getScene().getWindow()).ifPresent(rectangle2D -> {
s.setOnShown(event -> {
// Force recomputation of window bounds to properly position it on some linux systems
s.setX(s.getX() + 1);
clampWindow(s).ifPresent(rectangle2D -> {
s.setX(rectangle2D.getMinX());
s.setY(rectangle2D.getMinY());
// Somehow we have to set max size as setting the normal size does not work?
s.setMaxWidth(rectangle2D.getWidth());
s.setMaxHeight(rectangle2D.getHeight());
});
event.consume();
});
a.getDialogPane().getScene().addEventFilter(KeyEvent.KEY_PRESSED, event -> {
if (OsType.getLocal().equals(OsType.LINUX) || OsType.getLocal().equals(OsType.MACOS)) {

View file

@ -8,4 +8,4 @@ You can view the development status, report issues, and more at the following pl
- [Slack Server](https://join.slack.com/t/XPipe/shared_invite/zt-1awjq0t5j-5i4UjNJfNe1VN4b_auu6Cg)
- [Email me](mailto://crschnick@xpipe.io)
Note that the XPipe project currently is a one-man show, but I still try to respond everything in time.
Note that the XPipe project currently is a one-man show, but I still try to respond to everything in time.