The chat window should receive focus automatically

Bug #795457 reported by Hans Joachim Desserud on 2011-06-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Hans Joachim Desserud

Bug Description

A while back I noticed the chat/debug window had different behaviour depending on how it was opened. Currently this happens:
Click chat button: need to click in the textfield for it to receive focus, remains open after sending a message.
Press enter: textfield focused automatically, closes after sending a message.
Press f6 (debug): textfield focused automatically, remains open after sending a message.

I found it confusing that these similar actions had different results, so I looked into how to change it. I have attached a branch where I have moved the code for focus into the constructor so that it is always called. With automatic focus, it was possible to remove some lines in other places which would tell the chat window to do this. This was my main goal, so that the window will always be focused when it is opened so that people can start typing right away.

However, during this I discovered that enter was handled in different ways as well when a message had been typed. At the same time I decided to give the textfield focus by default, I also settled on keeping the window open after sending a message. However, I do wonder if it was intentional to have different behaviour for the chat button and enter key, or if I'm overthinking things. When clicking the chat button the player would be able to type several messages and the window is left open for chatting with other players, but the enter key could be useful for quick messages. For instance <enter>Help. Under attack<enter> which would quickly open the chat window, the player writes the message, sends it and the window closes, leaving the player to continue doing other things in the game. If this behaviour is intentional, the last commit could be left out, so that chat windows opened by enter would close after sending a message.

Related branches

Hans Joachim Desserud (hjd) wrote :

Oh, I forgot to mention, but I discovered this issue when I was looking at bug 565406 to figure out how focus was given to the textfields.

Changed in widelands:
status: New → In Progress
assignee: nobody → Hans Joachim Desserud (hjd)
Nasenbaer (nasenbaer) wrote :

branch merged and therefor fix committed in rev. 5923

Changed in widelands:
status: In Progress → Fix Committed
SirVer (sirver) wrote :

Released in build17-rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers