Fix the titlebar visibility check for small windows
Consider a window with the size of 50x100 and the titlebar height of 36px. The maximum number of visible titlebar pixels is 1800, but the titleBarRect() function reports 3600 instead, which is completely wrong.
Since the reported number of required visible pixels is wrong, the window geometry constraining logic is mistriggered and it's possible to move the window only by 1px.
Spotted in !5445 (merged)
Edited by Vlad Zahorodnii