Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
960306cc
A
anbox
项目概览
openeuler
/
anbox
通知
24
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
anbox
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
960306cc
编写于
8月 31, 2020
作者:
O
openeuler-ci-bot
提交者:
Gitee
8月 31, 2020
浏览文件
操作
浏览文件
下载
差异文件
!102 window: weixin voice cause maximize & app frame cover titlebar cause disabled
Merge pull request !102 from Night/master
上级
b0e5abb9
b30d159d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
61 addition
and
8 deletion
+61
-8
src/anbox/graphics/multi_window_composer_strategy.cpp
src/anbox/graphics/multi_window_composer_strategy.cpp
+7
-0
src/anbox/graphics/rect.h
src/anbox/graphics/rect.h
+11
-0
src/anbox/platform/sdl/platform.cpp
src/anbox/platform/sdl/platform.cpp
+1
-1
src/anbox/platform/sdl/window.cpp
src/anbox/platform/sdl/window.cpp
+34
-4
src/anbox/platform/sdl/window.h
src/anbox/platform/sdl/window.h
+5
-1
src/anbox/wm/window.cpp
src/anbox/wm/window.cpp
+1
-1
src/anbox/wm/window.h
src/anbox/wm/window.h
+2
-1
未找到文件。
src/anbox/graphics/multi_window_composer_strategy.cpp
浏览文件 @
960306cc
...
...
@@ -95,6 +95,13 @@ std::map<std::shared_ptr<wm::Window>, RenderableList> MultiWindowComposerStrateg
w
.
first
->
setResizing
(
false
);
}
}
else
{
std
::
vector
<
Rect
>
rects
;
for
(
auto
&
r
:
final_renderables
)
{
rects
.
push_back
(
r
.
screen_position
());
}
w
.
first
->
set_dis_area
(
rects
);
}
if
(
!
changed
)
{
w
.
second
=
final_renderables
;
...
...
src/anbox/graphics/rect.h
浏览文件 @
960306cc
...
...
@@ -59,6 +59,17 @@ class Rect {
bottom_
==
rhs
.
bottom
());
}
Rect
operator
&
(
const
Rect
&
rhs
)
const
{
int
left
=
left_
>
rhs
.
left
()
?
left_
:
rhs
.
left
();
int
right
=
right_
<
rhs
.
right
()
?
right_
:
rhs
.
right
();
int
top
=
top_
>
rhs
.
top
()
?
top_
:
rhs
.
top
();
int
bottom
=
bottom_
<
rhs
.
bottom
()
?
bottom_
:
rhs
.
bottom
();
if
(
right
<=
left
||
bottom
<=
top
)
{
return
Rect
(
0
,
0
,
0
,
0
);
}
return
Rect
(
left
,
top
,
right
,
bottom
);
}
inline
bool
operator
!=
(
const
Rect
&
rhs
)
const
{
return
!
operator
==
(
rhs
);
}
void
merge
(
const
Rect
&
rhs
);
...
...
src/anbox/platform/sdl/platform.cpp
浏览文件 @
960306cc
...
...
@@ -319,7 +319,7 @@ void Platform::process_input_event(const SDL_Event &event) {
for
(
auto
&
iter
:
windows_
)
{
if
(
auto
w
=
iter
.
second
.
lock
())
{
if
(
w
->
window_id
()
==
event
.
window
.
windowID
&&
w
->
title_event_filter
(
event
.
button
.
y
))
{
w
->
title_event_filter
(
event
.
button
.
x
,
event
.
button
.
y
))
{
return
;
}
}
...
...
src/anbox/platform/sdl/window.cpp
浏览文件 @
960306cc
...
...
@@ -156,9 +156,19 @@ Window::~Window() {
if
(
window_
)
SDL_DestroyWindow
(
window_
);
}
bool
Window
::
title_event_filter
(
int
point_y
)
{
const
auto
top_drag_area_height
=
graphics
::
dp_to_pixel
(
button_size
+
(
button_margin
<<
1
));
return
point_y
<
top_drag_area_height
;
bool
Window
::
title_event_filter
(
int
x
,
int
y
)
{
std
::
vector
<
graphics
::
Rect
>
dis_area
;
{
std
::
lock_guard
<
std
::
mutex
>
l
(
mutex_
);
dis_area
=
dis_area_
;
}
int
cnt
=
0
;
for
(
auto
&
r
:
dis_area
)
{
if
(
x
>=
r
.
left
()
&&
x
<=
r
.
right
()
&&
y
>=
r
.
top
()
&&
y
<=
r
.
bottom
())
{
cnt
++
;
}
}
return
cnt
==
1
;
}
SDL_HitTestResult
Window
::
on_window_hit
(
SDL_Window
*
window
,
const
SDL_Point
*
pt
,
void
*
data
)
{
...
...
@@ -175,7 +185,11 @@ SDL_HitTestResult Window::on_window_hit(SDL_Window *window, const SDL_Point *pt,
SDL_HitTestResult
result
=
SDL_HITTEST_NORMAL
;
if
(
pt
->
y
<=
top_drag_area_height
)
{
if
(
!
platform_window
->
initialized
.
load
())
{
INFO
(
"window initialized by resize"
);
platform_window
->
initialized
=
true
;
}
if
(
platform_window
->
title_event_filter
(
pt
->
x
,
pt
->
y
))
{
if
(
!
platform_window
->
initialized
.
load
())
{
INFO
(
"window initialized by click top"
);
platform_window
->
initialized
=
true
;
...
...
@@ -378,6 +392,22 @@ void Window::restore_window() {
SDL_RestoreWindow
(
window_
);
}
}
void
Window
::
set_dis_area
(
const
std
::
vector
<
graphics
::
Rect
>
&
rects
)
{
const
auto
top_drag_area_height
=
graphics
::
dp_to_pixel
(
button_size
+
(
button_margin
<<
1
));
auto
title
=
graphics
::
Rect
{
0
,
0
,
frame
().
width
(),
top_drag_area_height
};
std
::
vector
<
graphics
::
Rect
>
dis_area
;
for
(
auto
r
:
rects
)
{
auto
tmp
=
r
&
title
;
if
(
tmp
.
width
()
>
0
&&
tmp
.
height
()
>
0
)
{
dis_area
.
push_back
(
tmp
);
}
}
{
std
::
lock_guard
<
std
::
mutex
>
l
(
mutex_
);
dis_area_
.
swap
(
dis_area
);
}
}
}
// namespace sdl
}
// namespace platform
}
// namespace anbox
src/anbox/platform/sdl/window.h
浏览文件 @
960306cc
...
...
@@ -28,6 +28,7 @@
#include <memory>
#include <vector>
#include <map>
#include <mutex>
class
Renderer
;
...
...
@@ -71,7 +72,7 @@ class Window : public std::enable_shared_from_this<Window>, public wm::Window {
bool
resizable
);
~
Window
();
bool
title_event_filter
(
int
y
)
override
;
bool
title_event_filter
(
int
x
,
int
y
)
override
;
void
process_event
(
const
SDL_Event
&
event
);
bool
check_min_state
()
{
return
SDL_GetWindowFlags
(
window_
)
&
SDL_WINDOW_MINIMIZED
;}
...
...
@@ -88,6 +89,7 @@ class Window : public std::enable_shared_from_this<Window>, public wm::Window {
inline
std
::
uint32_t
get_property
()
{
return
visible_property
;
}
void
set_dis_area
(
const
std
::
vector
<
graphics
::
Rect
>
&
rects
)
override
;
private:
static
SDL_HitTestResult
on_window_hit
(
SDL_Window
*
window
,
const
SDL_Point
*
pt
,
void
*
data
);
...
...
@@ -107,6 +109,8 @@ class Window : public std::enable_shared_from_this<Window>, public wm::Window {
int
last_wnd_x
{
0
};
int
last_wnd_y
{
0
};
std
::
uint32_t
visible_property
;
std
::
vector
<
graphics
::
Rect
>
dis_area_
;
std
::
mutex
mutex_
;
};
}
// namespace sdl
}
// namespace platform
...
...
src/anbox/wm/window.cpp
浏览文件 @
960306cc
...
...
@@ -64,7 +64,7 @@ void Window::release() {
renderer_
->
destroyNativeWindow
(
native_handle
());
}
bool
Window
::
title_event_filter
(
int
y
)
{
bool
Window
::
title_event_filter
(
int
x
,
int
y
)
{
return
false
;
}
}
// namespace wm
...
...
src/anbox/wm/window.h
浏览文件 @
960306cc
...
...
@@ -55,7 +55,7 @@ class Window {
void
update_frame
(
const
graphics
::
Rect
&
frame
);
void
update_last_frame
(
const
graphics
::
Rect
&
frame
);
virtual
bool
title_event_filter
(
int
y
);
virtual
bool
title_event_filter
(
int
x
,
int
y
);
void
set_native_handle
(
const
EGLNativeWindowType
&
handle
);
EGLNativeWindowType
native_handle
()
const
;
...
...
@@ -65,6 +65,7 @@ class Window {
std
::
string
title
()
const
;
virtual
bool
checkResizeable
()
{
return
resizing_
;
}
virtual
void
setResizing
(
bool
resizing
)
{
resizing_
=
resizing
;
}
virtual
void
set_dis_area
(
const
std
::
vector
<
graphics
::
Rect
>
&
rects
)
{};
protected:
graphics
::
Rect
last_frame_
;
bool
resizing_
{
false
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录