Skip to content

Conversation

@eaburns
Copy link
Contributor

@eaburns eaburns commented Feb 5, 2025

No description provided.

@lneely
Copy link

lneely commented Apr 4, 2025

I have been using this fork for awhile now, and it works quite well. Recommend merging. 👍

@tusharhero
Copy link

tusharhero commented Apr 9, 2025

Works for me. But it checks for $DISPLAY instead of $WAYLAND_DISPLAY,

DISPLAY=$WAYLAND_DISPLAY 9 acme

Fixes it, but perhaps you can make it look for $WAYLAND_DISPLAY directly.

@lneely
Copy link

lneely commented Apr 11, 2025

I noticed something as well, and it's a super minor nitpick. When I tried to build on Nix, my first thought was to set WSYSTYPE directly in LOCAL.config. When I did this, fontsrv tried to build wayland.o but did not have a rule for it. The workaround was to set XDG_SESSION_TYPE=wayland instead (devdraw rules updated, but fontsrv left alone) but I think that WSYSTYPE should be directly modifiable to adjust the build target. Will probably prepare a patch.

@JLanzuisi
Copy link

JLanzuisi commented Apr 14, 2025

I've also been testing this fork, great work!

I've encountered a bug I can't put my finger on: alt-tabbing to a different window and then alt-tabbing back adds spurious characters. I've attached a quick screencast showing the issue.

Screencast.From.2025-04-14.10-58-32.mp4

This is on wayland on gnome 47.

@erentar
Copy link
Contributor

erentar commented May 30, 2025

Thank you! I can finally use acme!

@eaburns eaburns force-pushed the wayland branch 2 times, most recently from d9caddc to 334464e Compare July 20, 2025 18:19
eaburns and others added 17 commits November 25, 2025 17:01
I tried running the wayland devdraw implementation on Sway 1.10,
wlroots 0.18 and encountered the error:

	xdg_surface#13: error 3: xdg_surface has never been configured

According to https://wayland.app/protocols/xdg-shell#xdg_surface ,
a client must commit a surface without a buffer, *wait* for the first
configure request from the compositor, ack it, and *only then* can
it proceed to attach a buffer to the surface and tell wayland to display it.

This was caused by the following sequence of events:

1. devdraw starts, enters gfx_main
2. `gfx_main` calls `gfx_started`, which spawns the `serveproc` thread
3. `gfx_main` enters `wl_display_dispatch`, flushing any buffered requests to
   the compositor, and enters `wl_display_poll()` to wait for incoming messages
4. `serveproc` calls `rpc_attach`, sets up the surface, and buffers a commit.

The race is between #3 and #4. If #3 happens first, the buffered commit
just sits there until `rpc_flush` is called, which calls `wl_display_flush()`,
but at that point a buffer is attached too quickly for the configure to happen.

This commit fixes the race by adding a `configured` field to the WaylandClient
and using it to guard `rpc_flush`.

In addition, I found that mouse warping, at least in sway, would move
the cursor but future mouse presses would register at the old location
until I moved the mouse. So I added a call to gfx_mousetrack to the end
of `rpc_setmouse`.
I found sway 1.10 and wlroots 0.18.2 will occasionally generate
wl_keyboard::keymap events with an empty keymap. I do not have
a reliable reproduction for this, but it seems to occur when
switching back and forth between workspaces with the keyboard.

This also fixes the issue where devdraw can go into a busy loop if
the compositor goes away and wl_display_dispatch() returns -1.
This change splits scroll repeat and key repeat into separate
callbacks, and only registers them when a key is pressed or
scrolling is active, respectively. The key repeat logic is
changed to support key repetitions higher than the frame rate.

The new logic will also accomodate key repeat parameters set by
the compositor, although the comment about us not receiving that
configuration event is still valid.
Upgrade to version 4 of the wl_seat interface which adds the
wl_keyboard::repeat_info event allowing the compositor to configure
key repeat delay and rate.
The alt key begins a compose. When using alt+click, compose was not previously cancelled and the next two typed characters would often end up composed.
This is OK with the touch pad, but it's actually not great with a real mouse scroll wheel, because the scrolling becomes inconsistent and hard to predict exactly how much the screen will scroll. Better to just remove it.
It was not transparent, but drawn over a white square.
There has been some funny locking/stalling behavior that seems to be related to using alt+click as a simulated middle-click. It may have started after this gfx_abortcompose call was added. According to devdraw.h, the gfx_ routines should not be called with a lock held. Now I'm not sure this fixes the weird behavior I've seen, but can't hurt to still fix this buggy call.
For whatever reason when offering only text/plain, the snarf can't paste into Firefox. Offering also UTF8_STRING seems to fix it.
This indicates window focus change. Without this, focus change caused by alt-key combinations (ctrl+alt+arrow on many Linux configurations will switch virtual desktops) may incorrectly be interpreted as a key-compose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants