Fix screen grab error (#2139)

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
This commit is contained in:
Haris Gušić
2021-12-03 00:30:57 +01:00
committed by GitHub
parent ce336a6a70
commit 6d9768445f
2 changed files with 5 additions and 4 deletions

View File

@@ -318,7 +318,7 @@ void Controller::startVisualCapture(const uint id,
void Controller::startScreenGrab(const uint id, const int screenNumber)
{
bool ok = true;
auto screen = qApp->screens()[screenNumber];
QScreen* screen;
if (screenNumber < 0) {
QPoint globalCursorPos = QCursor::pos();
@@ -328,6 +328,8 @@ void Controller::startScreenGrab(const uint id, const int screenNumber)
screen =
qApp->screens()[qApp->desktop()->screenNumber(globalCursorPos)];
#endif
} else {
screen = qApp->screens()[screenNumber];
}
QPixmap p(ScreenGrabber().grabScreen(screen, ok));
if (ok) {