Menu icon indicating copy to clipboard operation
Menu copied to clipboard

Show Menu when application is in full screen and mouse is moved to the top

Open louies0623 opened this issue 2 years ago • 6 comments

When the application is in full screen, the top menu is not displayed when the mouse is moved to the top.

louies0623 avatar Sep 08 '23 23:09 louies0623

Good idea. But I currently have no clue how to implement this.

probonopd avatar Sep 10 '23 20:09 probonopd

Menu currently has set:

% xprop | grep ATOM
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_CHANGE_DESKTOP
_NET_WM_STATE(ATOM) = _NET_WM_STATE_ABOVE, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_SKIP_TASKBAR, _NET_WM_STATE_SKIP_PAGER, _KDE_NET_WM_STATE_SKIP_SWITCHER
XdndAware(ATOM) = BITMAP
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DOCK
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST

A full screen browser window has:

% sleep 5 && xprop | grep ATOM
XdndTypeList(ATOM) = STRING, TEXT, UTF8_STRING, _NETSCAPE_URL, text/x-moz-url, text/plain, chromium/x-renderer-taint, text/html
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE
_NET_WM_STATE(ATOM) = _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_FOCUSED
XdndAware(ATOM) = BITMAP
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, _NET_WM_PING, _NET_WM_SYNC_REQUEST

So the first step would be to find a way to make the Menu appear on top of the full screen application (z-stacking order). Then, we would need to check whether any application is full-screen, and set the menu to transparent unless the mouse touches the top area of the screen on which the Menu is.

probonopd avatar Sep 10 '23 20:09 probonopd

It seems that the _NET_WM_STATE_FULLSCREEN hint takes precedence over _NET_WM_STATE_ABOVE. Full-screen windows are handled differently by the window manager (KWin), and they seem to cover all other windows, including those set as "above."

probonopd avatar Sep 10 '23 20:09 probonopd

Strangely, even when we also set _NET_WM_STATE_FULLSCREEN (_NET_WM_STATE(ATOM) = _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_ABOVE, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_SKIP_TASKBAR, _NET_WM_STATE_SKIP_PAGER, _KDE_NET_WM_STATE_SKIP_SWITCHER), it still is not above a full-screen browser window.

probonopd avatar Sep 10 '23 20:09 probonopd

Adding the following to ~/.config/kwinrc also doesn't change this:

[Windows]
WindowClassName=Menu             
State=Above

So if anyone has any idea, please let me know.

probonopd avatar Sep 10 '23 20:09 probonopd

Interestingly, ksnip and the Menu seach box manage to be above even fullscreen. How? Does it have to do with WM_TAKE_FOCUS?

probonopd avatar Oct 01 '23 22:10 probonopd