Menu

#1662 Fix ScintillaGTK to properly work inside a tooltip

Bug
closed-fixed
5
2014-12-03
2014-10-11
No

Currently a Scintilla widget can't properly be added inside a tooltip under GTK2. Doing so results in bad things, visible as a missing tooltip upon each first trigger and a lot of various scary assertion error warnings.

This is because the wPreedit window and contents is created in the ::realize handler, and creating a widget may lead to a ::hierarchy-changed signal to be emitted. In case of a tooltip, it may lead that tooltip's window to be unrealized. This is problematic because it can lead to the ::unrealize handler to be called during the ::realize handler, breaking most of the logic there assuming the widget was properly realized.

Attached patch fixes this by creating the wPreedit window and contents in ScintillaGTK::Initialize() like the rest of the widgets.

Note that this problem doesn't seem to be relevant under GTK3, but the fixed version is just as good there.

Also, I believe the preedit window was never destroyed, so each ::realize signal would leak a window. I also fixed this by calling wPreedit.Destroy() in ~ScintillaGTK(), as now it's only created once.

1 Attachments

Discussion

  • Colomban Wendling

    BTW, please note that although I am completely confident this change won't affect the preedit window behavior in any way, I couldn't test preedit windows (honestly I wouldn't even know how to).

     
  • Neil Hodgson

    Neil Hodgson - 2014-10-13

    Committed as [ee1647]. Tried with the windowed Japanese IME on Fedora 19.

    Making IMEs work on Linux can be difficult and the only current distribution I have working properly is Fedora. On Fedora, the Region & Settings control panel is the place to start with Add an Input Source. Japanese is the choice that is most likely to be useful for testing as it displays a wider range of behaviours than Korean or Chinese. Once it is installed open a UTF-8 document, choose Japanese from the language menu of the shell, and try to type some Japanese words like "kata". SciTE (and Scintilla) now has both windowed and inline IME support so set ime.interaction=1 for the windowed method which will show wPreedit.

     

    Related

    Commit: [ee1647]

  • Neil Hodgson

    Neil Hodgson - 2014-10-13
    • labels: scintilla, gtk, gtk2 --> scintilla, gtk, gtk2, ime
    • status: open --> open-fixed
    • assigned_to: Neil Hodgson
     
  • Neil Hodgson

    Neil Hodgson - 2014-12-03
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB