single klick not working after misplaced line trace

Hello there

(u can skip to “The problem” if you are in a hurry)

What i know
In the past i had the problem that after a widget was open, new actions needed two klicks instead of one. i read, that this often happens because the Widget is despite invisible still in focus hence the first klick is to define focus and the second to do the intended action. i solved this with following code:

(For convenience this became its own function in Widget A)

(I had to set the boolean of “is store Visible” in Blueprint B. This code happens in Blueprint B.)

This solved the double klick issue


The Problem

I do a line trace on every klick, determine what is at the end, open the Widget if it is just plain floor or do something else if there is an object.

Every time the line trace hits the object, the double klick issue comes back and stays.
To be precise: the “EnhancedInputAction IA_mouseklick” does only trigger on a double klick.

(If the second FALSE hits, the bug occurs. This is in Blueprint B)

My total uneducated gues is: if klick on the actor, the focus shifts from the Blueprint B to the actor that was klicked on.

My Question

  1. what is “focus”? i did not find a useful explanation or documentation.
  2. how can i solve my problem?
  3. (why does my widget work again, altough i never “set input mode to UI and Game” after i once set it to “game”?)

(this is the actor that can be spawned and then causes the issue)

Thanks a lot