Urgent.News

What's breaking now, across thousands of outlets.

Tech

A Dialog Can Now Be a Native Desktop Window

Last week's native-window release could open an editor, inspector, and tool palette as separate operating-system windows. Then an ordinary Dialog.show() inside the inspector looked for the current Form and appeared on the wrong surface. What is Codename One? Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase.…

A new release of the Codename One framework allows dialogs to become native desktop windows. Previously, showing a dialog inside an inspector could cause it to appear on the wrong surface. The bug exposed a confusion between "top level" and "form". PR #5624 resolves this by making dialogs capable of becoming real desktop windows.

Two main types of dialogs remain: lightweight dialogs that paint inside their owner's layered pane and native desktop windows. To enable a dialog to be a native window, use Dialog.setDefaultNativeWindowMode(true);. This allows confirmation dialogs to function as native windows while preserving the existing static API.

Code that creates dialogs without a source component can explicitly bind them to a specific window using the setTopLevelHost() method. This ensures the dialog correctly participates in desktop window ordering, focus, and task switching.

The change in native-window mode is useful when a dialog must interact with desktop window ordering, focus, or task switching. However, it's not suitable for small prompts that should inherit the exact visual treatment of their owner. In such cases, lightweight mode is preferred.

Dialogs, sheets, toast bars, combo boxes, floating action buttons, infinite progress indicators, tooltips, and HTML components all had paths that queried the Display for the current Form. Those paths have been corrected to bind to the component causing the action, ensuring proper handling of accessibility state and not turning popups into unexpected windows.

A limitation of the native-window mode is that popups cannot become independent desktop windows, as this would break positioning and keyboard behavior. The new mode is limited to dialogs and interaction dialogs.

The transition between windows is not possible due to the lack of shared graphics context. Instead, changes to content within a window should be handled using setContent() with appropriate transitions.

The same contract applies across Windows and Mac platforms. The test suite verifies this consistency by opening controls in various window sizes and modal cases. This ensures that desktop work remains secure and visually consistent across ports.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The test that failed every morning and passed every afternoon

Originally published on the WatchNext blog . While making an unrelated change — adding a processor to a privacy page and a link to a footer — the test suite came back with eleven passes and one…

  • Test suite failed due to date measurement mismatch
  • UTC vs. U.S. timezone caused intermittent failures
  • Fix aligned test and function timezones

Why Timestamps Lie in Distributed Systems (and How Logical Clocks Fix It)

There's a line of code in almost every service that stores replicated data: def resolve ( incoming , stored ): # keep whichever write is "newer" return incoming if incoming . timestamp > stored .

  • Timestamps lie in distributed systems, leading to last-write-wins (LWW) corruption
  • Lamport clocks introduce causal order using integer per process, resolving conflicts

I Finally Published My First NPM Package! 🎉

Hello everyone 👋 I’m really happy to finally share my first NPM package: taglite 🚀 This package started from a simple need in one of my projects.

  • Author publishes first NPM package, taglite
  • taglite is lightweight React Tag Input component
  • Package offers zero runtime dependencies and TypeScript support

More from Saturday 12 September →