Commit graph

34 commits

Author SHA1 Message Date
En-En
62bafcc3c9
Add command-line options (#342)
* feat: forward requested command-line options

The CLI now forwards the `-ac`, `-audit`, `-auth`, `-core`,
`+extension`, `-extension`, `-glamor`, `-listen`, `-nolisten`, and `-verbose` flags
to `Xwayland`. In addition, command-line flags no longer require the
display to be the first parameter. Also the `-help` and `-version` flags
were added, which print the relevant message and return 0.

The match case structure should make it easier to add new arguments if
people have use for them. For example, I chose not to add the `-ld`,
`-lm`, and `-ls` flags since they are dependent on `Xwayland`'s
compile-time flags.
2026-01-24 13:26:00 -05:00
Shawn Wallace
64c70be855 cargo fmt 2026-01-18 14:46:11 -05:00
En-En
1ec45141e6 feat: send huge Wayland-to-X selections via INCR
Since the connection handshake establishes the most data a request can
send, if the data length exceeds that limit, we can follow ICCCM 2.7.2
sending the INCR property and continuing to send data via PropertyNotify
events.

To test the changes, we create `XState::set_max_req_bytes` to forcefully
trigger the INCR mechanism in integration test runs with a constant,
substantially less amount of data.
2025-10-24 18:40:12 -04:00
En-En
bf745144ac fix: bump xcb-util-cursor to 0.3.5
xcb-util-cursor made another patch release to revert back to Rust 2021
edition, so we bump to that.

Also create a function, `timespec_from_millis` to make creating
`Timespec` for using in `poll` calls a lot more ergonomic.
2025-10-22 18:47:03 -04:00
En-En
e827c42d2d deps: bump rustix to version 1 2025-10-22 18:47:03 -04:00
En-En
d759c64681 dep: bump xcb to 1.6.0
switch from the deprecated API we found unsoundness in to the one introduced in 1.6.0
2025-08-23 11:39:05 -04:00
Shawn Wallace
5a184d4359 Support primary selection
This was more tedious than expected.
Fixes #103
2025-08-14 20:59:01 -04:00
En-En
cbabd591a3 server: impl Deref(Mut) for ServerState to Inner coercion 2025-08-06 22:32:00 -04:00
En-En
fe28bcb880 fix(test): stabilize integration tests 2025-08-06 22:32:00 -04:00
En-En
be9d573fd6 server: make state's client and connection mandatory
The goal of the previous commits being to remove these unwraps. The `unwrap_or_skip_bad_window` changes needed to make a singular debug conditional
2025-08-06 22:32:00 -04:00
En-En
4280639df8 server: give uninitialized and initialized xstate with unique types 2025-08-06 22:32:00 -04:00
En-En
56d5cce2d0 server: split XConnection from rest of State refactor 2025-08-06 22:32:00 -04:00
Shawn Wallace
799027d1ae server: refactor to use ECS
This should simplify how some of the code reads, as well as allowing for future
feature additions to be accomplished in a less restrictive manner. The slotmap +
Object enum pattern was kind of like a really bad ecs in a way anyway. Also I
was looking for an excuse to use an ecs.
2025-06-19 00:55:08 -04:00
Ivan Molodetskikh
9e48795087 Accept -listenfd and pass on to Xwayland 2025-06-07 12:59:01 -04:00
Shawn Wallace
de6790934b Add git revision to log 2025-05-28 23:10:53 -04:00
Shawn Wallace
572fa4a2bf Add Xsettings support, for setting scaling related settings
This allows for most GTK and Qt apps to be scaled properly.
In the case of mixed DPI, it will default to using the smallest monitor scale.
2025-05-23 23:25:33 -04:00
Shawn Wallace
2b5288b4b9 Rename satellite socket name
Satellite is not a standard Wayland compositor, so there's no need
to name the socket as such.
2025-04-16 23:33:59 -04:00
Shawn Wallace
8188df0e70 Force buffers to be unscaled
Satellite will now force Xwayland to always render with the native
display resolution, and just scale surface sizes accordingly. As a result,
applications won't really respect DPI, but this can be adjusted through
the same means as with normal X11.

Part of #28.
2025-04-09 00:32:20 -04:00
bbb651
b34b08f004 Reorganize clientside to a single directory 2025-03-20 09:05:24 -04:00
En-En
f9ec97b007 Make Fixture::drop send a valid exit code ptr to the stream
Found a good way to avoid both an extra function to RunData and make calling `xwayland_exit_code` in other RunData types *less* prone to memory violations. Having a function with a non-empty default implementation being overridden by an empty implementation felt too awkward.
2025-03-15 20:09:40 -04:00
En-En
d4dcee4e8d Add error message if Xwayland dies out of tests & Refactors 2025-03-15 20:09:40 -04:00
En-En
eab4adc991 Fix most Broken Pipe IO aborts
Makes sure the xwayland_satellite main thread ends so that the file descriptors don't continue to be used after Fixture drops them
2025-03-13 20:00:13 -04:00
Shawn Wallace
f459c604f5 Make integration tests less flaky
- Send sigterm to Xwayland after the test has completed
- Before polling for a new event, try to just grab one from xcb

Fixes #118
2025-03-13 20:00:13 -04:00
Shawn Wallace
caf88fcb45 Force clippy for the whole workspace 2025-03-13 20:00:13 -04:00
Shawn Wallace
a33372f61d cargo clippy 2025-03-12 00:58:32 -04:00
Shawn Wallace
7df3daba70 Remove ExtraData type from XConnection trait
This was being used to pass the X11 atoms all over the place, but I
realize this is no longer necessary - we can just pass them directly to
our RealConnection when creating it.
2025-03-12 00:55:39 -04:00
Shawn Wallace
54a7ad9e13 server: Unmap popup on popup_done event
Seems some applications don't expect their popups to be unmapped without
their consent, so they make act strangely, but at least it doesn't
crash.
Fixes #117
2025-03-12 00:47:26 -04:00
Shawn Wallace
47e7357eab xstate: refactor clipboard selections
Before, every time the clipboard selection changed, satellite would copy
everything on it and force itself to be the clipboard owner, regardless
of X11 or Wayland. Now, satellite is only the owner when the clipboard
owner comes from Wayland, and uses the XFixes extension to watch for
changes in clipboard ownership X11 side. Satellite also now avoids
copying all of the clipboard contents into memory every time, instead
copying directly on request. This is a pretty big change, but should
hopefully help make the clipboard more stable.

Also added some misc test cleanup/using helper functions where possible.
Using the XFixes extension may also end up being necessary for
implementing drag and drop, so it's good the infrastructure is there
now.
2025-01-08 23:57:22 -05:00
Shawn Wallace
03a53b6ad7 Set primary output when window focused
Closes #80
2024-12-18 01:49:55 -05:00
Shawn Wallace
02f3054626 Log result of systemd notification 2024-11-21 19:01:50 -05:00
Michael Yang
d8bfa0a1a3 feat: add systemd notify with feature 2024-07-06 13:15:50 -04:00
Shawn Wallace
d8a9c28fa7 Fix hover when focus is different from hover window
Fixes #14
2024-06-30 02:45:31 -04:00
Shawn Wallace
5e7f2df05e Sync clipboard between X11 and Wayland
You would not believe how much work this was.
Closes #23
2024-06-06 22:41:19 -04:00
Shawn Wallace
c1fc38c3d2 Reorganize file layout
Moves satellite to be the root package, also allowing it to be built
by default.
2024-05-17 23:01:57 -04:00
Renamed from satellite/src/lib.rs (Browse further)