Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/QtTrayMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ QtTrayMenu::QtTrayMenu(QObject *parent, const bool debug):

QtTrayMenu::QtTrayMenu(int argc, char **argv, QObject *parent, const bool debug):
QObject(parent) {
if (qgetenv("WAYLAND_DISPLAY").isEmpty() && qgetenv("DISPLAY").isEmpty()) {
// Force fallback to QT platform minimal if no (WAYLAND_)DISPLAY was found
qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("minimal"));
qWarning("QtTrayMenu: no reachable WAYLAND_DISPLAY or DISPLAY endpoint, forcing QT_QPA_PLATFORM=minimal");
}
if (QApplication::instance()) {
app = dynamic_cast<QApplication *>(QApplication::instance());
if (!app) {
Expand Down
6 changes: 6 additions & 0 deletions src/tray_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ extern "C" {

int tray_init(struct tray *tray) {
if (tray_linux::qt_tray_menu == nullptr) {
// Check if a (wayland_)display is set or fallback to minimal QPA platform
if (qgetenv("WAYLAND_DISPLAY").isEmpty() && qgetenv("DISPLAY").isEmpty()) {
// Force fallback to QT platform minimal if no (WAYLAND_)DISPLAY was found
qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("minimal"));
qWarning("QtTrayMenu: no reachable WAYLAND_DISPLAY or DISPLAY endpoint, forcing QT_QPA_PLATFORM=minimal");
}
// Create a new unique pointer to QtTrayMenu instance
tray_linux::qt_tray_menu = std::make_unique<QtTrayMenu>();
}
Expand Down
Loading