Added a min floating size on start

This commit is contained in:
vaxerski 2021-12-01 16:24:49 +01:00
parent b169aca415
commit dc017c49c5
1 changed files with 6 additions and 0 deletions

View File

@ -119,6 +119,12 @@ CWindow* Events::remapFloatingWindow(int windowID, int forcemonitor) {
window.setDefaultSize(Vector2D(g_pWindowManager->Screen->width_in_pixels / 2.f, g_pWindowManager->Screen->height_in_pixels / 2.f));
}
if (window.getDefaultSize().x < 20 || window.getDefaultSize().y < 20) {
// min size
window.setDefaultSize(Vector2D( std::clamp(window.getDefaultSize().x, (double)20, (double)99999),
std::clamp(window.getDefaultSize().y, (double)20, (double)99999)));
}
if (nextWindowCentered) {
nextWindowCentered = false;