Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
c203b5de
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看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c203b5de
编写于
9月 08, 2020
作者:
O
openeuler-ci-bot
提交者:
Gitee
9月 08, 2020
浏览文件
操作
浏览文件
下载
差异文件
!107 window: Revert
cee74968
& solve crash
Merge pull request !107 from Night/master
上级
11d85514
6fff7f0c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
20 addition
and
57 deletion
+20
-57
src/anbox/graphics/multi_window_composer_strategy.cpp
src/anbox/graphics/multi_window_composer_strategy.cpp
+1
-8
src/anbox/graphics/rect.h
src/anbox/graphics/rect.h
+0
-11
src/anbox/platform/sdl/platform.cpp
src/anbox/platform/sdl/platform.cpp
+8
-2
src/anbox/platform/sdl/window.cpp
src/anbox/platform/sdl/window.cpp
+9
-32
src/anbox/platform/sdl/window.h
src/anbox/platform/sdl/window.h
+1
-3
src/anbox/wm/window.h
src/anbox/wm/window.h
+1
-1
未找到文件。
src/anbox/graphics/multi_window_composer_strategy.cpp
浏览文件 @
c203b5de
...
...
@@ -102,7 +102,7 @@ std::map<std::shared_ptr<wm::Window>, RenderableList> MultiWindowComposerStrateg
auto
it
=
last_renderables
.
find
(
w
.
first
);
if
(
it
!=
last_renderables
.
end
())
{
for
(
auto
&
rt
:
it
->
second
)
{
if
(
max_old_area
<
rt
.
screen_position
().
width
()
*
rt
.
screen_position
().
height
())
{
if
(
max_old_area
<
=
rt
.
screen_position
().
width
()
*
rt
.
screen_position
().
height
())
{
max_old_area
=
rt
.
screen_position
().
width
()
*
rt
.
screen_position
().
height
();
max_old_rect
=
rt
.
screen_position
();
}
...
...
@@ -115,13 +115,6 @@ 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
浏览文件 @
c203b5de
...
...
@@ -59,17 +59,6 @@ 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
浏览文件 @
c203b5de
...
...
@@ -298,11 +298,17 @@ void Platform::user_event_function(const SDL_Event &event) {
window_manager_
->
remove_task
(
param
->
taskId
);
}
}
else
if
(
event_type
==
USER_DESTROY_WINDOW
)
{
{
auto
w
=
window_manager_
->
find_window_for_task
(
param
->
taskId
);
if
(
w
)
{
w
->
destroy_window
();
}
}
window_manager_
->
erase_task
(
param
->
taskId
);
auto
it
=
tasks_
.
find
(
param
->
taskId
);
if
(
it
!=
tasks_
.
end
())
{
windows_
.
erase
(
it
->
second
);
tasks_
.
erase
(
it
);
windows_
.
erase
(
it
->
second
);
tasks_
.
erase
(
it
);
}
}
delete
param
;
...
...
src/anbox/platform/sdl/window.cpp
浏览文件 @
c203b5de
...
...
@@ -152,26 +152,18 @@ Window::Window(const std::shared_ptr<Renderer> &renderer,
SDL_ShowWindow
(
window_
);
}
Window
::~
Window
()
{
if
(
window_
)
SDL_DestroyWindow
(
window_
);
Window
::~
Window
()
{}
void
Window
::
destroy_window
()
{
if
(
window_
)
{
SDL_DestroyWindow
(
window_
);
window_
=
NULL
;
}
}
bool
Window
::
title_event_filter
(
int
x
,
int
y
)
{
if
(
fullscreen_
)
{
return
false
;
}
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
;
const
auto
top_drag_area_height
=
graphics
::
dp_to_pixel
(
button_size
+
(
button_margin
<<
1
));
return
!
fullscreen_
&&
y
<=
top_drag_area_height
;
}
SDL_HitTestResult
Window
::
on_window_hit
(
SDL_Window
*
window
,
const
SDL_Point
*
pt
,
void
*
data
)
{
...
...
@@ -413,21 +405,6 @@ void Window::restore_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
浏览文件 @
c203b5de
...
...
@@ -90,7 +90,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
;
void
destroy_window
(
)
override
;
private:
static
SDL_HitTestResult
on_window_hit
(
SDL_Window
*
window
,
const
SDL_Point
*
pt
,
void
*
data
);
...
...
@@ -110,8 +110,6 @@ 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_
;
bool
fullscreen_
=
false
;
};
}
// namespace sdl
...
...
src/anbox/wm/window.h
浏览文件 @
c203b5de
...
...
@@ -65,7 +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
)
{};
virtual
void
destroy_window
()
{}
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录