JWM is a cross-platform Java window management and OS integration library.
JWM aims to expose an interface that abstracts over window creation, input handling and OS integration. It’s planned to support all the primary desktop platforms:
- Windows
- macOS
- X11
- Wayland
Primary goals:
- Native JVM API
- High-quality OS integration (indistinguishable from native apps)
- Plays well with (but does not require) Skija
Motto: “Electron for JVM, without Chrome and JS”
Traditionally, Java UIs struggled with high-quality OS integration. JWM plans to bring it to modern standards by implementing those integrations from scratch in modern low-level OS-native APIs. Prior art:
AWT:
- Bullet-proof, works everywhere
- Event loop is two-threaded (lags in UI)
- Dated font management, color management, dpi management
- No vsync
JavaFX:
- Fixed threading model
- Performance is sometimes great, sometimes terrible
- Even more limited fonts/color/graphics API
- VSync is weird in multi-monitor case
- No real extensibility
- Tried at JetBrains
- Complicated event loop model (tries to unify desktop + web + mobile)
- https://github.com/rust-windowing/winit/blob/master/FEATURES.md
GLFW via LWJGL, SDL2:
- Game-oriented
- Bad window management
- No OS integration
- Create one window and go full-screen is the main use-case
Electron:
- Seems great, will use as inspiration
- https://www.electronjs.org/docs
Repository URL:
https://packages.jetbrains.team/maven/p/jwm/maven
Artifacts:
See Getting Started
Alpha. Expect API breakages.
Windows | macOS | X11 | |
---|---|---|---|
init | ✅ | ✅ | ✅ |
makeWindow | ✅ | #121 | ✅ |
start | ✅ | ✅ | ✅ |
getScreens | ✅ | ✅ | ✅ |
getPrimaryScreen | ✅ | ✅ | ✅ |
runOnUIThread | ✅ | ✅ | #113 |
terminate | ✅ | ✅ | ✅ |
Show notification | ❌ | ❌ | ❌ |
System Theme | ❌ | ❌ | ❌ |
Windows | macOS | X11 | |
---|---|---|---|
setEventListener | ✅ | ✅ | ✅ |
setTextInputClient | ✅ | ✅ | ✅ |
setTextInputEnabled | ✅ | ❌ | ❌ |
unmarkText | ✅ | ❌ | ❌ |
show | ✅ | ✅ | ✅ |
getWindowRect | ✅ | ✅ | #109 |
getContentRect | ✅ | ✅ | ✅ |
setWindowPosition | ✅ | ✅ | ✅ |
setWindowSize | ✅ | ✅ | #109 |
setContentSize | ✅ | ✅ | ✅ |
getScreen | ✅ | ✅ | ✅ |
requestFrame | ✅ | ✅ | #113 |
close | ✅ | #107 | ✅ |
minimize | ✅ | ✅ | ✅ |
maximize | ✅ | ✅ | ✅ |
restore | ✅ | ✅ | ✅ |
setTitle | ✅ | ✅ | ✅ |
setIcon | ✅ | ✅ | #95 |
Set system cursor | ✅ | ✅ | #99 |
Remove decorations | #75 | #75 | #75 |
Set custom cursor | ❌ | ❌ | ❌ |
openFile | ❌ | ❌ | ❌ |
openFolder | ❌ | ❌ | ❌ |
Transparency | ✅ | ❌ | ❌ |
Toggle Fullscreen | ❌ | ❌ | ❌ |
setMinimumSize | ❌ | ❌ | ❌ |
setMaximumSize | ❌ | ❌ | ❌ |
setResizable | ❌ | ❌ | ❌ |
Windows | macOS | X11 | |
---|---|---|---|
EventFrame | ✅ | ✅ | ✅ |
EventKey | #30 | #30 #87 | #30 |
EventMouseButton | ✅ | ✅ | ✅ |
EventMouseMove | ✅ | ✅ | ✅ |
EventMouseScroll | #115 | ✅ | #115 |
EventTextInput | ✅ | #105 | ✅ |
EventTextInputMarked | ✅ | ✅ | ✅ |
EventWindowCloseRequest | ✅ | ✅ | ✅ |
EventWindowMove | ✅ | #116 | ✅ |
EventWindowResize | ✅ | ✅ | ✅ |
EventWindowMinimize | ✅ | ✅ | #96 |
EventWindowMaximize | ✅ | ✅ | #96 |
EventWindowRestore | ✅ | ✅ | #96 |
EventWindowVisible | #140 | #140 | #140 |
EventWindowScreenChange | #117 | #117 | #117 |
Drag & Drop | ❌ | ❌ | ❌ |
Touch events | ❌ | ❌ | ❌ |
Theme Changed | ❌ | ❌ | ❌ |
Windows | macOS | X11 | |
---|---|---|---|
id | ✅ | ✅ | ✅ |
isPrimary | ✅ | ✅ | ✅ |
bounds | ✅ | ✅ | ✅ |
scale | ✅ | ✅ | ✅ |
workArea | ✅ | ✅ | #119 |
colorSpace | #122 | #122 | #122 |
Windows | macOS | X11 | |
---|---|---|---|
set | ✅ | #51 | ✅ |
get | ✅ | #51 | ✅ |
getFormats | ✅ | #51 | ✅ |
clear | ✅ | #51 | ✅ |
registerFormat | ✅ | #51 | ✅ |
Windows | macOS | X11 | |
---|---|---|---|
Raster | ✅ | #81 | ✅ |
OpenGL | ✅ | ✅ | ✅ |
DirectX 11 | ❌ | ➖ | ➖ |
DirectX 12 | ✅ | ➖ | ➖ |
Metal | ➖ | ✅ | ➖ |
Vulkan | ❌ | ➖ | ❌ |
Windows | macOS | X11 | |
---|---|---|---|
Run on GraalVM | ❌ | ❌ | ❌ |
App package | ❌ | ❌ | ❌ |
Prerequisites:
- Shared: Git, CMake, Ninja, C++ compiler, JDK 11+, $JAVA_HOME, Python 3
- Windows 10: Microsoft Visual C++ (MSVC), x64 Native Tools Command Prompt for VS
- Ubuntu 20.04:
libxcomposite-dev libxrandr-dev libgl1-mesa-dev libxi-dev libxcursor-dev
Run:
./script/build.py
Run examples:
./script/run.py
Run examples without building (use version from the table above):
./script/run.py --jwm-version <version>
PRs & issue reports are welcome!
Please read Conventions first.
If you are looking where to start, there’s a label: Good first issue.
Issues labeled “Design” and “Not sure” require prior discussion—leave a comment with your ideas!
Initial development sponsored by: