Commit graph

215 commits

Author SHA1 Message Date
Jeremy Soller
c2b2c19ddb
Merge pull request #2 from willnode/cosmic-orbital
Pass damage area to orbital window sync
2026-04-18 12:05:04 -06:00
Wildan M
ae0f2e3e3f
Pass damage area to orbital window sync 2026-04-16 02:44:45 +07:00
Jeremy Soller
a3f77e251e
Update redox-syscall to 0.5 2025-09-07 19:06:15 -06:00
Jeremy Soller
6e75b1ad7e On Orbital, fix window resize. 2024-02-09 21:06:42 -07:00
Ashley Wulber
0bb8598935
Argb8888 2024-02-01 21:36:44 -05:00
John Nunley
e435fc99bc
ci: Set up an autorelease pipeline
This commit adds a pipeline that automatically creates a GitHub Release
and a crates.io release when a tag is pushed.

Signed-off-by: John Nunley <dev@notgull.net>
2024-01-28 12:51:01 -08:00
John Nunley
34d52bd350
Fix MSRV CI issue by pinning half to v2.2.1 (#198)
This commit fixes the MSRV CI failure by pinning the half crate to
version 2.2.1 when MSRV CI is active.

Signed-off-by: John Nunley <dev@notgull.net>
2024-01-28 12:29:54 -08:00
John Nunley
832064c012
feat: Add ability to get underlying window handle
Adds the `get_ref` and `get_mut` functions, which can be used to get
references (mutable or otherwise) to the underlying window handle.

cc https://github.com/rust-windowing/raw-window-handle/issues/158#issuecomment-1881376603

Signed-off-by: John Nunley <dev@notgull.net>
2024-01-12 08:40:02 -08:00
Ian Douglas Scott
03c6f8dca1
Merge pull request #194 from rust-windowing/release-0.4.1
v0.4.1
2024-01-10 17:54:42 -08:00
Ian Douglas Scott
356eeeebf5 v0.4.1 2024-01-10 17:25:30 -08:00
Ian Douglas Scott
2b1bb980d2
Merge pull request #191 from rust-windowing/wayland-buffer-age-fix
wayland: Fix buffer age
2024-01-09 17:41:54 -08:00
Ian Douglas Scott
d26ae5b895 wayland: Fix buffer age
We need to reset the age of the *new* front buffer to 1, not the old
one.

It turns out they're easy to mix up right when you're about to swap
them.
2024-01-09 03:28:08 -08:00
dependabot[bot]
ef49741254
build(deps): update cfg_aliases requirement from 0.1.1 to 0.2.0
Updates the requirements on [cfg_aliases](https://github.com/katharostech/cfg_aliases) to permit the latest version.
- [Release notes](https://github.com/katharostech/cfg_aliases/releases)
- [Changelog](https://github.com/katharostech/cfg_aliases/blob/master/release.toml)
- [Commits](https://github.com/katharostech/cfg_aliases/compare/v0.1.1...v0.2.0)

---
updated-dependencies:
- dependency-name: cfg_aliases
  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-12-24 21:21:17 -08:00
daxpedda
4e8735c6bd
Web: add support for more RawWindowHandle variants (#188) 2023-12-17 23:48:58 +01:00
Benoît Cortier
211db6fc6e
docs(web): fix reference to OffscreenCanvas (#187) 2023-12-15 11:42:31 +01:00
Uli Schlachter
09b8126909
x11: Check visuals for validity
A visual describes how colors are laid out by the X11 server. So far,
softbuffer did not do anything with visuals and just passed them around.
This commit adds checks that should ensure that a given visual actually
lays out pixels in the only format supported by softbuffer:

- 32 bit per pixel
- 00RRGGBB byte order

In this patch, I also try to handle big endian systems and mixed endian
situations where we are e.g. running on a big endian system and talking
to a little endian X11 server. However, this is all theoretical and
completely untested. I only tested my X11 server's default visual works
and some ARGB visual is rejected.

Fixes: https://github.com/rust-windowing/softbuffer/issues/184
Signed-off-by: Uli Schlachter <psychon@znc.in>
Co-authored-by: John Nunley <dev@notgull.net>
2023-12-10 21:54:10 -08:00
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