Repository navigation
Bar options: right-click menu, omarchy bar pills|floating, menu rows - #13140
cristian-fleischer wants to merge 13 commits into
Conversation
a4b4f84 to
e084f68
Compare
Automated AI review
Verified (source review of the last commit, Three items follow: one input issue, one consistency issue between the menu/CLI and the card, and one documentation gap. A right-click held for 200 ms or longer does not open the card
Impact: a deliberate or slow right-click on empty bar space does nothing, so the card appears to work only some of the time. Traced from source; not reproduced in a running session. Suggested change: reject the event for a right-button hold on the gesture area itself, and keep the existing onPressAndHold: function(mouse) {
if (!gestureArea.pressed) return
if (!(gestureArea.pressedButtons & Qt.LeftButton)) {
mouse.accepted = false
return
}
startDrag(mouse.x, mouse.y)
}Opening the card on right-button press instead of click would also avoid it. Menu rows and
|
| Starting state | Menu row or CLI toggle |
Card switch |
|---|---|---|
bar.pills: "widget", toggled off then on |
ends in "section" |
ends in "widget" |
No bar.floating, theme [bar] margin set (bar floats) |
first press writes true, no visible change |
first press turns floating off |
No bar.pills, theme [bar] pills = "widget" |
first press writes "section", pills stay on |
first press turns pills off |
Impact: anyone using widget pills loses that mode after an off/on cycle from the menu, and the new config-test.sh case asserts that widget -> off -> section sequence. With a user or community theme that enables floating or pills (no shipped theme sets these keys), the first menu press appears to do nothing or switches modes. The description's "Pills turns back on to the last mode in use" holds for the card, within the running shell session only: lastPillMode is in memory and starts as "section" after a restart.
Suggested change: route the menu rows, and optionally the CLI toggle, through the running bar the way toggleBarTransparency() in shell/shell.qml already calls shell.bar.toggleTransparency(), keeping the current jq path as the fallback when the shell is not running. Alternatively, document that toggle flips the shell.json value only and re-enables pills as section, and narrow the last-mode claim.
Documentation: manual/05-the-top-bar.md:83-95 still says Style > Menu Bar has "both position and transparency", does not mention right-clicking empty bar space, and does not list omarchy bar pills or omarchy bar floating. Its "A click-and-hold starts the same drag" could now say left-click-and-hold.
Review information
Test scope: Source review of pinned head e084f68cbfe49f0a6ae59d378bc533a30ead4a38 against quattro at 28ceaae70eba, focused on the last commit, with the carried floating and pills commits read where the new code depends on them. Upstream source read: Qt Declarative QQuickMouseArea (6.8.3, 6.9.3, 6.11.2), Quickshell v0.3.1 and Hyprland v0.56.2; installed versions were not checked. No repository code, tests or GUI were run, so input timing, popup placement and rendering were not observed, and the "0 differing pixels" claim was not independently measured.
AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments with targeted follow-up on single-source claims, Opus 5.5 Medium editorial check.
Opt out: To stop receiving these reviews, reply to this comment saying so.
e084f68 to
97118ba
Compare
|
Thanks @llstrk, both confirmed.
|
Automated AI review
Follow-up to the earlier review and the author's reply, checked at head Verified: all three earlier findings are resolved at this head. No regression was found in the code changed since
Verified details:
Documentation:
Optional test improvement: the press-and-hold guard check in Review informationTest scope: Follow-up review of head AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
97118ba to
1624a87
Compare
|
Thanks @llstrk. The IPC table now lists Another review pass found a few more things, also fixed:
|
Automated AI review
Outcome: A right press on empty bar space cancels a widget drag; all six findings of the earlier review are resolved at A right press on empty bar space cancels a widget dragDuring a widget drag, a right press on empty bar space reaches Suggested change: in that early return, reject the press ( Reproducer (standalone Qt model)Standalone Qt Quick model, not the running shell. Run with Qt 6.11.2 (
import QtQuick
// The bar's empty-space gesture area (CenterGestureArea in
// shell/plugins/bar/Bar.qml at 1624a877, onPressed copied as written;
// openMenu stands in for a press on empty bar space) under one widget slot,
// whose modulePointer takes only the left button, as ModuleSlot's does.
Item {
id: root
width: 600
height: 30
property int widgetDragCancels: 0
property int widgetDrops: 0
MouseArea {
id: gestureArea
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
property bool dragging: false
property bool suppressClick: false
property real pressedX: 0
property real pressedY: 0
property bool menuOpen: false
function openMenu(x, y) { menuOpen = true; return true }
onPressed: function(mouse) {
if (mouse.button === Qt.RightButton) {
if (dragging || (mouse.buttons & Qt.LeftButton)) return
if (menuOpen) menuOpen = false
else if (!openMenu(mouse.x, mouse.y)) mouse.accepted = false
return
}
menuOpen = false
dragging = false
suppressClick = false
pressedX = mouse.x
pressedY = mouse.y
}
}
// A widget slot's modulePointer: fills the slot, left button only.
MouseArea {
x: 200
width: 60
height: 30
acceptedButtons: Qt.LeftButton
property bool dragging: false
onPositionChanged: dragging = true
onReleased: if (dragging) root.widgetDrops++
onCanceled: root.widgetDragCancels++
}
}
// Build: g++ -std=c++17 -fPIC repro.cpp -o repro $(pkg-config --cflags --libs Qt6Quick Qt6Test)
// Run: QT_QPA_PLATFORM=offscreen QT_QUICK_BACKEND=software ./repro repro.qml
// QTest's QWindow mouse functions keep the held-button state, so the right
// press arrives with the left button still held, as from a real mouse.
#include <QGuiApplication>
#include <QQuickItem>
#include <QQuickView>
#include <QtTest/QTest>
#include <cstdio>
int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
QQuickView view(QUrl::fromLocalFile(QString::fromLocal8Bit(argv[1])));
view.resize(600, 30);
view.show();
if (!QTest::qWaitForWindowExposed(&view)) return 1;
QObject *root = view.rootObject();
// Drag a widget left, over empty bar space, and press the right button
// there before letting go of the left one.
QTest::mousePress(&view, Qt::LeftButton, {}, QPoint(230, 15));
QTest::mouseMove(&view, QPoint(225, 15));
QTest::mouseMove(&view, QPoint(100, 15));
QTest::mousePress(&view, Qt::RightButton, {}, QPoint(100, 15));
QTest::mouseRelease(&view, Qt::RightButton, {}, QPoint(100, 15));
QTest::mouseRelease(&view, Qt::LeftButton, {}, QPoint(100, 15));
std::printf("widget drag cancelled: %d, widget dropped: %d\n",
root->property("widgetDragCancels").toInt(),
root->property("widgetDrops").toInt());
return 0;
}Actual output, Actual output with the gesture area's Actual output with the suggested guard (the only change to if (dragging || (mouse.buttons & Qt.LeftButton)) {
if (!(gestureArea.pressedButtons & Qt.LeftButton)) mouse.accepted = false
return
}Why: the right press is delivered to the gesture area by hit-testing. DetailsIn a larger Qt model of Verified:
Optional notes:
Related open PRs: #13569 adds the same Review informationTest scope: Source and sandboxed tests at AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
1624a87 to
e5042bb
Compare
|
Thanks @llstrk, confirmed and fixed. I checked it with a small Qt 6.11.2 harness that sends real two-button events. With the previous head, a right press on empty bar space during a widget drag took the grab and cancelled the drag. Now the gesture area passes that press on unless it holds the left button itself, so a widget drag continues as in the base, and the bar's own move is still not stranded. My earlier "ignored, as before" only held for the bar's own move. |
[Medium impact] The PR appears safe to merge; no new actionable issues were confirmed. SummaryAdds one place to change the bar background, floating state, and pills through a right-click card, commands, and menu rows.
Previous thread decisions:
This review inspected code paths; it did not run tests or capture the UI.
|
b736db1 to
e792ae2
Compare
|
Heads-up for the rebase: #14553 (merged today) qualifies palette references as |
|
Thanks for the heads-up @jandrusk. I'll switch these to |
e792ae2 to
0107c75
Compare
|
Rebased. The card's Background row now steps through clear, glassy and opaque, the menu rows moved to Appearance › Menu Bar, and |
0107c75 to
b166cfa
Compare
b166cfa to
b9c5143
Compare
b9c5143 to
ac74552
Compare
ac74552 to
c0a5c2e
Compare
b6ee5a3 to
7259a71
Compare
434f1da to
69996be
Compare
201de1c lets icon-slot, icon-canvas, icon-size, icon-font and status-slot through the [bar] parser, which fixes part 1 of omacom#11359. The keys are still missing from docs/omarchy-shell.md and the theme template. docs/omarchy-shell.md and shell.toml.tpl list the keys with their defaults; the Style.qml header names them. icon-font is the font size an icon button renders its glyph and label at; the drawn glyph is rescaled to fit icon-size, so it does not make the icon bigger. Co-Authored-By: Claude <noreply@anthropic.com>
69996be to
1f36d38
Compare
[Rebased onto the full-screen bar window (omacom#6782): the margin insets the painted strip instead of the window, and the exclusive zone grows by it. The [bar] parser setup its test runs moves here from the size-keys test, which upstream no longer needs.]
A bar is usually set further off the edges it spans than off the one it hangs from — sketchybar and waybar both inset 8 at the sides and 4 at the top — which a single margin cannot express. Read the gap through Geometry.parseWidthSpec, the width spec the border widths already take, so margin accepts N, "Y X", "T X B" or "T R B L" with no new vocabulary. A scalar still means every edge. omarchy-bar-text-color crops the wallpaper at the screen edge to choose a legible transparent-mode foreground, a strip a detached bar no longer covers. It takes an --inset now, applied to all four crops. At margin 0 the crops are byte-identical, so a flush bar is untouched. [Rebased onto the full-screen bar window (omacom#6782): the margins inset the painted strip instead of the window. Drag points need no offset there, so the windowScreenPoint() change is dropped. Rebased again onto bounded wallpaper sampling (omacom#14281): the insets scale with the 1920 px sample canvas. The Bar.qml and Style.qml source asserts are dropped, as upstream no longer keeps source-text tests (omacom#16334).]
bar.floating in shell.json turns the detached bar on or off without editing a theme. Unset, a [bar] margin on an edge the bar touches floats it as before; false keeps it flush whatever the theme says. A floating bar with no theme margin floats inside the space a flush bar already has: half of Hyprland's general:gaps_out from the screen edge, so the gap above the bar matches the gap below it, and the full gaps_out at its ends, so they line up with the windows. It reserves only its own thickness, so Hyprland leaves the windows where a flush bar leaves them and switching floating on or off never moves a window. A theme margin is reserved on top of the bar. The radius applies only while the bar floats, so a flush bar stays square; unset it follows decoration:rounding, and it is capped at half the bar thickness. Bar popouts, clicks forwarded while one is open, the drag-off-to-remove distance and notification toasts measure from the strip's inner face, so they follow a floating bar. Popup cards (tray menus, media, the bar options) leave room for the edge margin, and the move preview shows where a floating bar would land. Third-party widgets get the margins as bar.barMargins, and plugins that place their own windows as shell.bar.barMargins, both as copies. A flush bar does not depend on Hyprland's gaps at all. The margins, the strip's place on its screen and the margin reserved past the thickness are BarModel functions, and the toast clearance is Delivery.barReach, all tested by value along with the gaps_out parse. The theme template keeps margin and radius as commented examples, so a generated theme no longer pins radius to 0 and margin reads as unset. The omarchy agent skill (plugins.md) explains the switch, the Hyprland defaults and the theme keys, so an agent asked for a floating bar knows where to look. Co-Authored-By: Claude <noreply@anthropic.com>
The bar's size and its insets are logical pixels, but the screen was measured in hyprctl's physical mode, so on a scaled display the sample missed the strip a floating bar covers. Measure the screen in logical pixels too, and fall back when a top or left inset pushes the strip off the screen instead of sampling what is left of it. From Marc-Anthony Girard's omacom#9725. Co-authored-by: Marc-Anthony Girard <marcanthony.girard.pro@gmail.com> Co-Authored-By: Claude <noreply@anthropic.com>
A theme top margin moves the bar down past part or all of a camera cutout, but the bar still took the whole cutout as its floor and still moved its center sections beside the right one. The cutout now reaches into the bar only as far as it extends past the margin: the floor shrinks by the margin, and a margin that clears the cutout leaves a plain bar with its center in the middle. A flush bar has no margin, so it is unchanged. A bar floating in the gap keeps the flush floor. It reserves only what a flush bar reserves, so a thinner bar there would move the windows when floating is toggled. From Marc-Anthony Girard's omacom#9725. Co-authored-by: Marc-Anthony Girard <marcanthony.girard.pro@gmail.com> Co-Authored-By: Claude <noreply@anthropic.com>
A top bar on a notched screen is taller than barSize, but the radius was capped at half of barSize on every screen: a 50 px bar with radius = 20 got 13 px corners. Each bar surface now caps the radius at half its own thickness. Co-Authored-By: Claude <noreply@anthropic.com>
bar.pills in shell.json (off, section, widget), or [bar] pills as a theme default, gives widgets their own background so the bar background can be switched off. Off by default: without it the bar renders as before. - section joins neighbouring widgets into one pill; a spacer, even at size 0, or a change of "group" between neighbours ends it. widget gives every widget its own. "pill": false keeps an entry off pills. - Roles are a port of DMS's SegmentRoles: hidden widgets drop out of a run without breaking it, so a widget that hides needs no rebuild. - The first slot of a pill draws the whole pill. Per-slot segments meet at fractional pixels on scaled outputs and show a seam. - Text is picked against the pill; omarchy-bar-text-color --blend composites a translucent pill over the sampled strip. - On an opaque bar the pill is the bar text at 10% so it shows; on a clear bar it is the bar colour. On a glassy bar the pills take the glass and the strip is not drawn, so Omarchy's blur falls on the pills alone. A theme's [bar] pill wins. - Theme keys: pill, pill-alpha, pill-text, pill-border(-alpha), pill-radius, pill-inset, pill-padding, pill-gap, all optional, with commented examples in the theme template. - Every section list draws its own pills, so centerBegin, center and centerEnd each get theirs. The tray's drawer sits inside the tray's pill and draws none. The pill size keys join the [bar] allowlist. - A bare widget at a section end keeps the stock end margin. - Tray icons on the bar follow the pill text colour; the tray popups sit on the popup background and keep the theme text. Bar widgets outside the shell see bar.pillsOn, so a cloned tray does the same. - An odd pill-gap splits so that neighbouring pills are exactly pill-gap apart, and pill-gap and pill-padding keep a deliberate 0. - Dragging the first widget of a pill keeps the pill under its neighbours, and the drag ghost stays under the pointer and sits on the pill colour, so it shows in the pill text colour. Once the dragged widget's room moves away, no empty pill stays behind. - The omarchy agent skill explains pills and their theme keys (plugins.md), and blur behind pills on a clear bar as a layer rule with ignore_alpha (hyprland.md). Border and theme-template examples after omacom#7251. Co-Authored-By: Saco Song <threesking@gmail.com> Co-Authored-By: Claude <noreply@anthropic.com>
Slots sit at the top of a horizontal section, so a pill centered on its first slot sat high when that widget was shorter than the bar: a 16 px widget lifted the pill by 5 px and clipped it at the bar's edge. The pill now measures across the section, which is centered in the bar. A vertical bar's pill takes the section's width the same way, so a narrow first widget no longer narrows the pill for the rest of the run. Stock widgets are all bar-sized and render as before. Co-Authored-By: Claude <noreply@anthropic.com>
A refresh that came in while omarchy-bar-text-color was still sampling was dropped unless pills were involved. Moving the bar or switching floating on a clear bar mid-sample left the text color picked for the old strip until something else asked again. Every such refresh now runs once the current sample is in. Co-Authored-By: Claude <noreply@anthropic.com>
A widget pulled off the bar keeps its layout entry until its poof has played, about 620 ms. Its slot already closes (alongLength is 0), but it still counted as drawn, so in widget mode an empty pill and its padding stayed behind for the length of the poof. A slot pending removal now leaves its pill at once. Co-Authored-By: Claude <noreply@anthropic.com>
…menu rows One place to switch the bar background, floating and pills: - Right-click empty bar space for a small PopupCard with three rows. Background shows opaque, glassy or clear and steps through them like a double-click; Floating and Pills are switches. The card opens on press, so a slow right-click works too, and only off widgets (the gaps between pills count as empty), so their own right-click actions stay. A second right press closes it. A right press during a left press or drag does nothing, and during a widget drag it is passed on, so the drag continues. Press-and-hold still moves the bar with the left button only. - omarchy bar pills <off|section|widget|toggle> and omarchy bar floating <true|false|toggle>, next to background. With no value they print what the running bar shows, theme defaults included. - Appearance > Menu Bar gains Floating Bar and a Bar Pills submenu (No Pills, Pill per Section, Pill per Widget), checked from the running bar. Pills turns back on to the last mode used since the shell started. The toggle commands, and so the menu rows, ask the running bar, so they start from what it shows, theme defaults included; with no shell or bar they flip shell.json. When the shell does not answer in time they fail, since it may still act on the call and a second flip would undo it. Every switch writes the same shell.json keys the bar already reads. The card and menu strings have English catalog entries; translations follow through the sync workflow. The manual's top bar page lists the right-click switches and the new commands. The omarchy agent skill now describes the bar in one Bar Appearance section: the omarchy bar settings, the right-click switches, and every theme key, plus a "float the bar with pills" example in SKILL.md. Co-Authored-By: Claude <noreply@anthropic.com>
1f36d38 to
85ca201
Compare
# Conflicts: # shell/Ui/KeyboardPanel.qml # shell/plugins/bar/Bar.qml
One place to switch the bar background, floating and pills, for people and for agents.
Needs #13138 and #13139; their commits are included until they merge. The new work is the last commit. Rebased onto the reworked bar, the opaque, glassy and clear backgrounds and the full-screen bar window (#6782); the menu rows moved to Appearance › Menu Bar.
The same with rounded corners:
Recorded in a nested Hyprland with scripted pointer moves and real clicks.
PopupCardwith three rows. Background shows the current look and steps through clear, glassy and opaque like a double-click on the bar (omarchy bar background cycle). Floating and Pills are switches. With pills on, Glassy gives frosted pills (Bar pills: an optional background per widget or run of widgets #13139). The card opens on press, so a slow right-click works too, and only off widgets (the gaps between pills count as empty, and so does the tray's closed drawer), so their own right-click actions stay. A second right press closes it. A right press during a left press or drag does nothing, and during a widget drag it is passed on, so the drag continues as in the base. Press-and-hold still moves the bar with the left button only.omarchy bar pills <off|section|widget|toggle>andomarchy bar floating <true|false|toggle>, next toomarchy bar background. With no value they print what the running bar shows, theme defaults included (new IPC gettersbarPillsandbarFloating).Every switch writes the same
shell.jsonkeys the bar already reads. Pills turns back on to the last mode used since the shell started. Thetogglecommands ask the running bar over IPC like the transparency toggle, so they agree with the card, theme defaults included. With no shell or bar running they flipshell.json. If the shell does not answer in time they fail instead, since it may still act on the call and a second flip would undo it.The card and menu strings have English catalog entries; the translations come from the sync workflow.
manual/05-the-top-bar.mdlists the right-click switches, the menu rows and the new commands.The
omarchyagent skill merges the floating and pills sections from #13138 and #13139 into one Bar Appearance section: theomarchy barsettings, the right-click switches and every theme key.SKILL.mdgets an example, so "make my bar float with pills" maps to three commands.Unchanged unless used
Nothing is drawn until you right-click empty bar space. The bar itself renders as on quattro (all four positions, opaque and clear background). 0 differing pixels, apart from an occasional 1 of 255 on one edge pixel of the weather icon. quattro shows the same pixel against an identical copy of itself, so it is render noise from the distance-field icons (#17003), not this PR.
Tests
config-test.sh: 8 cases for the new subcommands: the toggles with a running shell, without one, with no bar, and with a shell that does not answer, plus the no-value prints.menu-test.sh: the new rows' checked state, read fromshell.json.menu-guards-test.shpasses with the new guard readers. After the rebase onto #6782, checked in a nested Hyprland: the IPC getters and toggles, and the card under a floating glassy bar with pills.Part of a set of opt-in bar changes described in #13136: #13137
[bar]size keys, #13138 floating, #13139 pills, #13140 bar options. Nothing changes unless you turn it on.Claude (Anthropic) wrote most of this under my supervision; I reviewed it and run it on my own Omarchy install.