mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 11:35:56 +00:00
update:全屏状态禁止电脑锁屏(qt未提供跨平台方案,目前仅windows,可参考sdl找到跨平台方案)
This commit is contained in:
parent
d3421afc72
commit
f6b5ec61d7
1 changed files with 8 additions and 0 deletions
|
@ -233,10 +233,18 @@ void VideoForm::switchFullScreen()
|
|||
showNormal();
|
||||
updateStyleSheet(height() > width());
|
||||
showToolFrom(true);
|
||||
#ifdef Q_OS_WIN32
|
||||
::SetThreadExecutionState(ES_CONTINUOUS);
|
||||
#endif
|
||||
} else {
|
||||
showToolFrom(false);
|
||||
layout()->setContentsMargins(0, 0, 0, 0);
|
||||
showFullScreen();
|
||||
|
||||
// 全屏状态禁止电脑休眠、息屏
|
||||
#ifdef Q_OS_WIN32
|
||||
::SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue