feat(bottom): Quick Access tabs fill the bottom screen
No files matched your search
@@ -71,7 +71,8 @@ object SteamQam {
|
||||
return;
|
||||
}
|
||||
const decky = !!g.DeckyPluginLoader?.tabsHook?.qamBrowserViewPatch;
|
||||
if (m.m_eOpenSideMenu === QAM && decky && !g.__ddQamDecky) m.CloseSideMenus();
|
||||
// Decky hooks the menu after Steam starts; the menu has to unmount for its tab to appear, so reopen on the next tick.
|
||||
if (m.m_eOpenSideMenu === QAM && decky && !g.__ddQamDecky) { g.__ddQamDecky = true; m.CloseSideMenus(); return; }
|
||||
if (m.m_eOpenSideMenu === 0) {
|
||||
m.OpenQuickAccessMenu(g.__ddQamTab ?? undefined);
|
||||
g.__ddQamDecky = decky;
|
||||
|
||||
@@ -84,8 +84,14 @@ internal object QamLayout {
|
||||
|
||||
fun toCss(x: Float, y: Float, scale: Float, left: Float): Pair<Float, Float> = (x - left) / scale to y / scale
|
||||
|
||||
const val CONTENT_SCRIPT = "(() => { const w = innerWidth; let right = 0; for (const e of document.body.querySelectorAll('*')) { " +
|
||||
"const r = e.getBoundingClientRect(); if (r.width > 0 && r.height > 0 && r.width < w * 0.75 && r.right > right) right = r.right; } " +
|
||||
/** Makes the menu follow the panel-shaped view (Steam sizes it once, on open) and lifts each tab's 300 px cap, then measures where the content ends. */
|
||||
const val CONTENT_SCRIPT = "(() => { let s = document.getElementById('dd-qam-wide'); " +
|
||||
"if (!s) { s = document.createElement('style'); s.id = 'dd-qam-wide'; document.head.appendChild(s); } " +
|
||||
"const css = 'div.BasicUI { width: 100% !important; } div[class*=\"tab_\"] { max-width: none !important; }'; " +
|
||||
"if (s.textContent !== css) s.textContent = css; if (document.scrollingElement.scrollLeft) document.scrollingElement.scrollLeft = 0; " +
|
||||
"const w = innerWidth; let right = 0; for (const e of document.body.querySelectorAll('*')) { " +
|
||||
"const r = e.getBoundingClientRect(); const tab = /(^| )tab_/.test(String(e.className)); " +
|
||||
"if (r.width > 0 && r.height > 0 && (tab || r.width < w * 0.75) && r.right > right) right = r.right; } " +
|
||||
"return JSON.stringify([w, innerHeight, devicePixelRatio, right]); })()"
|
||||
}
|
||||
|
||||
|
||||
@@ -170,10 +170,10 @@ Details: [bottom-screen-companion-api.md](bottom-screen-companion-api.md).
|
||||
Plugin loaders expose Steam's CEF DevTools so the menu can be viewed in a desktop browser, but it renders only while it is open on the main screen. The panel keeps it open without covering the top screen:
|
||||
|
||||
- Steam's UI is told to open the menu and keep it open: its composition request is capped at "notification" while the menu is ours, so gamescope keeps focus on the game, and losing focus no longer closes it. Gamepad focus moves from the menu back to the main UI only when the menu took it, so Steam's own popups keep the controller. The blurred backdrop is hidden.
|
||||
- The menu's browser view is placed just outside the Big Picture window through its own `SetBounds`, so it keeps rendering but never shows on top, including while Steam slides it wider for Friends and chat. The view is also given the panel's shape (about 712 × 463 instead of Steam's 856 × 463), so every tab shows at the same scale: Friends uses its compact list until a chat is opened, and the list with the chat then fills the panel.
|
||||
- The menu's browser view is placed just outside the Big Picture window through its own `SetBounds`, so it keeps rendering but never shows on top, including while Steam slides it wider for Friends and chat. The view is also given the panel's shape (about 712 × 463 instead of Steam's 856 × 463), and a style on the menu page lifts Steam's 300 px cap on each tab, so every tab fills the panel at one scale, with Friends showing its list and chat side by side.
|
||||
- A timer inside Steam keeps this state every 250 ms, so the menu comes back, on the tab it was showing, as soon as Steam's main menu or a full-screen page such as Decky's store closes. It runs on a 5 s lease that the panel renews each second: if the app stops, Steam returns to normal by itself.
|
||||
- The hold starts only once the session is ready: holding the menu before Steam's first frame kept gamescope from presenting anything.
|
||||
- `droiddeck-qam-relay` relays the app to the DevTools port, which only answers clients inside the guest. The panel streams the menu with `Page.startScreencast`, scales its content to the panel and fills the rest with the menu's own background, and forwards touches on the menu with `Input.dispatchTouchEvent`. When the menu is narrower than the panel, a chevron in the free space on each side steps it left, centre or right; the choice is kept. Returning to the panel shows the last frame at once while the stream reconnects, and the first frame after a cold start takes about 1.4 s.
|
||||
- `droiddeck-qam-relay` relays the app to the DevTools port, which only answers clients inside the guest. The panel streams the menu with `Page.startScreencast`, scales its content to the panel and fills the rest with the menu's own background, and forwards touches on the menu with `Input.dispatchTouchEvent`. If a Steam update brings back a narrow tab, a chevron in the free space on each side steps it left, centre or right; the choice is kept. Returning to the panel shows the last frame at once while the stream reconnects, and the first frame after a cold start takes about 1.4 s.
|
||||
- Leaving the panel closes the menu and turns the patches off; the Steam button and the normal Quick Access button then work as before. Opening Steam's main menu replaces the Quick Access menu for as long as it is open, as on a Deck.
|
||||
|
||||
Checked with Decky Loader 3.3.1 enabled: its tab renders and takes touch, and its store opens full screen on top with the controller, then returns to the Decky tab below. Decky hooks the menu after Steam starts, so the panel reopens it once when that happens.
|
||||
@@ -184,9 +184,9 @@ Limits: it relies on Steam's minified UI stores and method names, so a client up
|
||||
| --- | --- | --- |
|
||||
|  |  |  |
|
||||
|
||||
| Decky, centred | Decky, aligned right |
|
||||
| Decky | Performance |
|
||||
| --- | --- |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|
||||
The top screen during that game, with the menu open on the bottom: 
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 344 KiB After Width: | Height: | Size: 285 KiB |
|
After Width: | Height: | Size: 215 KiB |
|
Before Width: | Height: | Size: 215 KiB After Width: | Height: | Size: 186 KiB |