Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
0c167d27
O
obs-studio
项目概览
尘离序散
/
obs-studio
与 Fork 源项目一致
从无法访问的项目Fork
通知
30
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
obs-studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0c167d27
编写于
5月 10, 2017
作者:
R
Richard Stanway
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
win-capture: Hide cursor when in background (window capture)
上级
9e95b2eb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
1 deletion
+23
-1
plugins/win-capture/dc-capture.c
plugins/win-capture/dc-capture.c
+1
-1
plugins/win-capture/dc-capture.h
plugins/win-capture/dc-capture.h
+1
-0
plugins/win-capture/window-capture.c
plugins/win-capture/window-capture.c
+21
-0
未找到文件。
plugins/win-capture/dc-capture.c
浏览文件 @
0c167d27
...
...
@@ -167,7 +167,7 @@ void dc_capture_capture(struct dc_capture *capture, HWND window)
ReleaseDC
(
NULL
,
hdc_target
);
if
(
capture
->
cursor_captured
)
if
(
capture
->
cursor_captured
&&
!
capture
->
cursor_hidden
)
draw_cursor
(
capture
,
hdc
,
window
);
dc_capture_release_dc
(
capture
);
...
...
plugins/win-capture/dc-capture.h
浏览文件 @
0c167d27
...
...
@@ -23,6 +23,7 @@ struct dc_capture {
bool
capture_cursor
;
bool
cursor_captured
;
bool
cursor_hidden
;
CURSORINFO
ci
;
bool
valid
;
...
...
plugins/win-capture/window-capture.c
浏览文件 @
0c167d27
...
...
@@ -26,6 +26,7 @@ struct window_capture {
struct
dc_capture
capture
;
float
resize_timer
;
float
cursor_check_time
;
HWND
window
;
RECT
last_rect
;
...
...
@@ -134,6 +135,7 @@ static obs_properties_t *wc_properties(void *unused)
}
#define RESIZE_CHECK_TIME 0.2f
#define CURSOR_CHECK_TIME 0.2f
static
void
wc_tick
(
void
*
data
,
float
seconds
)
{
...
...
@@ -162,6 +164,25 @@ static void wc_tick(void *data, float seconds)
return
;
}
wc
->
cursor_check_time
+=
seconds
;
if
(
wc
->
cursor_check_time
>
CURSOR_CHECK_TIME
)
{
DWORD
foreground_pid
,
target_pid
;
// Can't just compare the window handle in case of app with child windows
if
(
!
GetWindowThreadProcessId
(
GetForegroundWindow
(),
&
foreground_pid
))
foreground_pid
=
0
;
if
(
!
GetWindowThreadProcessId
(
wc
->
window
,
&
target_pid
))
target_pid
=
0
;
if
(
foreground_pid
&&
target_pid
&&
foreground_pid
!=
target_pid
)
wc
->
capture
.
cursor_hidden
=
true
;
else
wc
->
capture
.
cursor_hidden
=
false
;
wc
->
cursor_check_time
=
0
.
0
f
;
}
obs_enter_graphics
();
GetClientRect
(
wc
->
window
,
&
rect
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录