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

Hiding window decorations #195

Open
dzaima opened this issue Feb 2, 2022 · 4 comments
Open

Hiding window decorations #195

dzaima opened this issue Feb 2, 2022 · 4 comments

Comments

@dzaima
Copy link
Contributor

dzaima commented Feb 2, 2022

For creating custom popup windows or similar, ability to hide window decorations (also, hiding it from the taskbar) is necessary.

Alternative would be to force everything to use native menus (#193).

For X11, this would involve setting this property with one of a variety of options, e.g.:

Atom type = _NET_WM_WINDOW_TYPE_POPUP_MENU;
XChangeProperty(instance->_windowManager.display,
                instance->_x11Window,
                _NET_WM_WINDOW_TYPE,
                XA_ATOM,
                32,
                PropModeReplace,
                (unsigned char *)&type,
                1);
@dzaima
Copy link
Contributor Author

dzaima commented Feb 2, 2022

Noticed that there's setZOrder and setTitlebarVisible, guided by macOS, which together would handle some of that, but would need a 3rd thing to hide from taskbar. X11 does provide separate _NET_WM_STATE_MODAL to disable decorations (i.e. title bar) and _NET_WM_STATE_SKIP_TASKBAR to hide from taskbar, but doesn't seem to provide anything for just inheriting the z-order from a type.

@mworzala
Copy link
Contributor

mworzala commented Feb 3, 2022

There is also apparently https://developer.apple.com/documentation/appkit/nsapplicationactivationpolicy?language=objc for hiding from the dock on macOS. I haven't messed around with it at all yet.

@LuisThiamNye
Copy link
Contributor

What would the cross-platform API look like?

The way it seems to me is that in X11 you have to provide a specific window type, whereas macOS and Windows allow more individual control over window features.
https://docs.microsoft.com/en-us/windows/win32/winmsg/window-styles
https://developer.apple.com/documentation/appkit/nswindowstylemask?language=objc

A possible approach for JWM could be something like setWindowType which takes care of all the necessary details.

@tonsky
Copy link
Collaborator

tonsky commented Jun 23, 2022

Sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants