Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: candidate ui can't be drawn correctly after GPU reset #1434

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fxliang
Copy link
Contributor

@fxliang fxliang commented Nov 19, 2024

after GPU reset ( situation of driver reinstalling, wakeup ETC. ), the render target object will be invalid.

reset direct2d resources if EndDraw() failed, then refresh the ui.

Tested by powershell script( run as admin)

# 在管理员权限下运行,禁用gpu然后重新启用
# 未修复前可触发小狼毫候选栏空白的bug
Set-ExecutionPolicy RemoteSigned -Scope Process
# 获取显卡设备
$gpu = Get-PnpDevice -Class Display | Where-Object { $_.Status -eq 'OK' }
if ($gpu) {
    # 停用显卡设备
    Disable-PnpDevice -InstanceId $gpu.InstanceId -Confirm:$false
    # 等待
    Start-Sleep -Seconds 2
    # 启用显卡设备
    Enable-PnpDevice -InstanceId $gpu.InstanceId -Confirm:$false
    Write-Host "显卡驱动已成功重新加载。"
} else {
    Write-Host "未找到有效的显卡设备。"
}

@fxliang fxliang changed the title fix: candidate ui can't not be drawn correctly after GPU reset fix: candidate ui can't be drawn correctly after GPU reset Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant