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

Should need separate decoration control. #3730

Open
HyeokSuLee opened this issue Jun 14, 2024 · 8 comments · May be fixed by #4100
Open

Should need separate decoration control. #3730

HyeokSuLee opened this issue Jun 14, 2024 · 8 comments · May be fixed by #4100
Labels
DS - windows S - enhancement Wouldn't this be the coolest?

Comments

@HyeokSuLee
Copy link

HyeokSuLee commented Jun 14, 2024

Description

I need to remove title and default 3 buttons, but only resizable functionality alive.
This is must have option for custom close,min,max buttons.

Relevant platforms

Windows

@HyeokSuLee HyeokSuLee added the S - enhancement Wouldn't this be the coolest? label Jun 14, 2024
@madsmtm
Copy link
Member

madsmtm commented Jun 14, 2024

I think you can do this already with Window::set_enabled_buttons?

@HyeokSuLee
Copy link
Author

Thx but I’ve done that already. With all three buttons false, the title bar and non working close button are still showing.

@aspect
Copy link

aspect commented Jun 14, 2024

We are running into the same problem. The following EGUI example demonstrates this behavior:

https://github.com/emilk/egui/tree/master/examples/custom_window_frame

It appears winit treats "decorations" as a combined titlebar+resizing option, whereas on Windows OS this is not the case. Each window has 2 distinct styles WS_CAPTION and WS_THICKFRAME (https://learn.microsoft.com/en-us/windows/win32/winmsg/window-styles)

WS_CAPTION controls the visibility of the title bar, while WS_THICKFRAME controls the ability of the window to resize.

Currently, as both are handled as one, it is not possible to hide the caption while retaining the ability of the window to resize.

On other OSes (like MacOS, Linux) the behavior is as expected - you can hide the caption bar and still resize the window.

@tsuza
Copy link

tsuza commented Oct 12, 2024

On other OSes (like MacOS, Linux) the behavior is as expected - you can hide the caption bar and still resize the window.

I'm running Gnome as the DE and Wayland as the window manager, and that does not seem to be the case. I can only resize it if I manually choose the resize option in the context menu ( SUPER + right click ).

@NovaliX-Dev
Copy link

On other OSes (like MacOS, Linux) the behavior is as expected - you can hide the caption bar and still resize the window.

I'm running Gnome as the DE and Wayland as the window manager, and that does not seem to be the case. I can only resize it if I manually choose the resize option in the context menu ( SUPER + right click ).

Can confirm I don't have the expected behavior either. I'm running on KDE Plasma with Fedora 41 and Wayland.

@Sognus
Copy link

Sognus commented Nov 27, 2024

I am experiencing the same issue on Windows, where creating a window without decorations prevents me from resizing or moving it.

I managed to implement my desired solution using Windows API functions and custom WM_PROC handlers directly in C++. However, I’m unsure how to translate this solution into Rust.

The code for my C++ solution can be found here.
Additionally, there is an existing issue in the egui repository that discusses this problem: egui issue #4345.

@eugenesvk
Copy link

eugenesvk commented Jan 30, 2025

upd: added an extra option in the PR to allow removing the top resizing border when a window has no title bar

WS_CAPTION controls the visibility of the title bar, while WS_THICKFRAME controls the ability of the window to resize.

when you disable titlebar/caption but leave the resize border WS_SIZEBOX(=WS_THICKFRAME), you still get an ugly thick border at the top (but not at the sides/bottom)

Image

(bottom black is window content, top black is desktop, a bit confusing, sry)

so the practical utility of such separation might be questionable. Or maybe there is an extra flag that eliminates that top bar as well without affecting the resize border?

here is an issue https://stackoverflow.com/questions/75547245/when-ws-sizebox-is-set-even-if-ws-caption-is-canceled-the-title-bar-will-still suggesting it's possible to fix that as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DS - windows S - enhancement Wouldn't this be the coolest?
Development

Successfully merging a pull request may close this issue.

8 participants