Skip to content

topbar: looks that follow Windows, blur, opt-in extras - #152

Open
Tkyoxx wants to merge 9 commits into
Lemxy:mainfrom
Tkyoxx:pr/5-topbar-look
Open

Tkyoxx wants to merge 9 commits into
Lemxy:mainfrom
Tkyoxx:pr/5-topbar-look

Conversation

@Tkyoxx

@Tkyoxx Tkyoxx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Stacked on #144, #148, #151. Until those are merged this branch also carries their commits, so the diff below is bigger than this PR. Its own change is 6 commits; I will rebase it as soon as #151 is in.

What

  • Buttons start at the left on Windows 10 and centred on 11 until chosen (common::windows_build() / win11(), native registry reads).
  • Tray: Windows 11's per-icon "show on taskbar" seeds the bar's list; Windows 10's "Always show all icons" maps to "Every tray icon on the bar".
  • Blur behind a see-through bar (Windows' own, SetWindowCompositionAttribute); only background pixels get the opacity, so text stays solid; the background copy is cached with bg_layer's key.
  • Installer gear for topbar: centred, every tray icon, OneDrive, see-through, blur (live), Replace Explorer and the PowerShell aliases. The aliases are opt-in now (fresh installs leave the profile alone; old installs keep them; --ps-aliases / --no-ps-aliases). A fresh install shows OneDrive.
  • reshell stays mandatory: it is also the watchdog and the Win+E/D/I handler.
  • No more TaskbarCreated broadcast to every window every 4 s forever when the tray is empty (first minute only, then once a minute).
  • The OneDrive switch applies at once.

Screenshot (the bar on Windows 10 21H2, see-through with blur, from my build with the stacked PRs; 2x, no smoothing)

The bar, see-through with blur

Test

topbar and common tests; on Windows 10 and 11: default alignment, the tray list, blur on/off at 85 %, aliases on/off through the installer.

- winrust-common: Lang::Es and Lang::ALL; t!/tf! take an optional es: arm
  after zh: (or after pt: in calls without zh:), and any language left out
  shows the English text, so nothing is ever blank or a raw key.
- No lang.txt: the Windows UI language when WinRust has it, else English.
- lang() re-reads lang.txt at most once a second and set_lang broadcasts
  style::msg(), so open windows switch without a restart: topbar now listens
  for the broadcast, rust-settings rebuilds its pages and rust-explorer its
  column headers and navigation pane when the language moved. The "restart
  the programs" notes say the switch is immediate now.
- The installer list, rust-settings and the bar's language page take their
  languages from Lang::ALL (Spanish included); --lang accepts es.
- Spanish for every t!/tf! call (1,246), the installer table, the Run box
  commands and the Start button menu, plus the few strings still English-only
  in rust-explorer.
- rs-launcher's counts gave "2 registry entrys" and Portuguese had no plural
  at all: every language now spells out its singular and plural.
…a switch

rust-explorer used to be the file manager and the Explorer replacement in one
step, so it could not be installed without topbar. Now:

- Its row installs the file manager only: folder/drive verbs and the Start
  menu shortcut. Explorer stays the shell with its own desktop and taskbar; no
  service tweaks, no rs-overlay task, no AutoRestartShell change.
- "Replace Explorer" in topbar's settings panel is the shell part. Turning it
  on ticks topbar and rust-explorer; unticking either turns it off. Turning it
  off later hands the session back to Explorer and keeps the file manager.
- An installed rust-explorer whose switch moved shows "Will be changed" and is
  installed again; giving the shell back runs before anything else in the
  same run, so topbar is never removed while it is the only bar.
- Express never moves the shell; a plain update keeps the current mode.
- Uninstalling topbar while rust-explorer is the shell gives the shell back to
  Explorer first (command line included).
- Command line: install/update rust-explorer [--shell|--no-shell]; --shell
  pulls topbar in when it is missing.
- The upstream rs-overlay start (schtasks /run, shortcut as the fallback) is
  kept as is, it just lives in the shell part now.
- Win+S / Win+Q open the card through a low-level keyboard hook on its own
  thread, set again every 30 s like topbar's. Win+Shift+S stays the snip; a
  dummy key keeps Start from opening on release, and the key still goes down
  the hook chain so topbar's Start knows Win was not pressed alone. On Windows
  10 that was the missing piece: SearchHost.exe (the window that is blocked)
  is Windows 11's, so Win+S kept opening Windows Search there.
- Windows 10's own search window (SearchApp.exe / SearchUI.exe) is left
  alone on purpose. Blocked, it made Explorer wait out DCOM's activation
  timeout every time it asked for it (System log 10010, TWinUI 5961), which
  froze the desktop's right click for seconds. With WSearch off it has
  nothing to search, and Win+S no longer reaches it.
- Alt+Space and Win+S can each be switched off from a gear on rust-search's
  row (%ProgramData%\WinRust\search-keys.txt, applied live through the style
  broadcast). At least one stays on.
- A taken Alt+Space is no longer fatal (said once, off the UI thread); a
  named mutex keeps one launcher per session instead.
- The installer's settings panels are generic now: one gear per plugin with
  options, the panel sized to its switches. topbar's keeps OneDrive and
  "Replace Explorer".
Without align-left.txt the buttons were always centered, so on Windows 10 the
bar looked like a different system from the first second. Now the default
follows the build: left on Windows 10, centered on Windows 11. A choice made in
the bar menu (the file says 1 or 0) still wins either way.

common: windows_build() / win11() read CurrentBuildNumber once, natively, and
reg::get_str reads a REG_SZ without starting reg.exe.
Until the user moved an icon, every tray icon sat behind the arrow, including
the ones people had told Windows to keep in sight. Now:

- Windows 11: its per-icon "show on taskbar" choices (NotifyIconSettings,
  IsPromoted) seed the bar's list until the user makes their own.
- Windows 10 has no per-icon list that can be read, only "Always show all
  icons" (EnableAutoTray 0). That maps to a new switch, "Every tray icon on the
  bar" (style::tray_all, tray-all.txt), also in the bar menu.

common: reg::subkeys enumerates a key natively; style gets a small Flag
helper for 0/1 files with a computed default.
A see-through bar showed the windows under it sharp, which makes the clock and
the buttons hard to read. "Blur behind the bar" (Colors and transparency page,
style::bar_blur, off by default) asks Windows for the blur its own taskbar
uses, through SetWindowCompositionAttribute (looked up at run time; a Windows
without it just gets no blur).

Fading the whole layered window would fade the text too, so with the blur on
the bar is painted into a 32-bit DIB and only the pixels the background left
alone get the opacity (premultiplied); text, icons and pills stay solid. The
background copy it compares against is kept with bg_layer's key, so an
animation frame copies nothing. Switching the blur on at 100 % opacity drops
it to 85 %, since nothing shows through a solid bar.

Checked on Windows 10 19044; the same API draws it on Windows 11.
…uest

- topbar's settings panel gets the look switches, all live through the style
  broadcast: centered buttons, every tray icon on the bar, see-through bar
  (85 %), blur behind it. OneDrive and "Replace Explorer" stay where they were.
- The PowerShell profile block (cat->bat, grep->rg, ll, zoxide) was written
  into the user's profile with every topbar, unasked. It is a switch now, off
  for a fresh install; installs from before keep it. Flipping it marks topbar
  "Will be changed", and installing it again writes or removes the block.
  Command line: --ps-aliases / --no-ps-aliases. The applied state lives in
  HKLM\SOFTWARE\plugin-launcher\topbar.
- A fresh install shows the OneDrive icon (topbar.cfg is written with it on);
  installs from before keep it hidden, as the bar's default was.
- reshell is not optional: besides the desktop hotkeys it is the watchdog that
  brings the taskbar back if the bar dies, and the Win+E/D/I handler.
With no tray icon at all (a PC without tray apps, or all of them hidden) the bar broadcast TaskbarCreated to every top-level window in the session every 4 s, forever. Now every 4 s for the first minute after start, which covers apps that start late, then once a minute.
The installer's "Hide the OneDrive icon" only reached the bar the next time
OneDrive registered its icon, usually at the next sign-in. The installer now
sends the style broadcast after writing topbar.cfg, and the bar drops the icon
or asks for it again (TaskbarCreated) when the value really changed; theme and
language broadcasts leave the tray alone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant