CK Core Motif
CK Core Motif

Appearance-profile contract

The appearance API has two deliberately separate operations. Selection is creation-time and keeps the original Xt resource model intact; the live operation is an explicit UI-thread transaction for an already-created core widget hierarchy. Neither operation is a desktop-theme bridge or a replacement for application resources.

WP-01 adds a small, additive selector without replacing Xt resources or mutating realized widgets:

#include <Xm/Appearance.h>

XmSetAppearanceProfile(display, XmAPPEARANCE_CLASSIC);

The selector is per Display and should be called after the display is opened but before creating application widgets. The selected profile is stored in that display's existing X resource database. XmGetAppearanceProfile reports the selected profile; an unselected display behaves as classic. Unknown enum values are rejected. Profile selection is immutable for a display once selected via C API or after non-shell controls exist: selecting a different profile after one has been selected fails.

Declarative Xrm startup selection (WP-45)

Unmodified Motif applications can also select an appearance profile and layout density declaratively at display initialization time through standard X resource files (~/.Xresources, XENVIRONMENT, app-defaults, or -xrm) using XmNappearanceProfile / XmCAppearanceProfile (appearanceProfile / AppearanceProfile) and XmNappearanceDensity / XmCAppearanceDensity (appearanceDensity / AppearanceDensity):

*appearanceProfile: modern_dark
*appearanceDensity: compact

Both underscore (modern_light, modern_dark, high_contrast) and hyphenated (modern-light, modern-dark, high-contrast) profile tokens are accepted case-insensitively alongside classic, and comfortable or compact are accepted for density. Resources may be specified via wildcard (*appearanceProfile), application name/class (MyApp.appearanceProfile / MyApp.AppearanceProfile), or toolkit qualification (ckCoreMotif.appearanceProfile).

Strict precedence is preserved:

  1. Explicit C API calls (XmSetAppearanceProfile / XmSetAppearanceDensity) before control creation override declarative Xrm display resources.
  2. Explicit widget creation/SetValues arguments and ordinary widget X resources override profile and density defaults. When a CDE Color Server (dtsession owning CUSTOMIZE_DATA) is active, XmColorObj XmRPixel session palette entries, session wildcard color resources, and -dt-interface session baseline XLFD font entries in the display database are treated as toolkit session defaults: modern-light and modern-dark harmonize session surfaces into modern neutral roles with elevated button cards and WCAG-guarded contrast, high-contrast applies high-contrast surfaces and borders, and switching back to classic restores the exact raw XmColorObj pixels, companion shading colors (topShadowColor, bottomShadowColor, selectColor, armColor, troughColor), and -dt-interface baseline fonts.
  3. Invalid Xrm resource strings emit a single XmeWarning conversion warning per display and fall back deterministically to classic / comfortable.

The installed Xvfb regression is tests/automated/run-xrm-appearance-startup.py.

Applications that need to change an existing hierarchy use XmApplyAppearanceProfile explicitly instead:

XmApplyAppearanceProfile(display, XmAPPEARANCE_MODERN_DARK);

The live operation updates registered core widgets, then publishes the selected profile metadata only after the widget transaction passes its conversion preflight. It preserves the current application resource database, including entries added since profile selection. It can move between all four profiles, including back to classic. Explicit widget arguments and ordinary application X resources remain authoritative. Toolkit-owned values are tracked per resource, so a later application XtSetValues assignment stops that resource from being changed by subsequent profile transitions, even when the assigned value equals the current default. Widget state, callbacks, focus and selection state are not reinitialized.

The operation is a UI-thread transaction: callers must not destroy widgets or run concurrent Xt mutations while it is in progress. Allocation and resource conversion are preflighted before the first widget is changed; a failed preflight leaves both widget values and profile selection unchanged. All profile conversions are retained in a prepared per-widget plan and are then committed in one pass, so a conversion or staging allocation failure cannot leave an earlier widget partially updated. The rollback fixture tests/automated/run-live-appearance-rollback.py injects a staging allocation failure and verifies that the selected profile and realized resources remain unchanged before a subsequent successful transition. The transaction is also deliberately non-reentrant. Appearance updates invoke XtSetValues, so a widget class SetValues hook can run while the outer transaction is in progress. A nested XmApplyAppearanceProfile or XmSetAppearanceProfile call returns False; it cannot interleave a second resource-database snapshot with the first one. The caller can retry after the outer call returns. This guard is per display and does not add a global process-wide serialization requirement. Gadget coverage is part of the same transaction: primary and secondary resource tables describe cached gadget resources, and the Xt create hook snapshots values after their GetValues paths are ready. Gadgets inherit Object’s destroy callback: their appearance state is retired immediately when they are destroyed, before Xt can reuse the address. The display-close path detaches any remaining gadget callbacks before releasing their state. A complete historical-widget matrix remains an explicit later work-package gate; the representative consumer matrix below is an incremental qualification boundary, not a claim of full class coverage.

The installed gadget regression is tests/automated/run-live-appearance-gadget.py. It transitions a PushButtonGadget, preserves an explicit foreground, destroys it, verifies that the next transition succeeds after destruction, and creates a replacement gadget under the active profile.

The live-transition consumer also creates an XmText and an XmTextField before realizing the shell, then verifies their committed strings after every profile transition. Text classes initialize their output/input backends in a later Motif initialization hook; the appearance registration therefore defers its first value snapshot for these classes until that backend exists. The regression is intentionally an installed consumer test, so a null backend or an accidental text-value reset is a failure rather than an inferred source property.

The same consumer now constructs a representative historical matrix: Label, List, ScrollBar, a pulldown-menu item, MessageBox, and Disclosure. It records their classic backgrounds, then verifies that each toolkit-owned background participates in modern-light, modern-dark, and high-contrast transitions. This does not claim complete historical-widget coverage; it ensures the live transaction is exercised beyond the button/text subset before additional classes are admitted.

WP-02 adds the opt-in modern-light profile:

XmSetAppearanceProfile(display, XmAPPEARANCE_MODERN_LIGHT);

It supplies a restrained light palette, a crisp one-pixel focus ring, two- pixel Motif bevels, an unframed notebook surface, button/toggle padding, text-field/list spacing and traversal defaults through internal Xrm profile patterns. The palette is deliberately documented in the implementation (#f1f2f4 background, #202124 text, #1a73e8 focus and #dbeafe arm/selection). These are defaults, not a color filter: application resources and explicit widget arguments retain precedence. The default remains classic, and modern-light must be selected before creating the application widgets that should use it.

The palette targets at least 4.5:1 contrast for normal text and 3:1 for the keyboard-focus indicator against the profile background. The selected and arm surfaces are intentionally not text colors; their foreground remains the high-contrast #202124 foreground on the pale selection surface.

WP-03 adds high-contrast for functional accessibility scenarios:

XmSetAppearanceProfile(display, XmAPPEARANCE_HIGH_CONTRAST);

It uses black/white text surfaces, a yellow three-pixel focus indicator, blue selection/arm surfaces, white shadow edges and a light-gray disabled foreground, while keeping primary layout and dialog containers (XmMainWindow, XmForm, XmBulletinBoard, XmMessageBox, XmSelectionBox, XmCommand, XmFileSelectionBox, XmPanedWindow, XmPaned) at a zero shadowThickness baseline just like modern-light and modern-dark unless explicitly styled. The installed fixture checks the calculated contrast ratios, realized widget colors, focus metrics, keyboard traversal and both explicit and ordinary application-resource precedence. Pixmaps are not recolored, so application supplied pixmaps retain their normal resource precedence.

WP-03 also adds the opt-in modern-dark profile. It supplies dark surfaces, light text, visible blue focus, dark selection/arm surfaces and a distinct disabled foreground through the same immutable internal profile definitions. Its installed fixture checks realized colors, disabled state, keyboard traversal, explicit application precedence and application pixmap identity; see docs/modern-dark-profile.md for the qualified scope and limits.

Profile precedence is unchanged and testable: explicit widget arguments win over ordinary X resources, and ordinary X resources win over toolkit defaults. Future profiles must add only documented fallback values and must preserve this ordering. Applications should still select a profile before creating their widgets; live transitions are an opt-in update for an existing core-widget hierarchy, not a substitute for choosing an initial profile.

The installed consumer regression is tests/automated/run-appearance-profile.py. It verifies default/selected classic, rejection of an unknown value, and ordinary-versus-explicit width precedence against the installed library under Xvfb.

The WP-02 installed visual/interaction regression is tests/automated/run-modern-light-profile.py. It checks actual realized widget colors, the palette, explicit and ordinary resource precedence, control metrics, realized geometry and keyboard focus traversal. WP-00 remains the authoritative actual-window image baseline; WP-02 compares the profile's realized widget state against that baseline without claiming a desktop-theme integration.

The WP-03 installed accessibility regression is tests/automated/run-high-contrast-profile.py.

The WP-05.1 installed live-transition regression is tests/automated/run-live-appearance.py. It runs against the installed library under Xvfb, transitions through modern-light, modern-dark, high-contrast and classic, and verifies ordinary-versus-explicit foreground precedence, realized backgrounds, toggle state and callback counts.

Construction and live-update parity

Construction and live transactions resolve the same immutable internal Xrm profile resource database. These patterns are never merged into the application resource database, where a class-specific theme pattern could otherwise outrank an application-wide wildcard. Xt first constructs a widget from its ordinary class defaults and application resources. The create hook then snapshots that baseline and applies the selected profile only to toolkit-owned values. Class-specific surfaces, label traversal, notebook frame shadows and border widths therefore have the same defaults whether a widget is created under a profile or switched into it later. There is no separate hand-maintained live palette.

Ownership is determined against the current application resource database, including application-class-qualified resources. An explicit application value is preserved even if it equals a theme default; equality does not turn an application resource into a toolkit-owned one. Xt create hooks capture fully initialized widget/backend/cache values; Xt change hooks record explicit SetValues arguments, including equal-valued assignments made before the first live appearance change. Destroy hooks retire visual widget/gadget state at Xt phase one, before storage is reclaimed, independently of replaceable per-object destroy callbacks. Nonvisual extension/cache objects are excluded. Snapshot references defer freeing retired records, which are immediately unlinked from the live registry. See Appearance object lifetime. Hook lifetime follows the display. Cached secondary resources participate in both support detection and Xrm resource-class lookup.

The native fixture tests/automated/run-appearance-parity.py compares startup and live values on thirteen widget/gadget classes under light, dark and high-contrast profiles, including cached secondary resources. It also compares modern-created widgets restored to classic with independently constructed classic controls, exercises broad application wildcards and later resource edits, and checks private colormaps under an 8-bit X server. Color comparisons use actual RGB values, not pixel indices from unrelated colormaps. Run it against a selected out-of-tree build with --build /absolute/build and a fresh --out /absolute/task/appearance-parity directory. Its receipt records source and loaded-library fingerprints and each profile result.

Density and standard spacing

Density is independent of the selected palette and defaults to XmAPPEARANCE_DENSITY_COMFORTABLE. A modern application can select compact spacing before constructing its controls, in either order with profile selection:

XmSetAppearanceDensity(display, XmAPPEARANCE_DENSITY_COMPACT);
XmSetAppearanceProfile(display, XmAPPEARANCE_MODERN_LIGHT);

XmSetAppearanceDensity accepts a different setting only before registered controls exist; selecting the current density is idempotent. Use XmApplyAppearanceDensity to update an existing hierarchy. Profile changes retain the chosen density. Changing density while classic is active stores the selection for the next modern profile without changing classic widget values. XmGetAppearanceDensity reports the selection. Invalid arguments fail without changing it. The APIs are UI-thread operations, with the same non-reentrant preflight transaction and override ownership as profile changes. Both profile and density setters reject calls during an active appearance transaction. RowColumn sibling-margin normalization is deferred until every child has its new resources; otherwise a sibling with old padding could overwrite a child's new padding midway through a density change. Ownership follows explicit application assignments, so internal parent-layout adjustments do not accidentally claim ownership of a child's margins.

Comfortable/compact defaults currently include horizontal button and toggle margins of 12/8, vertical margins of 4/2, toggle indicators of 18/16, text margins of 8/6 horizontally and 4/2 vertically, and list spacing of 4/2. Widgets and their gadget equivalents share these defaults. These resource values are the density foundation; the full measured-control height, font and per-widget DPI overhaul remains tracked in modern-visual-overhaul.md.

Applications can use the common spacing scale without duplicating constants:

Dimension gap;
if (XmGetAppearanceSpacing(display, XmAPPEARANCE_SPACING_MEDIUM, &gap))
    XtVaSetValues(row, XmNspacing, gap, NULL);

XmAPPEARANCE_SPACING_XS, SMALL, MEDIUM, LARGE and XL represent 4, 8, 12, 16 and 24 logical pixels. The query returns display pixels using the existing display-scale policy exactly once; do not multiply the result again. The scale is common to both densities. Invalid display/output/spacing arguments return False and leave the output untouched. Applications that explicitly set a returned dimension own that resource and should query it again when their layout handles a scale change.

Run tests/automated/run-appearance-parity.py --suite density with the same --build and fresh --out arguments as the parity suite. The density fixture covers both startup selection orders, realized startup/live parity on nine widget/gadget classes in vertical and horizontal RowColumns, preserved equal-valued X resources and explicit arguments, subsequent and equal-valued SetValues assignments on widgets and cached gadgets, profile independence, classic isolation, reentrancy, text/toggle state and callback preservation, and spacing queries at 1x/1.5x/2x/3x. The allocation-failure fixture also checks density rollback and a successful retry.

Remaining overhaul qualification

The full visual overhaul is still in progress. Native resource parity and classic restoration are qualified for the representative classes described above. Neither these API tests nor spacing-query scale tests establish the full rendered control, font, DPI or accessibility matrix; see modern-visual-overhaul.md.

Cached gadgets inherit their parent's unstyled color baseline during construction, while explicit parent colors remain authoritative. This avoids saving a modern parent's palette as a gadget's classic defaults. Pixel conversion uses Xt's cache and the widget's actual colormap, including custom colormaps; it does not allocate against the default screen colormap.

Semantic roles (ABI 9 development)

XmNappearanceRole is a native unsigned-byte resource inherited by Primitive, Manager and Gadget subclasses. It describes presentation without changing the widget's interaction or accessibility role. C and UIL use these constants:

ConstantIntended presentation
XmAPPEARANCE_ROLE_NORMALBody text and ordinary controls
XmAPPEARANCE_ROLE_PAGE_TITLEPage title, sans-serif 18 pt
XmAPPEARANCE_ROLE_SECTIONSection heading, sans-serif 12 pt bold
XmAPPEARANCE_ROLE_SECONDARYSupporting text with subdued foreground
XmAPPEARANCE_ROLE_CODEMonospace 11 pt
XmAPPEARANCE_ROLE_PRIMARYEmphasized action
XmAPPEARANCE_ROLE_DESTRUCTIVEDestructive action

X resource values are normal, page_title, section, secondary, code, primary and destructive. The default is normal. Invalid assignments retain an existing valid role, or use normal at construction, and emit an Xt warning. Changing the resource with XtSetValues stages new toolkit-owned appearance resources for the affected subtree. A preparation failure restores the previous role. Classic appearance retains its original resource values.

Modern default tables use measured font extents. Explicit widget fontList and renderTable values remain application-owned, including equal-valued live assignments. Appearance preparation retains explicit child tables before committing parent controls, so a composite's propagation cannot replace those choices. Standard dialog font defaults retain their provider provenance.

ComboBox text/list children, Scale title gadgets and internally created TabStack tab boxes inherit their owner's semantic font role. Toolkit-internal font arguments do not count as independent application choices. A direct child font assignment remains authoritative during a theme transaction; an explicit parent font assignment continues to propagate to its implementation children.

ComboBox natural geometry is recomputed when its font changes, including before the first realization. Explicit width and height remain fixed independently; setting either dimension to zero returns that axis to natural sizing. tests/automated/run-composite-appearance-fonts.py checks live role/profile/scale updates, explicit fonts, startup text fit and explicit/natural dimensions.

This ABI 9 work is under qualification. The complete inherited-font, composite, DPI, non-Xft, native-consumer and actual-window acceptance matrix must pass before this package is published or the visual overhaul is considered complete.

Scrolled content framing

Modern light and dark profiles give scrolled content a single flat outer frame, with zero XmNspacing between its viewport and navigators. The scrollbars touch the content, match the content background and share the perimeter and corner junction. Both automatic viewports and application-defined scrolled lists use this layout, in every scrollbar placement. MainWindow work-area offsets are preserved. Embedded fields and lists do not paint a second outer frame.

The default frame is one logical pixel. Explicit nonzero spacing opts into the separated layout; explicit frame thickness remains authoritative. Classic and high-contrast profiles retain their existing layouts. Keyboard focus and list item selection remain available inside the shared surface.

tests/automated/run-scrolled-appearance.py checks exact navigator/viewport edge contact, frame corner pixels, live profile changes, all four placements, RTL layout, 1x/2x scaling and allocations down to one pixel. Gallery and Periodic are also inspected from freshly verified native builds.

Qualification on Linux/aarch64 used Xft/SVG and core-font builds. The final run-scrolled-appearance.py --prefix <install> --out <fresh-directory> runs passed in both; their libXm SHA-256 values were 903f3804bece48cda168f4925297d2a4eeed13f26c1efc0b993a64ed156a4549 and 7936b59963d5adeae288f1d8271a5b33e5d5be39995af2817f21d5d8ff42714b. run-scrollbar-interactions.py passed on the Xft/SVG build. The wheel and Periodic appearance runners passed before the final corner-fill-only change; verified gallery and Periodic windows were then inspected using the final build.

Modern text frames (development)

TextField and Text use a shared flat border in modern light/dark profiles. shadowThickness defaults to one logical pixel and highlightThickness to two; explicit application values retain ownership. The dark border uses a subdued color rather than the old black/gray bevel. Classic and high contrast retain their original shadow rendering. tests/automated/run-modern-fields.py exercises both text renderers, densities, 1x/1.5x/2x/3x scaling, editing, focus, disabled state and explicit resources. Explicit-width ownership during initial modern font application is covered by the dimension regression described below.

Dimension ownership and resource databases

Application-supplied nonzero width and height independently constrain appearance updates. The appearance transaction passes the current allocation alongside its font/spacing changes, preserving subsequent parent layout decisions rather than reapplying obsolete requested pixels. Zero releases the appearance constraint; unconstrained dimensions continue to derive from the control's font and content. Resource-file dimensions follow the same ownership rules, including zero values. TextField honors explicit equal-valued dimensions during font updates.

Successful profile/density transactions merge their staged resources into the existing Xrm database. Xt's cached per-screen resource lookup therefore retains the same database identity, and controls created after a theme change still see application resources. Failed preparation leaves the database unchanged. tests/automated/run-appearance-dimensions.py covers initial and live geometry, independent axes, equal-value setters, parent allocations and resource files.

Modern scrollbars (development)

Modern light/dark scrollbars use an eight-logical-pixel rail and rounded thumb inside the full drag target. A minimum thumb length of 24 logical pixels remains bounded by the available track. Modern defaults retain an end arrow on each side, rendered as bounded chevrons without outer bevels. An explicit showArrows: none remains authoritative. Explicit frame widths use a flat border. Scale's embedded shadowed slider also uses the visible modern thumb; thermometer fill geometry and marks retain their semantics.

Modern default scrollbar thickness is 18 logical pixels in comfortable density and 16 in compact density, scaled with the widget's display scale. Appearance updates adjust the orientation's short axis only when the application has not set that dimension explicitly. Automatic and application-defined ScrolledWindow layouts consume content space for thickness changes within the outer allocation. ScrolledWindow negotiates its own DPI-default size changes with its parent, so fixed Form attachments remain authoritative. Its navigator window borders remain parent-owned. Setting the short-axis dimension to zero returns it to automatic thickness immediately. Orientation updates resolve the new short axis against the current profile, density and scale; explicitly constrained dimensions remain unchanged.

showArrows, sliderVisual, and troughColor now participate in appearance resource ownership. Explicit application settings survive live changes, and classic/high-contrast restore their original defaults. Painting resolves the committed profile so cached pixmaps cannot retain an earlier theme. Disabled value updates use the same subdued rendering as expose events.

tests/automated/run-modern-scrollbars.py checks native pixels, startup/live parity, drag callbacks, keyboard increments, reversed directions, value endpoints, minimum thumb length, disabled updates, and explicit resource preservation across light, dark, classic and high-contrast transitions at three scales.

Modern buttons (development)

PushButton and PushButtonGadget share a flat rounded frame in modern profiles, with theme-owned one-logical-pixel borders, two-pixel focus space, and measured comfortable/compact padding. Pressed fills respect armColor and fillOnArm; primary/destructive appearance roles retain their semantic colors. Default buttons receive accent emphasis in the same frame. Notebook tabs retain their connected page border and menu items retain their menu painting paths.

DrawnButton uses the same frame without repainting the application-owned center. Widget/gadget buttons and DrawnButton retain pointer-inside state independently of armed state, preventing an expose event from restoring pressed feedback after a drag outside. Their epoch 9 private records require matching consumer headers.

Label and LabelGadget now honor explicit width/height arguments even when equal to the current dimensions. Font, string, or margin changes in the same SetValues call no longer discard those dimensions. This also lets the appearance owner preserve constrained axes through theme/density/scale changes. Zero restores natural sizing. Gallery button examples and their disabled/selected variants use natural dimensions and measured spacing.

The native button matrix covers ordinary/primary/destructive roles, widget and gadget variants, densities/scales, pressed/disabled/default states, drag-out expose, classic/high-contrast repaint continuity, and DrawnButton custom content. The dimension matrix includes labels and their button subclasses in every profile.

Disabled label text

Label and LabelGadget, including their button and toggle subclasses, expose XmNinsensitiveForeground (XmCInsensitiveForeground, type Pixel). Modern light uses #747b84; modern dark uses #9aa0a6. Modern disabled text, mnemonic underlines and accelerators use a single color without an offset embossed shadow. Classic retains its shadow treatment.

Explicit application colors survive live profile changes. Setting the resource to XmUNSPECIFIED_PIXEL selects the historical bottom-shadow-color fallback. Changes to that fallback and inherited gadget shadow colors refresh the text GCs, with balanced releases of all three label GCs.

tests/automated/run-disabled-labels.py exercises disabled label, push-button and toggle widget/gadget rendering, mnemonics, explicit colors, fallback color updates and live classic/modern transitions at 1x, 1.5x and 2x. It also checks menu accelerator text for both widget and gadget paths. The semantic roles UIL fixture verifies the resource in compiled widget/gadget definitions.

Default-action button geometry

Modern default-action emphasis occupies the existing button frame. Changing XmNshowAsDefault, preparing a dialog default button, or setting XmNdefaultButtonShadowThickness does not enlarge a modern PushButton or PushButtonGadget, alter its public focus width, or move its label. The resource values remain available; classic appearance uses them for its outer frame.

A live profile change removes or restores the actual classic frame reservation. Layout uses the target profile during the appearance transaction, including for buttons whose other resources are all application-owned. Label positioning is updated even when the parent keeps the same allocation.

tests/automated/run-default-button-geometry.py checks natural and fixed allocations, widget and gadget forms, default-at-creation, dialog default preparation and repeated classic/modern transitions at 1x, 1.5x and 2x.

Shared modern frames and gadget colors

Modern light and dark profiles use equal top/bottom shadow colors and a one-logical-pixel default border. This makes inherited frame rendering flat without changing classic or high-contrast shading. Explicit shadow colors and widths remain application-owned across profile changes. RowColumn work areas, radio boxes and option menus retain their internally owned shadow geometry; live profile updates assign shadow widths only to popup/pulldown panes and menu bars. Composite selectors do not forward their own profile settings to children during a toolkit commit: each descendant has an independent resource plan. Explicit child styling survives, and ordinary application SetValues retains its existing propagation behavior.

LabelGadget and its button/toggle subclasses export their own cached topShadowColor, bottomShadowColor and highlightColor through XtGetValues. Previously inherited synthetic exports returned the parent's colors even when the gadget painted different colors. Correct queries also keep classic color snapshots accurate during modern profile transitions. Dark toggle widgets and gadgets share the same indicator border default.

tests/automated/run-modern-borders.py checks all four rendered frame edges, titled frames, 1x/1.5x/2x scales, classic/modern transitions, explicit colors and widths, gadget color exports and absence of RowColumn resource warnings.

Modern IconGadget defaults use shadowThickness: 0, leaving artwork and labels unframed. Focus and selection remain the gadget's existing interactive states. Explicit shadow thicknesses remain application-owned across theme changes; classic and high-contrast retain their shadow defaults.

Scale presentation

Modern profiles distinguish a Scale value from a scrollable viewport. A Scale uses a thin track and a round outlined thumb, with the minimum-to-value range colored using the highlight color. The existing slider rectangle remains the full drag target. Processing direction controls which end represents minimum. Disabled controls use the neutral track color. Ordinary ScrollBars retain viewport-sized capsule thumbs.

Natural Scale major/minor extents use display scaling (100/24 logical pixels plus focus margins). Explicit XmNscaleWidth and XmNscaleHeight retain their pixel dimensions. Classic and high-contrast natural defaults are unchanged. Modern defaults remove the outer shadow and etched thumb mark; explicit XmNshadowThickness and XmNsliderMark remain authoritative. Marker ownership participates in live appearance transactions and classic restoration. Thermometer mode retains its range-fill rendering and endpoint marker.

Internal geometry measurement uses the target profile and density while widget resources and the subsequent cross-child layout are committed. Public profile and density getters continue to expose committed settings until the transaction succeeds. This prevents natural-size widgets from measuring against old density minimums or retaining modern minimums while restoring classic appearance.

Composite foreground ownership

NumberBox registers its native editor, arrows and validation label as foreground consumers. Only an application-owned parent foreground overrides their normal palette. Constructor arguments, resource-file values and later setters all establish ownership, including setters equal to the previous default. A child with its own foreground remains independently styled. Profile transactions use this relationship without turning inherited writes into application overrides; input backgrounds keep their native appearance surface.

Rounded button focus

Modern push buttons, push-button gadgets, drawn buttons and icon buttons use a concentric rounded focus band. Its inner boundary follows the button face, so the accent stroke retains its thickness through each corner. Face repaints restore the complete band, while focus removal preserves application-drawn content inside the rounded face. Native pixel tests cover light/dark profiles, comfortable/compact density and 1×, 1.5× and 2× scale.

Dialog action sizing

Modern light and dark MessageBox and SelectionBox action rows reserve at least 80 logical pixels per button in comfortable density, or 64 in compact density. The minimum follows the display scale; longer and translated labels retain their natural width. Existing equal-width row alignment and modern font/padding apply. XmNminimizeButtons=True requests natural widths instead. Classic and high contrast keep their existing layout. This policy belongs to dialog action rows; it does not enlarge toolbar icons or menu items.

check-default-button-geometry.c exercises single-action MessageBoxes and SelectionBoxes with short/long labels, both densities, 1x/2x scales, Classic and both modern profiles, and natural-size opt-out transitions, alongside the existing default-emphasis geometry regression. Default-action highlight exports subtract the classic frame adjustment only when that frame is actually reserved. The native runner supports Linux and macOS/XQuartz with an isolated Xvfb server.

Container presentation and recreated gadgets

Modern Container outlines use flat IconGadget surfaces, themed foreground and background, no connecting lines, and density-scaled item padding and icon spacing. Classic and high-contrast presentation and explicit application resources retain their existing behavior.

run-container-appearance.py --build BUILD --results OUT exercises the actual gallery Container factory. It repeatedly creates/destroys 100 previews without requiring a theme change between them, verifies reuse of gadget addresses, and checks resource ownership, rendered row backgrounds, colored icon pixmaps, live theme/scale changes and explicit application overrides. This covers the case where stale appearance state previously skipped modern defaults on a replacement gadget.

Historical composite reflow, natural sizing, and context-menu entries (WP-46)

XmPanedWindow, XmPaned, XmSash, XmSpinBox, XmSimpleSpinBox, XmComboBox, XmTabBox, XmTabStack, and XmContainer participate in creation-time and live XmApplyAppearanceProfile / XmApplyAppearanceDensity transactions:

  • XmPanedWindow and XmPaned apply profile-specific shadowThickness and sashShadowThickness (0 and 1 in modern-light/modern-dark, 2 in high-contrast) and density-specific marginWidth, marginHeight, spacing, sashWidth, and sashHeight (12 in comfortable, 10 in compact), and reflow unconstrained child panes bottom-up after child font and margin updates commit.
  • XmSpinBox refreshes its arrow and insensitive GCs when background or foreground changes and preserves caller-constrained XmNwidth / XmNheight during live margin and shadow-thickness updates.
  • XmBreadcrumbBar, XmDropHighlight, XmInfoBar, XmDataGrid, XmTreeView, XmSidebar, and XmCommandPalette compute natural font- and model-backed dimensions when constructed without explicit XmNwidth / XmNheight.
  • <Xm/RowColumn.h> provides XmContextMenuEntry, XmCreateContextMenuEntry, and XmRowColumnSetContextMenuEntries for opt-in icon, mnemonic, separator, and right-aligned XmNacceleratorText entries in XmMENU_POPUP and XmMENU_PULLDOWN menus.
  • Qualified under Xvfb by tests/automated/run-wp46-composite-polish.py.

Xrm semantic palette tokens and WCAG contrast guardrails (WP-47)

Applications and users can customize the accent, destructive, and surface colors of modern-light and modern-dark profiles through optional display-level Xrm token resources in <Xm/Appearance.h>:

  • XmNaccentColor / XmCAccentColor (*accentColor)
  • XmNaccentForeground / XmCAccentForeground (*accentForeground)
  • XmNdangerColor / XmCDangerColor (*dangerColor)
  • XmNsurfaceBackground / XmCSurfaceBackground (*surfaceBackground)

When any token is supplied, libXm deterministically derives dependent interactive states (focus ring highlightColor, selection and armed fills, XmLink foreground, toggle selectColor, primary and destructive button backgrounds/foregrounds/armed fills, and neutral button and field surfaces) and enforces WCAG contrast guardrails (at least 4.5:1 for normal text and 3.0:1 for focus/interactive indicators), clamping or falling back with an XmeWarning when a token is invalid or violates minimum contrast. Qualified at both 24-bit TrueColor and 8-bit PseudoColor under Xvfb by tests/automated/run-semantic-palette-tokens.py.

Modern MWM window-frame appearance, Xft typography, and HiDPI integration (WP-48)

clients/mwm resolves the display's appearanceProfile (classic, modern-light, modern-dark, high-contrast), appearanceDensity (comfortable, compact), and DPI scale factor (Xft.dpi / XLibre DPI) during ProcessWmResources:

  • In modern profiles, mwm defaults to flat one-logical-pixel outer and inner frame borders, distinct active and inactive titlebar surfaces (#DCE6F7 / #E8ECF2 in modern-light, #263248 / #181B20 in modern-dark, #0038A8 / #FFFFFF in high-contrast), Xft anti-aliased titlebar typography (_XmAppearanceCreateRenderTable with XmRenderTableGetDefaultFontExtents), DPI-scaled resizeBorderWidth, frameBorderWidth, and titlebar padding, and crisp geometric titlebar button glyphs (system menu, minimize, maximize).
  • Explicit .mwmrc and user X resource overrides (clientDecoration, matteWidth, explicit frame colors and fontList) remain authoritative, and classic profile retains its traditional 3D bevels and corner stretcher grooves.
  • Qualified across classic, modern-light, modern-dark, and high-contrast at 1x and 2x scales under Xvfb by tests/automated/run-mwm-modern-appearance.py.

Interactive UX polish: hover affordances, focus-visible, and wheel scrolling (WP-49)

Modern appearance profiles (modern-light and modern-dark) provide restrained, non-animated interactive ergonomics while keeping classic behavior unchanged:

  • Pointer hover affordances: XmPushButton, XmToggleButton, XmComboBox triggers, XmNotebook tabs, and XmList, XmTreeView, and XmDataGrid rows render a subtle hover surface/border tint on EnterNotify/MotionNotify and restore their base state on LeaveNotify, UnmapNotify, or profile changes to classic.
  • Focus-visible policy (XmNfocusHighlightPolicy): XmDisplay exposes XmNfocusHighlightPolicy (XmCFocusHighlightPolicy, representation XmRFocusHighlightPolicy) with values XmFOCUS_HIGHLIGHT_ALWAYS (default) and XmFOCUS_HIGHLIGHT_KEYBOARD. When XmFOCUS_HIGHLIGHT_KEYBOARD is selected, pointer clicks assign input focus without drawing redundant button, list, or tree focus rings (text entry widgets retain their focus border), and any subsequent keyboard traversal key (Tab or arrow keys) immediately restores visible focus rings.
  • Standardized mouse-wheel scrolling and boundary forwarding: XmList, XmText, XmTreeView, and XmDataGrid scroll on Button4 / Button5 wheel events and forward wheel events via _XmForwardWheelEvent to an enclosing XmScrolledWindow when the inner control is already at its scroll boundary.
  • Qualified under Xvfb by tests/automated/run-ux-polish-wp49.py.

Desktop selection and drag-and-drop interoperability: XDND v5, UTF8_STRING, and text/uri-list (WP-50)

libXm provides transparent selection, clipboard, and drag-and-drop interoperability with modern X11 and Xwayland clients:

  • Target constants and bounded helpers (<Xm/Transfer.h>): defines XmSTEXT_URI_LIST ("text/uri-list"), XmSTEXT_PLAIN_UTF8 ("text/plain;charset=utf-8"), XmSTEXT_PLAIN ("text/plain"), and XmSIMAGE_PNG ("image/png"), along with bounded helpers XmeParseUriList, XmeFreeUriList, XmeFormatUriList, XmeUriToLocalPath, and XmeValidatePngData that reject embedded NULs, control characters, remote authorities, and malformed or oversized PNG chunks.
  • UTF8_STRING and text/uri-list selection/drop priority: XmClipboard, XmText, XmTextField, and XmList advertise and prioritize UTF8_STRING (plus text/plain;charset=utf-8 and text/plain), and XmText and XmTextField accept text/uri-list drops by decoding local file:// URIs.
  • Transparent XDND v5 protocol bridge: top-level shells with registered XmDropSite widgets advertise XdndAware (version 5) alongside _MOTIF_DRAG_RECEIVER_INFO and translate incoming XdndEnter (including XdndTypeList), XdndPosition, XdndLeave, and XdndDrop messages into standard Motif XmDropSiteManager and XmDropTransfer transactions over XdndSelection, replying with XdndStatus and XdndFinished without changing public Motif callback signatures. On the initiator side, XmDragStart claims XdndSelection alongside XmNiccHandle and binds XmNiccHandle to the active selection atom during XmNconvertProc callbacks so callers invoking XtGetSelectionRequest receive the live request event.
  • Qualified under Xvfb by tests/automated/run-xdnd-interop-wp50.py.

Live RESOURCE_MANAGER and XmColorObj palette synchronization

Realized shells install a non-invasive PropertyNotify watcher on the root window (XA_RESOURCE_MANAGER) and active XmColorObj CUSTOMIZE_DATA owner (SDT Pixel Set / XmSPIXEL_SET_PROP, opt-out via *ckCoreMotif.liveAppearanceSync: False):

  • Coalesces property notifications onto a 0 ms XtAppAddTimeOut callback on the UI thread (observable by both XtAppMainLoop and XtAppPending event loops), refreshes XmColorObj pixel sets via _XmColorObjRefreshDisplay, and recolors ColorObj-backed widgets and gadgets while preserving explicit application/resource XmNbackground and XmNforeground overrides (still updating XmNhighlightColor when sourced from the active ColorObj slot).
  • Harmonizes multi-slot XmColorObj palettes (primary, secondary, text, and workspace switch slots) in modern_light and modern_dark with tinted modern surfaces, recessed input wells (preserving surface-matched XmNbackground and XmNtroughColor on XmScale, its internal Scrollbar, and standalone XmScrollBar tracks while matching recessed list/text wells inside XmScrolledWindow viewports), elevated button faces whose TextRect clears/fills match _XmAppearanceButtonFacePixel, and subtle tonal 1 px borders while retaining raw XmColorObj pixels in original state and clearing 50_foreground shadow-dither pixmaps (XmCO_NO_DITHER / XmUNSPECIFIED_PIXMAP) on non-dithered palette slots so switching from pure black/white palettes back to classic restores crisp solid 3D bevel shadows on both existing and newly rebuilt controls without drift.
  • Preserves the previously applied profile/density baseline across app_db synchronization so apply_appearance_settings executes the full _XmApplyAppearanceChange widget transaction when transitioning between classic, modern_light, modern_dark, and high_contrast, refreshes XmCascadeButtonGadget, XmCascadeButton, and XmToggleButtonGadget enableEtchedInMenu background and arm GCs across both SetValues and XmQTcareParentVisual parent notifications so menu bars and pulldowns render uniform backgrounds after live theme switches, and falls back to Motif 1.2 XmGadgetClassPart.visual_change in _XmNotifyChildrenVisual when a custom gadget does not install XmQTcareParentVisual.
  • Checked by tests/automated/check-live-appearance-sync.py and Xvfb pixel regression tests/automated/run-elevated-button-label-bg.py.