Crystal icon indicating copy to clipboard operation
Crystal copied to clipboard

#1078 TextBox masking in window mode.

Open daneo1989 opened this issue 2 months ago • 5 comments

  • UpdateTextBoxHostLocation now centralizes where the WinForms input control lives. In fullscreen it sits where it always was; in windowed mode it’s moved to HiddenTextBoxLocation so it never paints over Mir UIs.
  • Mouse input paths (OnMouseDown/Move/Up/DoubleClick/Wheel) detect when the control is hidden and replay the corresponding Windows messages via SendMessage, using CMain.MPoint to compute the caret position. Keyboard input still flows through the real TextBox, so all selection/editing behavior is preserved without rewriting it manually.
  • Texture creation is still triggered everywhere (windowed + fullscreen), so the Mir-themed mask/caret drawn from TextBox.DrawToBitmap now matches in both modes. 2image 1image 123 123

@Suprcode not sure whether this is the correct direction which AI provided.

daneo1989 avatar Dec 06 '25 17:12 daneo1989

Your screenshot just shows a blank textbox, does it actually perform correctly with the same text box display and carat etc?

Suprcode avatar Dec 06 '25 23:12 Suprcode

Screenshot 1 = Full Screen, no text box overlay issues. Screenshot 2 = Window mode, text box overlay issues. Screenshot 3 = Window mode, no text box overlay issue.

I did find that the client would freeze, then close. I have done further testing and no longer freezes/client closing. I would like someone else to apply this and test for confirmation.

daneo1989 avatar Dec 07 '25 18:12 daneo1989

Your screenshot doesn't show any text in the text boxes, or active carats.

Show screenshots of the textbox in edit mode with a full page of text, and another of the chat bar with actife carat

Suprcode avatar Dec 07 '25 20:12 Suprcode

Untitled Window mode, Another dialog covering GameShop search box. 1Untitled Window mode, Inventory dialog covering Guild notice page.

If someone else can please test, and confirm would be greatful

daneo1989 avatar Dec 09 '25 10:12 daneo1989

https://github.com/Suprcode/Crystal/blob/627e11f4f083e27a206b2953a1c9e103d823cb1d/Client/MirNetwork/Network.cs#L41

I noticed another issue with textbox: in some scenarios client tries to update gui from network thread, which is not a good idea, and runtime will raise an exception by default. this happens for all mir controls with an embedded winform control.

ref: https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls/how-to-make-thread-safe-calls

shellohunter avatar Dec 10 '25 00:12 shellohunter