mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-07 13:29:59 -05:00
opt: optimize global and above x11 window judge
This commit is contained in:
parent
337f7cdd74
commit
e374e9c530
2 changed files with 16 additions and 10 deletions
|
|
@ -397,20 +397,26 @@ static inline int client_should_ignore_focus(Client *c) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline int client_should_global(Client *c) {
|
||||
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
struct wlr_xwayland_surface *surface = c->surface.xwayland;
|
||||
|
||||
if (surface->sticky)
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int client_should_overtop(Client *c) {
|
||||
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
struct wlr_xwayland_surface *surface = c->surface.xwayland;
|
||||
const uint32_t over_top_types[] = {
|
||||
WLR_XWAYLAND_NET_WM_WINDOW_TYPE_UTILITY};
|
||||
for (size_t i = 0;
|
||||
i < sizeof(over_top_types) / sizeof(over_top_types[0]); ++i) {
|
||||
if (wlr_xwayland_surface_has_window_type(surface,
|
||||
over_top_types[i])) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (surface->above)
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue