@@ -377,13 +377,13 @@ namespace melatonin
377
377
378
378
private:
379
379
juce::SharedResourcePointer<InspectorSettings> settings;
380
- melatonin:: InspectorLookAndFeel inspectorLookAndFeel;
381
- melatonin:: InspectorComponent inspectorComponent;
380
+ InspectorLookAndFeel inspectorLookAndFeel;
381
+ InspectorComponent inspectorComponent;
382
382
juce::Component::SafePointer<juce::Component> root;
383
383
bool inspectorEnabled = false ;
384
- melatonin:: Overlay overlay;
385
- melatonin:: FPSMeter fpsMeter;
386
- melatonin:: OverlayMouseListener overlayMouseListener;
384
+ Overlay overlay;
385
+ FPSMeter fpsMeter;
386
+ OverlayMouseListener overlayMouseListener;
387
387
InspectorKeyCommands keyListener { *this };
388
388
bool rootFollowsComponentUnderMouse = false ;
389
389
@@ -416,15 +416,15 @@ namespace melatonin
416
416
417
417
void globalFocusChanged (Component* focusedComponent) override
418
418
{
419
- // nullptr focus events fire when focus is lost
419
+ // ignore nullptr focus events, they are frequent and cause glitchiness
420
420
if (focusedComponent == nullptr )
421
421
return ;
422
422
423
- // we only want to respond to focus events related to the UI under inspection (root)
424
- // Unfortunately, we can't test to see if the focusedComponent is a child of root
425
- // because JUCE UI like list boxes or text editors sometimes technically have no parent :/
426
- if (focusedComponent != root && focusedComponent-> getTopLevelComponent () != inspectorComponent. getTopLevelComponent ())
427
- selectComponent (focusedComponent);
423
+ // This gets sent all components, even subcomponents of the inspector
424
+ // (which will result in the selection being cleared).
425
+ // I tried filtering those out for cleaner UX,
426
+ // but it caused glitchy incorrectness in focus selections
427
+ selectComponent (focusedComponent);
428
428
}
429
429
430
430
void timerCallback () override
0 commit comments