Click-through problem on EditorWindow with sub-windows over ObjectField

I have an editor window which can spawn child windows inside it. Whenever a child window is open, I disable the GUI for all controls in the main window so clicks register on the window in front. This works for almost all controls, however even with GUI.enabled = false, an EditorGUILayout.ObjectField with a Texture2D type (an image field) ALWAYS receives a click even when disabled. When clicked, it highlights the texture in the Project which is assigned to that ObjectField. As you can imagine, this means my windows in front don’t work correctly because you’ll be trying to click on a control and the click will fall through to the ObjectField instead. Does anyone know a solution to this problem?

UnityGUI has many known bugs, some of them related to event propagation (see this post).

So you should re-consider using multiple windows or using windows at all (you could construct your own window out of the header button plus the content area, it’s not so complicated).

Thanks for your help! I was afraid it wasn’t going to be straightforward. I’m on the verge of releasing my tool so I don’t want to go back and rewire the GUI stuff right now, so I just decided to not draw the object fields when a window is open. It works well enough for my specific case, so… Someday I will get around to trying one of the 3rd party GUI systems (like yours) and find out what I’ve been missing.