Forward Tab/Shift+Tab to remote sessions instead of local focus navigation

QWidget's default handling intercepts Tab/Shift+Tab for focus-chain
navigation before they ever reach keyPressEvent(), so pressing Tab in an
RDP session moved focus to the OrbitHub UI (e.g. the Show Events button)
instead of reaching the remote machine. KodoTerm (SSH) already overrides
focusNextPrevChild() to opt out of this; RdpDisplayWidget and TerminalView
did not. Both already handle Key_Tab in their own keyPressEvent, so this
is enough to let it reach them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-08 08:50:01 -06:00
co-authored by Claude Sonnet 5
parent f3ea7f12a3
commit fce69b8be9
4 changed files with 18 additions and 0 deletions
+8
View File
@@ -173,6 +173,14 @@ void RdpDisplayWidget::keyReleaseEvent(QKeyEvent* event)
event->accept(); event->accept();
} }
bool RdpDisplayWidget::focusNextPrevChild(bool next)
{
Q_UNUSED(next);
// Tab/Shift+Tab must reach keyPressEvent() and be forwarded to the
// remote session instead of moving focus to the next local widget.
return false;
}
void RdpDisplayWidget::mousePressEvent(QMouseEvent* event) void RdpDisplayWidget::mousePressEvent(QMouseEvent* event)
{ {
if (event == nullptr) { if (event == nullptr) {
+1
View File
@@ -40,6 +40,7 @@ protected:
void mouseReleaseEvent(QMouseEvent* event) override; void mouseReleaseEvent(QMouseEvent* event) override;
void mouseMoveEvent(QMouseEvent* event) override; void mouseMoveEvent(QMouseEvent* event) override;
void wheelEvent(QWheelEvent* event) override; void wheelEvent(QWheelEvent* event) override;
bool focusNextPrevChild(bool next) override;
private: private:
enum class CursorMode { enum class CursorMode {
+8
View File
@@ -219,6 +219,14 @@ void TerminalView::focusInEvent(QFocusEvent* event)
moveCursor(QTextCursor::End); moveCursor(QTextCursor::End);
} }
bool TerminalView::focusNextPrevChild(bool next)
{
Q_UNUSED(next);
// Tab/Shift+Tab must reach keyPressEvent() and be forwarded to the
// remote session instead of moving focus to the next local widget.
return false;
}
void TerminalView::resizeEvent(QResizeEvent* event) void TerminalView::resizeEvent(QResizeEvent* event)
{ {
QTextEdit::resizeEvent(event); QTextEdit::resizeEvent(event);
+1
View File
@@ -29,6 +29,7 @@ protected:
void keyPressEvent(QKeyEvent* event) override; void keyPressEvent(QKeyEvent* event) override;
void focusInEvent(QFocusEvent* event) override; void focusInEvent(QFocusEvent* event) override;
void resizeEvent(QResizeEvent* event) override; void resizeEvent(QResizeEvent* event) override;
bool focusNextPrevChild(bool next) override;
private: private:
struct ThemePalette { struct ThemePalette {