Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
rzerres
orbclient
Commits
9df7d2c8
Verified
Commit
9df7d2c8
authored
Dec 28, 2018
by
Jeremy Soller
Browse files
0.3.20 - Update fmap support
parent
dc175376
Changes
2
Hide whitespace changes
Inline
Side-by-side
Cargo.toml
View file @
9df7d2c8
[package]
name
=
"orbclient"
version
=
"0.3.
19
"
version
=
"0.3.
20
"
authors
=
[
"Jeremy Soller <jackpot51@gmail.com>"
]
description
=
"The Orbital Client Library"
documentation
=
"https://docs.rs/orbclient"
...
...
src/sys/orbital.rs
View file @
9df7d2c8
...
...
@@ -136,7 +136,11 @@ impl Window {
"orbital:{}/{}/{}/{}/{}/{}"
,
flag_str
,
x
,
y
,
w
,
h
,
title
))
{
if
let
Ok
(
address
)
=
unsafe
{
syscall
::
fmap
(
file
.as_raw_fd
(),
0
,
(
w
*
h
*
4
)
as
usize
)
}
if
let
Ok
(
address
)
=
unsafe
{
syscall
::
fmap
(
file
.as_raw_fd
(),
&
syscall
::
Map
{
offset
:
0
,
size
:
(
w
*
h
*
4
)
as
usize
,
flags
:
syscall
::
PROT_READ
|
syscall
::
PROT_WRITE
,
})
}
{
Some
(
Window
{
x
:
x
,
...
...
@@ -217,7 +221,11 @@ impl Window {
.write
(
&
format!
(
"S,{},{}"
,
width
,
height
)
.as_bytes
());
self
.sync_path
();
unsafe
{
let
address
=
syscall
::
fmap
(
self
.file
.as_raw_fd
(),
0
,
(
self
.w
*
self
.h
*
4
)
as
usize
)
let
address
=
syscall
::
fmap
(
self
.file
.as_raw_fd
(),
&
syscall
::
Map
{
offset
:
0
,
size
:
(
self
.w
*
self
.h
*
4
)
as
usize
,
flags
:
syscall
::
PROT_READ
|
syscall
::
PROT_WRITE
,
})
.expect
(
"orbclient: failed to map memory in resize"
);
self
.data
=
slice
::
from_raw_parts_mut
(
address
as
*
mut
Color
,
(
self
.w
*
self
.h
)
as
usize
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment