mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 09:00:26 +00:00
Make window clamping more robust for invalid values
This commit is contained in:
parent
54dff11353
commit
974da59fc8
1 changed files with 5 additions and 0 deletions
|
@ -269,6 +269,11 @@ public class AppWindowHelper {
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This should not happen but on weird Linux systems nothing is impossible
|
||||||
|
if (w < 0 || h < 0) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
return changed ? Optional.of(new Rectangle2D(x, y, w, h)) : Optional.empty();
|
return changed ? Optional.of(new Rectangle2D(x, y, w, h)) : Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue