From b9714a0914370b0ef9011d998a423b2628c93196 Mon Sep 17 00:00:00 2001 From: "Joakim L. Gilje" Date: Sun, 5 Dec 2021 20:51:59 +0100 Subject: [PATCH] PR #13 merged manually (EGLFS support by @Cacodemon345) --- src/qt/qt_mainwindow.cpp | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 3b1957c64..773be7cce 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -77,8 +77,10 @@ MainWindow::MainWindow(QWidget *parent) : }); connect(this, &MainWindow::resizeContents, this, [this](int w, int h) { - ui->stackedWidget->resize(w, h); - resize(w, h + menuBar()->height() + statusBar()->height()); + if (!QApplication::platformName().contains("eglfs")) { + ui->stackedWidget->resize(w, h); + resize(w, h + menuBar()->height() + statusBar()->height()); + } }); connect(ui->menubar, &QMenuBar::triggered, this, [] { @@ -629,6 +631,26 @@ std::array darwin_to_xt 0, }; +static std::unordered_map evdev_to_xt = + { + {96, 0x11C}, + {97, 0x11D}, + {98, 0x135}, + {99, 0x71}, + {100, 0x138}, + {101, 0x1C}, + {102, 0x147}, + {103, 0x148}, + {104, 0x149}, + {105, 0x14B}, + {106, 0x14D}, + {107, 0x14F}, + {108, 0x150}, + {109, 0x151}, + {110, 0x152}, + {111, 0x153} +}; + static std::array& selected_keycode = x11_to_xt_base; uint16_t x11_keycode_to_keysym(uint32_t keycode) @@ -641,6 +663,12 @@ uint16_t x11_keycode_to_keysym(uint32_t keycode) { selected_keycode = x11_to_xt_2; } + else if (QApplication::platformName().contains("eglfs")) + { + keycode -= 8; + if (keycode <= 88) return keycode; + else return evdev_to_xt[keycode]; + } else if (!x11display) { x11display = XOpenDisplay(nullptr); @@ -781,4 +809,4 @@ void MainWindow::focusInEvent(QFocusEvent* event) void MainWindow::focusOutEvent(QFocusEvent* event) { this->releaseKeyboard(); -} \ No newline at end of file +}