Skip to content
This repository was archived by the owner on Oct 30, 2026. It is now read-only.

Final merge from contributors - #6

Merged
gitgiovik merged 33 commits into
gitgiovik:mainfrom
Ragnatela666:mini-oled-dock-plus
Oct 30, 2026
Merged

gitgiovik merged 33 commits into
gitgiovik:mainfrom
Ragnatela666:mini-oled-dock-plus

Conversation

@gitgiovik

Copy link
Copy Markdown
Owner

No description provided.

Desox96 and others added 30 commits October 29, 2026 13:22
Apps that place their own tray flyout from FindWindow("Shell_TrayWnd") + GetWindowRect (e.g. Logitech G HUB's WinUI tray) compare that rect with the monitor to infer the taskbar edge. The hidden host window only covered the dock's tray area, matched no edge, and the flyout fell back to the top-left corner of the screen.

The host window now starts at the monitor's left edge, touches the screen edge on the bar's side and ends at the right end of the dock's tray area, so right-aligned flyouts land over the dock's icons. It stays hidden.
Tray context menus opened wherever the cursor was, so they often covered the clicked icon and its neighbours, while the dock's own popups always sit centered above the item.

- The anchor passed to the app (v4 wParam) is now the center of the clicked icon, just outside the bar.

- After a right click, out-of-context WinEvent hooks filtered on the owner's pid watch for 3 s; the first visible top-level, captionless, menu-sized window is moved with popup::compute_pos, the same rule as the dock's popups. Works for classic menus and custom flyouts (e.g. G HUB). Submenus are left alone; an app that keeps moving the menu back wins after 6 moves.

- foreign_menu_active() also reports the placed menu, so auto-hide does not cover it now that it sits above the bar.
…+Start animation

Adds the win_opens_start setting (Settings > Behavior, off by default). When on, a lone Win tap opens Start together with the dock and the next tap closes both; the Start popup follows the dock's per-frame fade/slide so both animate as one. Off keeps the original toggle/double-tap behaviour.
Adds a Language option (System / English / Italiano) in Settings > Appearance. All panel, menu and settings strings switch live without restart; clock and calendar use month/day names of the chosen language, System keeps following the Windows locale. Strings are compile-time constants, state is a single byte.
…the volume popup

Lists only the spatial formats Windows can actually use on the selected output (format supported by the endpoint and provider app installed); Dolby Atmos for built-in speakers is not offered. The mixer enumerates audio sessions only while the popup is open.
Tray menu placement, Win-opens-Start, IT/EN language, spatial audio + mixer, horizontal Start
Preview renders two new views (audio Customize mode, Settings in Italian); README gets a gallery of the horizontal Start, volume popup, language and Start import, plus features, usage and the four new config keys. Existing screenshots refreshed.
Cargo.toml: version 1.1.0 -> 1.2.0. Release notes for Desox's PR #1 in .github/release-notes/v1.2.0.md.
…is not lost

When another app had the foreground, a click on a bar item (most often Start)
opened the popup and closed it again in the same millisecond:

    popup: opening StartMenu
    popup: closing StartMenu (focus lost)
      foreground variant 1 (AttachThreadInput): SetForegroundWindow -> true

ShowWindow(SW_SHOW) activated the popup; force_foreground then attached our
input queue to the foreground thread, the other thread's active window won,
and the popup got WA_INACTIVE and closed. The second click worked because the
foreground was already ours (no AttachThreadInput).

SW_SHOWNA leaves the activation to force_foreground alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(popup): first click on a bar item is lost when another app has the foreground
README: thanks in Credits and a Fix line in Features for PR #2.
Cargo.toml: version 1.2.0 -> 1.2.1. Release notes for VanheXen's PR #2 in .github/release-notes/v1.2.1.md.
…ar there

The edge was checked only on the display the bar was last on, and only the
Win key moved the bar to the pointer's display: with two monitors, the bottom
edge of the other one did nothing, even while the bar was still visible on
the first one.

on_poll now checks the edge on the display under the pointer and, when it is
another one, moves the bar there (follow_pointer) before showing it.
follow_pointer hides a bar still visible on the old display at once, so the
Win key and the edge both slide it in on the new display.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…itor info and the apps hook

- toggle_start_menu: the Win double tap (open_start_menu) and win_opens_start
  (start_with_bar) shared the same "follow pointer, show bar, toggle menu"
  sequence, but only the latter linked the menu to the bar's slide+fade. Both
  now use one function, so the double tap animates the menu with the bar too.
- follow_pointer reuses hide_dock's instant branch (hide(reason, true)) instead
  of a partial copy that skipped the clock/sysmon/width-animation cleanup.
- monitor_info(h): one GetMonitorInfoW wrapper for ui, popup and tray_host
  (five copies before).
- The apps WinEventHook was installed in both ui::attach and main and removed
  in both main::cleanup and ui::shutdown; keep one install (ui::attach, before
  the first apps::refresh) and one removal (main::cleanup).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Created broadcast

set_state reused a copy of appbar()'s SHAppBarMessage fallback and restore_force a copy of
announce_tray's TaskbarCreated broadcast: both now go through one helper
(appbar_shell, broadcast_taskbar_created).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
send_win_d hand-built the same four INJECT_TAG events (LWin down, D down, D up, LWin up)
that ui::send_win_key sends; it is a plain SendInput with no UI-thread state, so the shell
thread can call it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
popup_settings and popup_audio each drew the same slider (rail 4 px at alpha 60, fill at 230,
white knob) and mapped the pointer to a value with the same rounding. popup::slider_value_at
and popup::paint_slider (value in lo..=hi) now do both; the audio popup passes 0..=100.
Same pixels and same values as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hread::FileInfo

tray_host had its own exe_path_of_pid and a manual GetFileVersionInfoW/VerQueryValueW walk for
FileDescription. It now uses apps::exe_path_of_pid (which also handles long paths) and
FileInfo::read (IShellItem2), the sources of the bar's app names. The tray-name thread
initializes COM (STA) around the read and gets a 512 KB stack for the shell code.
The tray keeps showing the raw description (no strip_generic, as before), and the per-path
cache stays. version.dll is no longer imported, so it leaves the delay-load list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
popup_start kept parallel EN/IT label tables beside ROWS (plus a test checking they lined up)
and popup_startmenu a Labels struct with EN and IT consts chosen at build time. Both now use
i18n::tr like every other popup: each Start row carries its own English/Italian pair, and the
Start menu builds its labels with tr. Preview mode already forces English in tr, so
popup_start::preview_new was identical to new and is gone (preview.rs calls new); the
label_tables_match_rows test goes with the tables it guarded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
surface.rs carried a literal copy of render.rs's drawing layer. There is
now one implementation of each piece, in surface.rs, and the bar uses it:

- pixel primitives div255/argb/white/over/rr_cov and rect_wh (pub(crate));
- Canvas (blend with optional clip, fill_rr, stroke_rr, fill_fn, blit,
  glyph): render's Canvas::vector is Canvas::glyph with WHITE, and the
  Surface drawing methods delegate to it;
- Gdi: the two memory DCs, main DIB + text scratch DIB (make/free,
  resize, Drop), text_width, grayscale text compositing, snapshot;
- create_font (face fallback + GetTextFaceW check), line_height,
  delete_font, TEXT_FACES;
- present_layered (UpdateLayeredWindow, ULW_ALPHA, AC_SRC_ALPHA). It
  takes the raw DC so render::present_alpha still releases the GFX
  borrow before the (re-entrant) call.

The bar keeps its own state (Gfx with 3 fonts sized by BarSizes,
set_metrics, the 7 px measure fallback without init, pill clip, draw_bg)
rather than becoming a Surface: Surface's fixed 4-font set does not fit
it. Same blending math, font params, present flags and log messages:
the 80 --preview PNGs (bar and popups, DPI 120 and 96) are byte-identical
before and after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After an Explorer restart, apps re-registered their tray icons with
Explorer's (hidden) taskbar instead of the dock's tray host, so new icons
and icon updates were lost until the dock restarted.

The dock re-announced its tray only on Explorer's TaskbarCreated broadcast,
but while the dock's tray host (a Shell_TrayWnd) exists Explorer does not
send it: a hidden medium-integrity test window received TaskbarCreated on an
Explorer restart without the dock, and nothing with the dock running.

on_winevent now treats the creation of Explorer's primary Shell_TrayWnd
(EVENT_OBJECT_CREATE, already hooked) as an Explorer restart and runs the
same path as TaskbarCreated (explorer_restarted): self-heal, hide, raise
the tray host and announce it again after 300 ms. Tested with two Explorer
restarts: 8 and 13 icons re-registered with the dock, 0 before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
If our tray host (a Shell_TrayWnd) exists while a new Explorer starts,
Explorer never registers its desktop with ShellWindows and never
broadcasts TaskbarCreated. Every de-elevated launch (apps, menu items)
then fails with an empty error until both are restarted. This happened
on every Explorer restart with the dock running, v1.2.1 included.

Isolated by restarting Explorer and probing IShellWindows::FindWindowSW
(the lookup desktop_shell_execute does) from a separate elevated process:
- nothing running, a bare fake Shell_TrayWnd, or the dock with
  --keep-taskbar (no tray host): the desktop is registered;
- the dock with its tray host, even when it left the new taskbar alone
  for 45 s: never registered (checked up to an hour later).

Now the destruction of Explorer's Shell_TrayWnd (EVENT_OBJECT_DESTROY,
already in the hooked range) stops our tray host. When the new
Explorer's desktop is registered (polled every second, 60 s at most),
on_reannounce_timer starts the host again and announces it. Three
Explorer restarts: desktop back after ~2 s, 24-26 icons re-registered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ny display shows the bar

Multi-monitor, monitor = "pointer": the bottom edge of the display under the pointer now shows the bar there, even while it is still visible on the other display (before, only the Win key moved it). follow_pointer hides the old bar instantly so the slide+fade plays on the new display. Reviewed and tested locally together with #4 and #5: release build OK, cargo test 127 passed.
…icated behaviour (-511 lines)

Removes duplicated code across 15 files (+691/-1202). Unified: Start menu toggle (fixes the Win double tap opening Start without the bar animation), instant hide, monitor_info(), apps WinEventHook install/removal, SHAppBarMessage fallback and TaskbarCreated broadcast, Win+D fallback via ui::send_win_key, one slider for Settings and Audio popups, tray app names via apps::exe_path_of_pid + shell_thread::FileInfo (version.dll dropped from delay-load), Start popups labels via i18n::tr, bar drawing via surface.rs primitives (render.rs 1825 -> 1358 lines). The 80 --preview PNGs are byte-identical before and after. Verified locally: release build OK, cargo test 127 passed (label_tables_match_rows removed with its tables), no new clippy warnings.
Ragnatela666 and others added 3 commits October 30, 2026 00:16
…rking across Explorer restarts

After an Explorer restart (crash, update, manual) apps launched from the dock failed and tray icons went to Explorer's hidden taskbar until both were restarted (v1.2.1 affected). Now: the creation of Explorer's Shell_TrayWnd triggers the same self-heal + hide + tray re-announce as TaskbarCreated; its destruction stops our tray host, which restarts once the new Explorer desktop is registered with ShellWindows (polled every 1 s, 60 s max, ~2 s in practice). Verified locally on top of #3 and #4: release build OK, cargo test 127 passed.
README: the Fixes line in Features now lists the multi-monitor edge fix (#3), the Win double tap animating Start with the bar (#4) and the dock surviving Explorer restarts (#5); Credits thanks him for the three PRs, including the -511 lines de-duplication refactor.
…cation refactor

Cargo.toml: version 1.2.1 -> 1.3.0. Release notes in .github/release-notes/v1.3.0.md.

Changes since 1.2.1 (VanheXen, PRs #3-#5):

- fix(taskbar) #5: the dock keeps working across Explorer restarts. Our tray host is stopped when Explorer's Shell_TrayWnd is destroyed and started again once the new desktop is registered with ShellWindows (~2 s), so de-elevated launches work again and tray icons come back to the dock instead of Explorer's hidden taskbar.

- fix(ui) #3: in pointer mode the screen edge of any display shows the bar there, even while it is still visible on the other display.

- fix(ui) #4: the Win double tap slides Start in together with the bar (shared toggle_start_menu).

- refactor #4: one implementation for duplicated behaviour, 15 files, -511 lines: bar drawing via surface.rs primitives (render.rs 1825 -> 1358 lines), one slider for Settings and Audio, tray names via apps::exe_path_of_pid + FileInfo (version.dll dropped), Start labels via i18n::tr, single monitor_info / instant hide / apps hook / AppBar fallback / TaskbarCreated broadcast / Win+D path. --preview output byte-identical.

Verified: release build OK, cargo test 127 passed (1 ignored), no new clippy warnings.
@gitgiovik
gitgiovik merged commit 33f2f78 into gitgiovik:main Oct 30, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants