Skip to content

[Mac] StyledText: backspaces deletes too much while IME is active #2412

Open

Description

@tmssngr

Describe the bug
A Korean user of our SWT-based application reports following problem. When typing Korean characters, pressing backspace will delete two characters instead of the last entered one.

To Reproduce
Please launch this simple snippet

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class StyledTextTest {

    public static void main(String[] args) {
        final Display display = new Display();

        final Shell shell = new Shell(display);
        shell.setLayout(new FillLayout());

        new StyledText(shell, SWT.BORDER);

        shell.setSize(400, 300);
        shell.open();

        while (!shell.isDisposed()) {
            if (!display.readAndDispatch()) {
                display.sleep();
            }
        }

        display.dispose();
    }
}

on MacOS and select the "2-Set Korean" keyboard layout (there are different Korean keyboard layouts, I've only tried this one). Now type (assuming you are using a US keyboard) the characters h e l l o. This will produce following output (mind the last, blue underlined character):
Image

Now press backspace and it will not just remove the underlined character, but also the previous one:

Image

Expected behavior
I would think, if there is a character in composition, pressing backspace should just abort the composition.

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS
  1. Additional OS info (e.g. OS version, Linux Desktop, etc)
    Tried on MacOS 14.7.3.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    macOShappens on macOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions