Skip to content

Commit

Permalink
fix: the black part in screen recorder
Browse files Browse the repository at this point in the history
Part of the screenshot is black in screen expansion and zoom mode.

Log: fix the black part in screen recorder
Bug: https://pms.uniontech.com/bug-view-205567.html
  • Loading branch information
add-uos authored and deepin-bot[bot] committed Jul 25, 2024
1 parent 46e0620 commit 9237a68
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ int main(int argc, char *argv[])
setenv("XDG_CURRENT_DESKTOP", "Deepin", 1);
}
DGuiApplicationHelper::setUseInactiveColorGroup(false);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

QStringList factors = QString(qgetenv("QT_SCREEN_SCALE_FACTORS")).split(";", QString::SkipEmptyParts);

if(factors.size() > 0){
bool ok = false;
double factor = factors.at(0).toDouble(&ok);

if(ok && factor > 0){
qputenv("QT_SCALE_FACTOR", QString::number(1 / factor, 'g', 2).toLatin1());
}
}

// 平板模式
Utils::isTabletEnvironment = false; // DGuiApplicationHelper::isTabletEnvironment();
Expand Down Expand Up @@ -154,7 +166,6 @@ int main(int argc, char *argv[])
app->setApplicationName("deepin-screen-recorder");
app->setApplicationVersion("1.0");
app->setAttribute(Qt::AA_UseHighDpiPixmaps);

// static const QDate buildDate = QLocale(QLocale::English).
// toDate(QString(__DATE__).replace(" ", " 0"), "MMM dd yyyy");
// QString t_date = buildDate.toString("MMdd");
Expand Down

0 comments on commit 9237a68

Please sign in to comment.