Skip to content

Commit 6c6a708

Browse files
committed
Changed QT_QPA_PLATFORM to a warning instead of an overwrite, also changed default order of plugins to offscreen then xcb, this has the effect of trying xcb first then offscreen it should just transparently do the right thing according to my testing
Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
1 parent 2fce8aa commit 6c6a708

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
108108
bazel_dep(name = "qt-bazel")
109109
git_override(
110110
module_name = "qt-bazel",
111-
commit = "cb23dbb95bf772b5cc1aabf58b1986c34ba35d74",
111+
commit = "75fcc653ef391612d64ca3071cd927c878f69f2e",
112112
remote = "https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts",
113113
)
114114

src/gui/src/gui.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,18 @@ int startGui(int& argc,
15421542
bool minimize)
15431543
{
15441544
#ifdef STATIC_QPA_PLUGIN_XCB
1545-
setenv("QT_QPA_PLATFORM", "xcb", /*__replace=*/true);
1545+
const char* qt_qpa_platform_env = getenv("QT_QPA_PLATFORM");
1546+
std::string qpa_platform
1547+
= qt_qpa_platform_env == nullptr ? "" : qt_qpa_platform_env;
1548+
if (qpa_platform != "") {
1549+
if (qpa_platform.find("xcb") == std::string::npos
1550+
&& qpa_platform.find("offscreen") == std::string::npos) {
1551+
// OpenROAD logger is not available yet, using cout.
1552+
std::cout << "Your system has set QT_QPA_PLATFORM='" << qpa_platform
1553+
<< "', openroad only supports 'offscreen' and 'xcb', please "
1554+
"include one of these plugins in your platform env\n";
1555+
}
1556+
}
15461557
#endif
15471558
auto gui = gui::Gui::get();
15481559
// ensure continue after close is false

0 commit comments

Comments
 (0)