CodeName OneShai Almog3 min readintermediate
A Dialog Can Now Be a Native Desktop Window
Summary
Codename One now supports native desktop windows for dialogs, fixing a bug where dialogs appeared on the wrong surface in multi-window applications. This allows dialogs to participate correctly in desktop window ordering and focus, with options for global or per-instance native mode.
- Dialog.show() can now render as a native modal desktop window, configurable globally via `setDefaultNativeWindowMode(true)` or per-instance.
- The core fix involved correctly identifying the event source component's top-level container, rather than assuming a single 'current form'.
- Native dialogs participate in desktop window ordering, focus, and task switching, unlike lightweight dialogs painted inside their owner.
- Popups (e.g., combo-boxes, tooltips) remain lightweight; native mode is specifically for `Dialog` and `InteractionDialog` instances.
Engineers building multi-window desktop applications with Codename One will find this crucial for correct UI behavior, focus management, and security.
7/10