Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Support composition on Wayland (and x11) #119

Merged
merged 35 commits into from
Aug 12, 2023

Conversation

DJMcNab
Copy link
Member

@DJMcNab DJMcNab commented Jul 24, 2023

Work towards #118.

This is nearly complete - I need to make sure it interacts correctly with the normal IME and manual updates to the text field (e.g. mouse selections, etc.)

I've made a few potentially controversial decisions primarily around cancellation. See the big block of text in src/text.rs for some context.

To play around with this on GNOME, either use:

cargo run --example edit_text --no-default-features --features=x11

or apply

diff --git a/src/backend/wayland/input/mod.rs b/src/backend/wayland/input/mod.rs
index 51755a0..a6551f4 100644
--- a/src/backend/wayland/input/mod.rs
+++ b/src/backend/wayland/input/mod.rs
@@ -75,11 +75,12 @@ impl WaylandState {
         };
         let idx = self.input_states.len();
         self.input_states.push(new_info);
-        let input = &mut self.input_states[idx];
-        input.input_state = self
-            .text_input
-            .as_ref()
-            .map(|text_input| InputState::new(text_input, &input.seat, &self.wayland_queue, id));
+        if false {
+            let input = &mut self.input_states[idx];
+            input.input_state = self.text_input.as_ref().map(|text_input| {
+                InputState::new(text_input, &input.seat, &self.wayland_queue, id)
+            });
+        }
     }
 
     pub(super) fn initial_seats(&mut self) {

It should just work on KDE, as KDE doesn't use IME for compose.

src/backend/wayland/application.rs Outdated Show resolved Hide resolved
@DJMcNab DJMcNab marked this pull request as draft July 27, 2023 13:57
@DJMcNab
Copy link
Member Author

DJMcNab commented Jul 27, 2023

I've moved this to a draft, because I need to reconsider our interactions with the input lock

@nyabinary
Copy link

How the progress?

@DJMcNab DJMcNab marked this pull request as ready for review August 4, 2023 17:52
@DJMcNab
Copy link
Member Author

DJMcNab commented Aug 4, 2023

Needs testing and review, but if everything else is OK, we're ready to land.

Still need to fixup clippy and change the default features back to just x11, but otherwise it should work!

Cargo.toml Outdated Show resolved Hide resolved
Copy link
Collaborator

@jneem jneem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been a little while since I've tested this personally, but I'm happy to provide the rubber stamp.

@DJMcNab DJMcNab added this pull request to the merge queue Aug 12, 2023
Merged via the queue into linebender:main with commit e89fe93 Aug 12, 2023
7 checks passed
@DJMcNab DJMcNab deleted the wayland-board branch August 13, 2023 11:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants