Skip to content

Commit

Permalink
修复不会跟随系统缩放的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
gfdgd-xi committed Jan 26, 2025
1 parent e172ace commit dd66953
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
18 changes: 17 additions & 1 deletion android-emugl/host/libs/libOpenglRender/ColorBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,8 @@ void ColorBuffer::waitSync(bool debug) {

static float getScreenDPI()
{
float scale = 1.0;
float scale = 1.25;
// Kylin 的 schemas
FILE* fp = popen("gsettings get org.ukui.SettingsDaemon.plugins.xsettings scaling-factor", "r");
char buffer[32] = {0};
if (fp) {
Expand All @@ -953,6 +954,21 @@ static float getScreenDPI()
}
pclose(fp);
}
// DDE/GXDE 的 schemas
fp = popen("gsettings get com.deepin.xsettings scale-factor", "r");
memset(buffer, 0, sizeof(buffer));
if (fp) {
if (fgets(buffer, 31, fp) != NULL) {
try {
scale = std::stof(buffer);
scale = (scale <= 0) ? 1.0 : scale;
}
catch (...) {
// do nothing
}
}
pclose(fp);
}

return scale;
}
Expand Down
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
kylin-kmre-emugl (3.0.0.1) UNRELEASED; urgency=medium

* Non-maintainer upload.
* 修复不会跟随系统缩放的问题

-- gfdgd_xi <[email protected]> Sun, 26 Jan 2025 09:16:02 +0800

kylin-kmre-emugl (3.0.0.0-0k0.4) v101; urgency=medium

* BUG号: 无
Expand Down

0 comments on commit dd66953

Please sign in to comment.