-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Wayland driver for devdraw #696
Open
eaburns
wants to merge
9
commits into
9fans:master
Choose a base branch
from
eaburns:wayland
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devdraw/wayland.c: prevent divide-by-zero in scroll repeat
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 9fans#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`.
Fix race condition on attach and mouse tracking after warp
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.
Fix unexpected devdraw crashes on sway
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.