Skip to content

Commit e950d8d

Browse files
zortos293Wheezee
andauthored
Fix dynamic resizing and minimized queue lifecycle (#35)
* fix(deko3d): handle dynamic resolution resize (green border + touch compress) Mirrors Moonlight DKVideoRenderer::updateRenderState and GLVideoRenderer::checkAndUpdateScale. checkAndInitialize was frozen at first frame size (frame_width_/height), leaving stale luma_layout/chroma_layout/software_slots and transform.uv. On 1080p->720p drop, updateSoftwareFrame copied 1920x1080 from 1280x720 source, leaving bottom 360 rows uninitialized (green YUV) and video appears shrunk. Touch via TouchMapping used new stream_width while renderer kept old uv. Fix: add updateFrameLayouts(), recordStaticCommands(), updateRenderState() that detects frame/screen size or format change, queue.waitIdle(), clears frame_mappings/current_mapping, releases/reallocates software slots, rebuilds layouts and static commands. drawLatest now calls updateRenderState after checkAndInitialize. Tested: cmake -B build/switch -G Ninja:exit0, cmake --build --target SwitchNOW.nro:exit0 (27463736 bytes). * fix(ui): keep Switch awake while in GFN queue BeginLaunchSessionDialog polls every 5s for CloudMatch queue (status 0/1/6) but never called disableScreenDimming. Switch auto-sleep kicks queue. Mirrors StreamView onFocusGained disableScreenDimming(true). Enable dimming block after dialog open, clear on Cancel, on success close, and on error. StreamView re-enables on push. * fix(input): use negotiated desktop size for touch/mouse stream_width() follows the dynamic encode size (e.g. 1080p -> 720p) while GFN keeps the remote desktop at the negotiated resolution. Mapping touches to the dynamic size compresses input toward top-left. Add negotiated_stream_width/height() returning settings_.width/height and use it in StreamView touch, SendNteClick and ReanchorRemotePointer. Overlay still shows dynamic size. * feat(queue): minimized background queue with live restore Add Minimize button to launch dialog; queue keeps polling while browsing. Header queue chip (hidden idle, number-only in queue, tap to restore). Minus+Plus restores a light live dialog (position ticks every poll). Queue notify threshold setting 5/10/20/50 in Settings Interface. Local testing, not for upstream PR. * feat(keyboard): direct Bksp/Del/arrows bypassing applet diff Applet diff can't delete pre-existing remote text. Add tap-only Bksp/Del/Left/Right shortcut buttons sending strokes directly. Local testing. * Preserve software color range across renderer reconfiguration --------- Co-authored-by: Wheeze <mackenzierearcon@gmail.com>
1 parent 159c8f3 commit e950d8d

27 files changed

Lines changed: 1559 additions & 208 deletions

.github/workflows/host-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
sudo apt-get update -qq
2525
sudo apt-get install -y --no-install-recommends \
2626
g++ libjansson-dev libcurl4-openssl-dev libsrtp2-dev libusrsctp-dev \
27-
libavcodec-dev libavutil-dev libmbedtls-dev python3 openssl cmake
27+
libavcodec-dev libavutil-dev libmbedtls-dev python3 openssl cmake pkg-config
2828
2929
- name: Run host regression tests
3030
run: bash scripts/test-host.sh

app/src/StreamView.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@ void StreamView::draw(NVGcontext* vg, float x, float y, float width, float heigh
310310
}
311311

312312
if (touch_down) {
313-
const int stream_width = std::max(1, session_->stream_width());
314-
const int stream_height = std::max(1, session_->stream_height());
313+
const int stream_width = std::max(1, session_->negotiated_stream_width());
314+
const int stream_height = std::max(1, session_->negotiated_stream_height());
315315
const auto target = opennow::input::MapTouchToStream(
316316
touch_position.x, touch_position.y, x, y, width, height,
317317
stream_width, stream_height);

app/src/keyboard_input_policy.hpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ enum class KeyboardShortcut
2424
WindowsExplorer,
2525
WindowsRun,
2626
WindowsTaskView,
27+
Backspace,
28+
Delete,
29+
ArrowLeft,
30+
ArrowRight,
2731
};
2832

2933
struct KeyboardShortcutControl
@@ -44,6 +48,18 @@ inline constexpr std::array<KeyboardShortcutControl, 8> kKeyboardShortcutControl
4448
{KeyboardShortcut::WindowsTaskView, "Win + Tab", "MINUS + DOWN"},
4549
}};
4650

51+
inline constexpr auto kKeyboardTouchControls = [] {
52+
std::array<KeyboardShortcutControl, kKeyboardShortcutControls.size() + 4> controls {};
53+
std::size_t index = 0;
54+
for (const auto& control : kKeyboardShortcutControls)
55+
controls[index++] = control;
56+
controls[index++] = {KeyboardShortcut::Backspace, "Bksp", "TAP"};
57+
controls[index++] = {KeyboardShortcut::Delete, "Del", "TAP"};
58+
controls[index++] = {KeyboardShortcut::ArrowLeft, "Left", "TAP"};
59+
controls[index] = {KeyboardShortcut::ArrowRight, "Right", "TAP"};
60+
return controls;
61+
}();
62+
4763
inline int PollKeyboardShortcut(std::uint16_t buttons, bool& latched)
4864
{
4965
const bool was_latched = latched;
@@ -71,6 +87,10 @@ inline KeyboardStroke MapKeyboardShortcut(KeyboardShortcut shortcut)
7187
case KeyboardShortcut::WindowsExplorer: return {'E', 0x12, kMeta};
7288
case KeyboardShortcut::WindowsRun: return {'R', 0x13, kMeta};
7389
case KeyboardShortcut::WindowsTaskView: return {0x09, 0x0f, kMeta};
90+
case KeyboardShortcut::Backspace: return {0x08, 0x0e, 0};
91+
case KeyboardShortcut::Delete: return {0x2e, 0x53, 0};
92+
case KeyboardShortcut::ArrowLeft: return {0x25, 0x4b, 0};
93+
case KeyboardShortcut::ArrowRight: return {0x27, 0x4d, 0};
7494
}
7595

7696
return {};

app/src/settings_tab.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class SettingsTab : public brls::Box
9292
bool ToggleControllerLayout(brls::View* view);
9393
bool ToggleAudio(brls::View* view);
9494
bool CycleAudioVolume(brls::View* view);
95+
bool CycleQueueNotifyThreshold(brls::View* view);
9596
bool ChooseInterfaceLanguage(brls::View* view);
9697
bool ShowHomeScreenHelp(brls::View* view);
9798

app/src/settings_tab_actions.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,4 +578,17 @@ bool SettingsTab::CycleAudioVolume(brls::View* view)
578578
return true;
579579
}
580580

581+
bool SettingsTab::CycleQueueNotifyThreshold(brls::View* view)
582+
{
583+
(void)view;
584+
constexpr int thresholds[] = {5, 10, 20, 50};
585+
int next = thresholds[0];
586+
for (int v : thresholds) {
587+
if (v > draft_settings_.queue_notify_threshold) { next = v; break; }
588+
}
589+
draft_settings_.queue_notify_threshold = next;
590+
MarkDirty();
591+
return true;
592+
}
593+
581594
} // namespace opennow

app/src/settings_tab_pages.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ void SettingsTab::BuildAppPage()
200200
: std::string("Disabled");
201201
},
202202
[this](brls::View* view) { return ToggleStatsOverlay(view); }));
203+
interface->addView(MakeOptionRow(
204+
"Queue notify at",
205+
"When minimized, pop a reminder when queue drops to this position. Choose 5, 10, 20 or 50.",
206+
[this] { return std::to_string(draft_settings_.queue_notify_threshold); },
207+
[this](brls::View* view) { return CycleQueueNotifyThreshold(view); }));
203208
content_container_->addView(interface);
204209

205210
auto* shortcuts = MakeSection(

0 commit comments

Comments
 (0)