mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-03-01 16:13:32 +00:00
Fix cursor disappearing on Windows
This commit is contained in:
parent
9e224987f7
commit
1876de0a68
@ -69,9 +69,11 @@ struct cursor_t {
|
||||
class gpu_cursor_t {
|
||||
public:
|
||||
gpu_cursor_t() : cursor_view { 0, 0, 0, 0, 0.0f, 1.0f } {};
|
||||
void set_pos(LONG rel_x, LONG rel_y) {
|
||||
void set_pos(LONG rel_x, LONG rel_y, bool visible) {
|
||||
cursor_view.TopLeftX = rel_x;
|
||||
cursor_view.TopLeftY = rel_y;
|
||||
|
||||
this->visible = visible;
|
||||
}
|
||||
|
||||
void set_texture(LONG width, LONG height, texture2d_t &&texture) {
|
||||
@ -85,6 +87,8 @@ public:
|
||||
shader_res_t input_res;
|
||||
|
||||
D3D11_VIEWPORT cursor_view;
|
||||
|
||||
bool visible;
|
||||
};
|
||||
|
||||
class duplication_t {
|
||||
|
@ -673,7 +673,7 @@ capture_e display_vram_t::snapshot(platf::img_t *img_base, std::chrono::millisec
|
||||
}
|
||||
|
||||
if(frame_info.LastMouseUpdateTime.QuadPart) {
|
||||
cursor.set_pos(frame_info.PointerPosition.Position.x, frame_info.PointerPosition.Position.y);
|
||||
cursor.set_pos(frame_info.PointerPosition.Position.x, frame_info.PointerPosition.Position.y, frame_info.PointerPosition.Visible && cursor_visible);
|
||||
}
|
||||
|
||||
if(frame_update_flag) {
|
||||
@ -687,10 +687,10 @@ capture_e display_vram_t::snapshot(platf::img_t *img_base, std::chrono::millisec
|
||||
}
|
||||
|
||||
device_ctx->CopyResource(img->texture.get(), src.get());
|
||||
if(frame_info.PointerPosition.Visible && cursor_visible) {
|
||||
if(cursor.visible) {
|
||||
D3D11_VIEWPORT view {
|
||||
0.0f, 0.0f,
|
||||
width, height,
|
||||
(float)width, (float)height,
|
||||
0.0f, 1.0f
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user