Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No window title when running egui-app on Wayland #992

Closed
anarsoul opened this issue Dec 24, 2021 · 7 comments
Closed

No window title when running egui-app on Wayland #992

anarsoul opened this issue Dec 24, 2021 · 7 comments
Labels
bug Something is broken

Comments

@anarsoul
Copy link

anarsoul commented Dec 24, 2021

Describe the bug
There's no window title in window header when egui app is running on Wayland

To Reproduce
Steps to reproduce the behavior:
cd egui
cargo run --bin egui_demo_app

Window header is solid white.

Screenshot from 2021-12-23 21-48-55

Expected behavior

Window header contains window title that is returned by epi::App::name

Screenshots
See above

Desktop (please complete the following information):

  • OS: archlinux
  • Version: rolling release

Additional context

I understand that it's a winit/client-toolkit bug, see Smithay/client-toolkit#196

Basically neither winit nor client-toolkit want to mess with font rendering. Yet it affects egui. It would be nice to be able to render window decorations at egui level.

@anarsoul anarsoul added the bug Something is broken label Dec 24, 2021
@parasyte
Copy link
Contributor

AFAIK, the only cross-platform way to do this is creating the window without decorations and drawing client-side decorations, handling drag and double-click events in platform-specific ways, etc. And doing nothing on Android, iOS, and web platforms because they don't have window decorations anyway (at least the decorations cannot be controlled by winit). This is the method used by the Spotify and Discord clients, for example.

On the other hand, doing this client-side decorations thing only for Wayland might be an acceptable way to "plug the leak".

@emilk
Copy link
Owner

emilk commented Dec 30, 2021

A lot of egui users have been making their own decorations, so it is definitely possible (see for instance https://www.youtube.com/watch?v=NtUkr_z7l84). It would be very nice with an official eframe example for how to make your own window decoration.

Related to this: we need to fix #943 and add support for minimizing the native window.

@emilk
Copy link
Owner

emilk commented Apr 16, 2022

There is an example of painting your own window frame in https://github.com/emilk/egui/tree/master/examples/custom_window_frame

@Krysme
Copy link

Krysme commented Jul 19, 2022

There is an example of painting your own window frame in https://github.com/emilk/egui/tree/master/examples/custom_window_frame

I tried the example on Wayland, and the close button doesn't work. Once I clicked the close button, other buttons stop working. But then after I drag the window for a bit, it seems other buttons ( which control the theme) fall back to normal. However, the close button still doesn't do it's job after dragging.

@emilk
Copy link
Owner

emilk commented Jul 22, 2022

@Krysme have you tried debugging it? Is close_response.clicked() ever true? Is frame.quit(); called?

dbuch added a commit to dbuch/egui that referenced this issue Jul 31, 2022
For all dependents

Closes emilk#992
@flukejones
Copy link
Contributor

There is an example of painting your own window frame in https://github.com/emilk/egui/tree/master/examples/custom_window_frame

I tried the example on Wayland, and the close button doesn't work. Once I clicked the close button, other buttons stop working. But then after I drag the window for a bit, it seems other buttons ( which control the theme) fall back to normal. However, the close button still doesn't do it's job after dragging.

To do this for my own app I had to resize the title space. What seemed to be happening is the horizontal layout was overlapping the close button. See https://gitlab.com/asus-linux/asusctl/-/blob/main/rog-control-center/src/widgets/top_bar.rs#L50

@emilk
Copy link
Owner

emilk commented Aug 15, 2022

Closed by #1914

@emilk emilk closed this as completed Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

5 participants