Skip to content

Commit 8eade99

Browse files
authored
Merge pull request #10694 from The-OpenROAD-Project-staging/fix-10576-headless-gui-null-deref
fix(gui): resolve headless mode coredumps and prevent future crashes
2 parents 8e4edde + b805223 commit 8eade99

2 files changed

Lines changed: 243 additions & 14 deletions

File tree

src/gui/include/gui/gui.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,28 @@ class HeadlessViewer
741741
// True while pause() is blocking. Consumers (like the web tile renderer)
742742
// can use this to gate unsafe cross-thread reads of renderer state.
743743
virtual bool isPaused() const = 0;
744+
745+
// Display-control accessors consulted by Gui::*DisplayControls* when the Qt
746+
// GUI (and its DisplayControls widget) is absent. Default implementations
747+
// assume "everything visible, nothing selectable" so headless renderers draw
748+
// by default without a Qt widget. Viewers that track their own visibility
749+
// model (e.g. the web viewer) may override these.
750+
virtual bool checkDisplayControlVisible(const std::string& /* name */)
751+
{
752+
return true;
753+
}
754+
virtual bool checkDisplayControlSelectable(const std::string& /* name */)
755+
{
756+
return false;
757+
}
758+
virtual void setDisplayControlVisible(const std::string& /* name */,
759+
bool /* value */)
760+
{
761+
}
762+
virtual void setDisplayControlSelectable(const std::string& /* name */,
763+
bool /* value */)
764+
{
765+
}
744766
};
745767

746768
// This is the API for the rest of the program to interact with the

0 commit comments

Comments
 (0)