For example, if X was crying because of Y's harsh words to her, but suddenly, and while Y was standing in front of X, X stopped crying and started staring at Y calmly but intensely. Then, Y would become cautious of what possibly has got in X's mind (of thoughts) to suddenly change her behavior.
I think the question would be in this particular structure though not exactly as I don't remember it clearly:
Y to herself: What has gotten in her mind?
her refers to X.
Is it the right question to ask in such situations? Since I think it is a specific question which is asked in those situations, and what I have stated is the right one, but I'm not sure if it expresses the situation precisely.
Note: It is not particular to the pronoun "her", but this is my case so that's why I used it.
P.S. My question has been probably misunderstood to be a request for suggestions to use for similar situations. What I'm actually asking for is a question in that particular structure, but not the one I have stated as it seems wrong.