Custom window frames for Windows and Linux
Currently the viewer frame on Windows and Linux have an ugly platform-specific header with a title, close buttons, and a minimize button.
We should just replace those with our own window frame, like in https://github.com/emilk/egui/tree/master/examples/custom_window_frame
Needs some design though.
Blocked by:
- https://github.com/rerun-io/rerun/pull/997
- https://github.com/emilk/egui/issues/2680
TODO:
- [x] Fix window resizing UI on Wayland and Xorg
- [ ] Fix lower right corner (
paint_time_ranges_gaps). Maybe turn off rounding? - [ ] Test on Windows
- [ ] Custom icons for close/maximize/minimize
- [ ] I think we need to center the panel buttons?
What Rerun currently looks like on Gnome/xorg:

If you enable CUSTOM_WINDOW_DECORATIONS on main:
(once https://github.com/rerun-io/rerun/pull/1094 is merged)

There are a bunch of open issues with custom window frames in eframe: https://github.com/emilk/egui/issues?q=is%3Aissue+is%3Aopen+custom_window_frame
Custom decorations working fine on Linux/Wayland/Sway.
/// If true, we fill the entire window, except for the close/maximize/minimize buttons in the top-left.
/// See <https://github.com/emilk/egui/pull/2049>
-pub const FULLSIZE_CONTENT: bool = cfg!(target_os = "macos");
+pub const FULLSIZE_CONTENT: bool = true;
/// If true, we hide the native window decoration
/// (the top bar with app title, close button etc),
/// and instead paint our own close/maximize/minimize buttons.
-pub const CUSTOM_WINDOW_DECORATIONS: bool = false; // !FULLSIZE_CONTENT; // TODO(emilk): https://github.com/rerun-io/rerun/issues/1063
+pub const CUSTOM_WINDOW_DECORATIONS: bool = true; // !FULLSIZE_CONTENT; // TODO(emilk): https://github.com/rerun-io/rerun/issues/1063
Close button works as expected -- others don't but that's expected on my setup.
Using the same diff on Windows 11:
Minimize/maximize/close work.
Issues:
- minimize/maximize/close look unusually small for windows, close button doesn't get red on hover like most other applications (btw. some fade red in some don't... I miss the good old days of native ui everywhere :( )
- window corners are not transparent/cutout
- resize at window border doesn't work
I miss the good old days of native ui everywhere
You work for the wrong company 😅
I'm pretty sure if me or @nikolausWest worked on a Linux or Windows machine, this issue would have a much higher priority