mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-07-20 04:05:13 -04:00
UI: Use rect intersection test for validating position
Instead of checking to see if the window's position is valid, check to see if the rectangles of the window and the monitor intersect via a rectangle intersection test.
This commit is contained in:
@@ -137,9 +137,7 @@ OBSBasic::OBSBasic(QWidget *parent)
|
||||
restoreGeometry(byteArray);
|
||||
|
||||
QRect windowGeometry = normalGeometry();
|
||||
int posx = windowGeometry.x();
|
||||
int posy = windowGeometry.y();
|
||||
if (!WindowPositionValid(posx, posy)) {
|
||||
if (!WindowPositionValid(windowGeometry)) {
|
||||
QRect rect = App()->desktop()->availableGeometry();
|
||||
setGeometry(QStyle::alignedRect(
|
||||
Qt::LeftToRight,
|
||||
|
||||
Reference in New Issue
Block a user