Commit graph

199 commits

Author SHA1 Message Date
Uli Schlachter
64dad39536
m: Bump x11rb to v0.13
Signed-off-by: Uli Schlachter <psychon@znc.in>
2023-12-09 07:03:18 -08:00
dependabot[bot]
0b8f10d91d
build(deps): update windows-sys requirement from 0.48.0 to 0.52.0
* build(deps): update windows-sys requirement from 0.48.0 to 0.52.0

Updates the requirements on [windows-sys](https://github.com/microsoft/windows-rs) to permit the latest version.
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Commits](https://github.com/microsoft/windows-rs/compare/0.48.0...0.52.0)

---
updated-dependencies:
- dependency-name: windows-sys
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix the clippy warning

Signed-off-by: John Nunley <dev@notgull.net>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: John Nunley <dev@notgull.net>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: John Nunley <dev@notgull.net>
2023-11-19 22:11:53 -08:00
Ian Douglas Scott
58da196740 Update drm to 0.11
Drm-rs now no longer requires separate generated bindings for each
platform, so this fixes the build on architectures/OSes where drm didn't
have bindings.

It also now uses Rustix instead of Nix, but Nix is still used by the
Wayland and X11 backends, until the next wayland-rs and x11rb release.

This is not a breaking change since `drm` isn't exposed in the API.
2023-11-14 19:18:20 -08:00
Mads Marquart
ac92d531ed
Merge pull request #180 from rust-windowing/fix-double-free
macOS: Fix double-free of `NSWindow`
2023-11-15 02:30:33 +01:00
Mads Marquart
f198b222bd macOS: Fix double-free of NSWindow 2023-11-15 02:16:04 +01:00
John Nunley
800f640270 v0.4.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-11-13 19:38:35 -08:00
Marijn Suijten
ab7688e2ed examples: Trigger event-loop exit on Escape key
In visual examples it is convenient to just press the escape key to exit
the demo.
2023-11-06 06:46:36 -08:00
Marijn Suijten
636a7148c8 examples/fruit: Make draw logic act on RedrawRequested instead of Close again
It seems #132 contains a copy-paste typo to trigger draw logic on
`CloseRequested` instead of on `RedrawRequested`.

Signed-off-by: Marijn Suijten <marijns95@gmail.com>
2023-11-06 06:44:49 -08:00
John Nunley
c2ec494336
feat: Enable creating an X11 display without connection
For pure-Rust connections, there is no XCB connection that can be passed into
the display constructor. Thus, this PR enables the display to be created without
needing an XCB or Xlib handle, by providing `None` in the constructor.

cc rust-windowing/raw-window-handle#120

Signed-off-by: John Nunley <dev@notgull.net>
2023-11-01 22:26:10 -07:00
Ian Douglas Scott
3b98da7e28
x11: dup fd before passing to shm_attach_fd
This function takes `Into<RawFdContainer>`. So it accepts an owned fd,
and closes it. So as long as the API is like this, we need to dup a new
fd it can close when calling it.

`Into<RawFdContainer>` is implemented for anything implementing `IntoRawFd`,
so passing `OwnedFd` works.

Fixes https://github.com/rust-windowing/softbuffer/issues/168. Should be
backported to 0.3.x.
2023-10-31 07:09:50 -07:00
Liam Murphy
2eef592745
docs: Fix missing paragraph break in the docs for Buffer 2023-10-29 07:54:05 -07:00
John Nunley
0bcd2e22a2
breaking: Use raw-window-handle version 0.6
Signed-off-by: John Nunley <dev@notgull.net>
Co-Authored-By: dAxpeDDa <daxpedda@gmail.com>
2023-10-26 19:15:51 -07:00
John Nunley
18c944736e
v0.3.2
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-21 08:04:59 -07:00
John Nunley
c0e8723081
x11: Use POSIX shared memory in X11 backend
The X11 backend used System-V shared memory to communicate shared
buffers to the server, but rustix does not support SysV SHM so we had to
use libc in this backend. However, there is an alternate X11 API which
uses POSIX shared memory, which rustix does support. This PR switches
the X11 backend to POSIX shared memory and purges the previous
usages of libc.

The goal is to remove libc totally. Therefore this PR also removes the
default libc dependency from rustix.

Signed-off-by: John Nunley <dev@notgull.net>
2023-10-17 19:15:15 -07:00
Ian Douglas Scott
a405e0341d
Merge pull request #164 from rust-windowing/rustix
Use `rustix`/`libc` instead of `nix`
2023-10-13 17:20:45 -07:00
Ian Douglas Scott
d0d3881099 Use rustix/libc instead of nix
Partly addresses
https://github.com/rust-windowing/softbuffer/issues/147, though it would
still be desirable to have a good safe API for SYSV shm in Rustix. But
using `libc` directly for now is no worse than using the `nix::libc`
re-export, so we don't lose anything.
2023-10-13 15:54:32 -07:00
Ian Douglas Scott
ea81ff2078
Merge pull request #163 from rust-windowing/update-deps
Update `drm`, `nix`, and `criterion` dependencies
2023-10-13 13:54:00 -07:00
Ian Douglas Scott
e667df2da6 Update drm and nix dependencies 2023-10-13 08:42:30 -07:00
Benoît Cortier
9736fe9e37
docs: present_with_damage is supported on web platform 2023-10-13 08:32:21 -07:00
dependabot[bot]
888a9963ad
build(deps): update memmap2 requirement from 0.7.1 to 0.9.0
Updates the requirements on [memmap2](https://github.com/RazrFalcon/memmap2-rs) to permit the latest version.
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.7.1...v0.9.0)

---
updated-dependencies:
- dependency-name: memmap2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-12 05:45:23 -07:00
dependabot[bot]
979812f4bc
build(deps): update redox_syscall requirement from 0.3 to 0.4
Updates the requirements on redox_syscall to permit the latest version.

---
updated-dependencies:
- dependency-name: redox_syscall
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-14 18:07:18 -07:00
dependabot[bot]
f47f92a1f0
build(deps): bump hecrj/setup-rust-action from 1 to 2
Bumps [hecrj/setup-rust-action](https://github.com/hecrj/setup-rust-action) from 1 to 2.
- [Release notes](https://github.com/hecrj/setup-rust-action/releases)
- [Commits](https://github.com/hecrj/setup-rust-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: hecrj/setup-rust-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-10 21:47:32 -07:00
dependabot[bot]
f244cb56b9
build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-10 21:25:16 -07:00
Ian Douglas Scott
36618b63eb
Merge pull request #149 from rust-windowing/update-wayland
wayland: Update to wayland-client 0.31
2023-09-09 16:42:57 -07:00
Ian Douglas Scott
fff761cbd2
Merge pull request #141 from rust-windowing/release-0.3.1
v0.3.1
2023-09-09 16:40:30 -07:00
Ian Douglas Scott
e145d47cf8 v0.3.1
Softbuffer is broken on recent builds of Redox without the fix here, so
it's helpful to have a new release that fixes it. We seem to have
accumulated a few non-breaking fixes, so it seems like a good enough
time to do a release anyway.

Disabling `fetch` on Windows could be considered breaking, but it
doesn't change the API, was broken anyway, and is likely unused. So I
don't think that's an issue.
2023-09-09 16:30:55 -07:00
John Nunley
1b2aaa2e16
ci: Temporarily disable Windows GNU CI
They are currently failing due to what we believe is a bug in the
Windows bindings for Rust. For now, disable these until this bug is
resolved.

Closes #142

Signed-off-by: John Nunley <dev@notgull.net>
2023-09-09 13:40:39 -07:00
Benoît Cortier
908408ba80
fix(web): optimize and fix present_with_damage (#150)
Co-authored-by: daxpedda <daxpedda@gmail.com>
2023-09-09 17:30:38 +02:00
Ian Douglas Scott
a9d7e159e0 wayland: Update to wayland-client 0.31
Updates `rust-version` from 1.64 to 1.65.
2023-09-07 19:12:01 -07:00
Simon Hausmann
9b44f2eaea
bugfix: Fix length of returned buffer on x11 when using the wire-transferred buffer
total_len() computes the number of bytes, while the wire Vec holds u32.
2023-09-06 08:05:17 -07:00
Mads Marquart
53ae12a637
Merge pull request #143 from rust-windowing/update-macos-deps
Update macOS dependencies
2023-08-29 23:24:28 +02:00
Mads Marquart
bac64da8b8 Update macOS dependencies 2023-08-29 08:57:45 +02:00
Mads Marquart
c5401a3ec2
Merge pull request #128 from rust-windowing/dependabot/cargo/cocoa-0.25.0
Update cocoa requirement from 0.24.0 to 0.25.0
2023-08-29 08:51:42 +02:00
Jeremy Soller
2e926b37e9
Merge pull request #140 from rust-windowing/redox-map-shared
orbital: Use `syscall::MAP_SHARED` for mapping
2023-08-16 20:24:44 -06:00
Ian Douglas Scott
1770b331bf orbital: Use syscall::MAP_SHARED for mapping
This seems to be required to work correctly since
https://gitlab.redox-os.org/redox-os/orbital/-/merge_requests/51.

Orbclient had a similar change:
9097e71c9a.
2023-08-16 18:59:40 -07:00
John Nunley
ac0b7f5e14
feat: Add a DRM/KMS backend
This adds a DRM/KMS based backend to the system, as per #42. This system finds a CRTC and a connector, then uses that to create a frame buffer and a DUMB buffer that it can render to.

There's much more to do, and is left as an exercise for anyone with a significant DRM-based use case to pick up and fix.

Signed-off-by: John Nunley <dev@notgull.net>
2023-08-12 13:39:13 -07:00
John Nunley
2689cec2ca
bugfix: Mark fetch as unsupported on Windows for now
This fetch function has been broken and is probably unsound. This also
fixes the flakey Windows CI that we've been dealing with.

Signed-off-by: John Nunley <dev@notgull.net>
2023-08-10 19:28:04 -07:00
Ian Douglas Scott
5463e8741e
Merge pull request #137 from rust-windowing/cg-size
cg: Require non-zero width/height; panic instead of segfault
2023-07-24 19:46:59 -07:00
Ian Douglas Scott
e10c360929 cg: Require non-zero width/height; panic instead of segfault
Fixes https://github.com/rust-windowing/softbuffer/issues/124.
2023-07-24 18:24:23 -07:00
Fenhl
1f326b2199
bugfix: Reintroduce Error trait impl for SoftBufferError 2023-07-12 18:43:49 -07:00
John Nunley
abb7a4e9ac
version: Use fastrand v2.0.0 2023-07-03 07:59:34 -07:00
dependabot[bot]
4a1e18daf9
m: Update memmap2 requirement from 0.6.1 to 0.7.1
Updates the requirements on [memmap2](https://github.com/RazrFalcon/memmap2-rs) to permit the latest version.
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.6.1...v0.7.1)

---
updated-dependencies:
- dependency-name: memmap2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-02 15:19:49 -07:00
John Nunley
3404953bdb
m: Use tiny-xlib instead of x11-dl
My new tiny-xlib crate takes up a fraction of the space that the x11-dl crate uses, supports
feature-based static linking and involves less of Xlib's ridiculous surface.
2023-07-02 15:08:01 -07:00
dependabot[bot]
b5c14abf75
Update cocoa requirement from 0.24.0 to 0.25.0
Updates the requirements on [cocoa](https://github.com/servo/core-foundation-rs) to permit the latest version.
- [Commits](https://github.com/servo/core-foundation-rs/commits)

---
updated-dependencies:
- dependency-name: cocoa
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-26 05:09:01 +00:00
dAxpeDDa
6c78268502 Implement OffscreenCanvas support 2023-06-05 01:39:28 +02:00
John Nunley
68ec5a52d3
v0.3.0
* On MacOS, the contents scale is updated when set_buffer() is called, to adapt when the window is on a new screen (#68).
* **Breaking:** Split the `GraphicsContext` type into `Context` and `Surface` (#64).
* On Web, cache the document in the `Context` type (#66).
* **Breaking:** Introduce a new "owned buffer" for no-copy presentation (#65).
* Enable support for multi-threaded WASM (#77).
* Fix buffer resizing on X11 (#69).
* Add a set of functions for handling buffer damage (#99).
* Add a `fetch()` function for getting the window contents (#104).
* Bump MSRV to 1.64 (#81).
2023-06-04 16:10:35 -07:00
John Nunley
7b089d46b2
Remove the thiserror dependency (#116) 2023-06-03 07:08:35 -07:00
Ian Douglas Scott
efdfb529ef
Merge pull request #99 from rust-windowing/damage
Add `Buffer::present_with_damage()` and `Buffer::age()`
2023-06-02 20:15:14 -07:00
Ian Douglas Scott
1e7b9213d2 Merge remote-tracking branch 'origin/master' into damage 2023-06-02 15:03:10 -07:00
dAxpeDDa
6be186b47c Reference correct branch name in CI 2023-06-02 11:18:10 +02:00