Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
db05591b
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看板
提交
db05591b
编写于
9月 02, 2020
作者:
T
twwang
提交者:
night_xiaoye
9月 02, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
window: add fullscreen on anbox side.
Add fullscreen on anbox side.
上级
c7ca9981
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
34 addition
and
5 deletion
+34
-5
android/service/platform_api_stub.cpp
android/service/platform_api_stub.cpp
+1
-0
src/anbox/bridge/platform_api_skeleton.cpp
src/anbox/bridge/platform_api_skeleton.cpp
+2
-1
src/anbox/platform/sdl/window.cpp
src/anbox/platform/sdl/window.cpp
+20
-0
src/anbox/platform/sdl/window.h
src/anbox/platform/sdl/window.h
+2
-0
src/anbox/protobuf/anbox_bridge.proto
src/anbox/protobuf/anbox_bridge.proto
+1
-0
src/anbox/wm/multi_window_manager.cpp
src/anbox/wm/multi_window_manager.cpp
+1
-1
src/anbox/wm/window_state.cpp
src/anbox/wm/window_state.cpp
+4
-2
src/anbox/wm/window_state.h
src/anbox/wm/window_state.h
+3
-1
未找到文件。
android/service/platform_api_stub.cpp
浏览文件 @
db05591b
...
...
@@ -64,6 +64,7 @@ void PlatformApiStub::update_window_state(const WindowStateUpdate &state) {
out
->
set_frame_bottom
(
in
.
frame
.
bottom
);
out
->
set_task_id
(
in
.
task_id
);
out
->
set_stack_id
(
in
.
stack_id
);
out
->
set_videofullscreen
(
false
);
};
for
(
const
auto
&
window
:
state
.
updated_windows
)
{
...
...
src/anbox/bridge/platform_api_skeleton.cpp
浏览文件 @
db05591b
...
...
@@ -84,7 +84,8 @@ void PlatformApiSkeleton::handle_window_state_update_event(const anbox::protobuf
graphics
::
Rect
(
window
.
frame_left
(),
window
.
frame_top
(),
window
.
frame_right
(),
window
.
frame_bottom
()),
window
.
package_name
(),
wm
::
Task
::
Id
(
window
.
task_id
()),
wm
::
Stack
::
Id
(
window
.
stack_id
()));
wm
::
Stack
::
Id
(
window
.
stack_id
()),
window
.
has_videofullscreen
()
&&
window
.
videofullscreen
());
};
wm
::
WindowState
::
List
updated
;
...
...
src/anbox/platform/sdl/window.cpp
浏览文件 @
db05591b
...
...
@@ -157,6 +157,9 @@ Window::~Window() {
}
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_
);
...
...
@@ -174,6 +177,10 @@ bool Window::title_event_filter(int x, int y) {
SDL_HitTestResult
Window
::
on_window_hit
(
SDL_Window
*
window
,
const
SDL_Point
*
pt
,
void
*
data
)
{
auto
platform_window
=
reinterpret_cast
<
Window
*>
(
data
);
if
(
platform_window
->
get_fullscreen
())
{
return
SDL_HITTEST_NORMAL
;
}
int
w
=
0
,
h
=
0
;
SDL_GetWindowSize
(
window
,
&
w
,
&
h
);
...
...
@@ -344,6 +351,19 @@ void Window::setResizing(bool resizing) {
}
void
Window
::
update_state
(
const
wm
::
WindowState
::
List
&
states
)
{
for
(
auto
ws
:
states
)
{
if
(
!
fullscreen_
&&
ws
.
videofullscreen
())
{
SDL_SetWindowFullscreen
(
window_
,
SDL_WINDOW_FULLSCREEN_DESKTOP
);
fullscreen_
=
true
;
}
else
if
(
fullscreen_
&&
!
ws
.
videofullscreen
())
{
SDL_SetWindowFullscreen
(
window_
,
0
);
fullscreen_
=
false
;
}
if
(
fullscreen_
)
{
return
;
}
}
if
(
!
initialized
.
load
()
&&
!
states
.
empty
())
{
int
w
=
0
;
int
h
=
0
;
...
...
src/anbox/platform/sdl/window.h
浏览文件 @
db05591b
...
...
@@ -83,6 +83,7 @@ class Window : public std::enable_shared_from_this<Window>, public wm::Window {
void
setResizing
(
bool
resizing
)
override
;
void
restore_window
();
bool
get_fullscreen
()
{
return
fullscreen_
;
}
Id
id
()
const
;
std
::
uint32_t
window_id
()
const
;
Uint32
GetWindowFlags
(){
return
SDL_GetWindowFlags
(
window_
);}
...
...
@@ -111,6 +112,7 @@ class Window : public std::enable_shared_from_this<Window>, public wm::Window {
std
::
uint32_t
visible_property
;
std
::
vector
<
graphics
::
Rect
>
dis_area_
;
std
::
mutex
mutex_
;
bool
fullscreen_
=
false
;
};
}
// namespace sdl
}
// namespace platform
...
...
src/anbox/protobuf/anbox_bridge.proto
浏览文件 @
db05591b
...
...
@@ -78,6 +78,7 @@ message WindowStateUpdateEvent {
required
int32
frame_bottom
=
7
;
required
int32
task_id
=
8
;
required
int32
stack_id
=
9
;
required
bool
videoFullscreen
=
10
;
}
repeated
WindowState
windows
=
1
;
repeated
WindowState
removed_windows
=
2
;
...
...
src/anbox/wm/multi_window_manager.cpp
浏览文件 @
db05591b
...
...
@@ -44,7 +44,7 @@ void MultiWindowManager::apply_window_state_update(const WindowState::List &upda
for
(
const
auto
&
window
:
updated
)
{
// Ignore all windows which are not part of the freeform task stack
if
(
window
.
stack
()
!=
Stack
::
Id
::
Freeform
)
continue
;
if
(
window
.
stack
()
!=
Stack
::
Id
::
Freeform
&&
window
.
stack
()
!=
Stack
::
Id
::
Fullscreen
)
continue
;
// And also those which don't have a surface mapped at the moment
if
(
!
window
.
has_surface
())
continue
;
...
...
src/anbox/wm/window_state.cpp
浏览文件 @
db05591b
...
...
@@ -30,13 +30,15 @@ WindowState::WindowState()
WindowState
::
WindowState
(
const
Display
::
Id
&
display
,
bool
has_surface
,
const
graphics
::
Rect
&
frame
,
const
std
::
string
&
package_name
,
const
Task
::
Id
&
task
,
const
Stack
::
Id
&
stack
)
const
Stack
::
Id
&
stack
,
const
bool
videofullscreen
)
:
display_
(
display
),
has_surface_
(
has_surface
),
frame_
(
frame
),
package_name_
(
package_name
),
task_
(
task
),
stack_
(
stack
)
{}
stack_
(
stack
),
videofullscreen_
(
videofullscreen
)
{}
WindowState
::~
WindowState
()
{}
}
// namespace wm
...
...
src/anbox/wm/window_state.h
浏览文件 @
db05591b
...
...
@@ -35,11 +35,12 @@ class WindowState {
WindowState
();
WindowState
(
const
Display
::
Id
&
display
,
bool
has_surface
,
const
graphics
::
Rect
&
frame
,
const
std
::
string
&
package_name
,
const
Task
::
Id
&
task
,
const
Stack
::
Id
&
stack
);
const
Task
::
Id
&
task
,
const
Stack
::
Id
&
stack
,
const
bool
videofullscreen
=
false
);
~
WindowState
();
Display
::
Id
display
()
const
{
return
display_
;
}
bool
has_surface
()
const
{
return
has_surface_
;
}
bool
videofullscreen
()
const
{
return
videofullscreen_
;
}
graphics
::
Rect
frame
()
const
{
return
frame_
;
}
std
::
string
package_name
()
const
{
return
package_name_
;
}
Task
::
Id
task
()
const
{
return
task_
;
}
...
...
@@ -52,6 +53,7 @@ class WindowState {
std
::
string
package_name_
;
Task
::
Id
task_
;
Stack
::
Id
stack_
;
bool
videofullscreen_
;
};
}
// namespace wm
}
// namespace anbox
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录