mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-10-26 17:54:14 +00:00
fix: miss judgment on x11 pop-up windows that shouldn't focus
This commit is contained in:
parent
faa56cc9b9
commit
df58383e18
29
client.h
29
client.h
@ -382,6 +382,35 @@ client_set_suspended(Client *c, int suspended)
|
||||
wlr_xdg_toplevel_set_suspended(c->surface.xdg->toplevel, suspended);
|
||||
}
|
||||
|
||||
static inline int
|
||||
client_should_ignore_focus(Client *c) {
|
||||
#ifdef XWAYLAND
|
||||
int i;
|
||||
if (client_is_x11(c)) {
|
||||
struct wlr_xwayland_surface *surface = c->surface.xwayland;
|
||||
const uint32_t no_focus_types[] = {
|
||||
WLR_XWAYLAND_NET_WM_WINDOW_TYPE_COMBO,
|
||||
WLR_XWAYLAND_NET_WM_WINDOW_TYPE_DND,
|
||||
WLR_XWAYLAND_NET_WM_WINDOW_TYPE_DROPDOWN_MENU,
|
||||
WLR_XWAYLAND_NET_WM_WINDOW_TYPE_MENU,
|
||||
WLR_XWAYLAND_NET_WM_WINDOW_TYPE_NOTIFICATION,
|
||||
WLR_XWAYLAND_NET_WM_WINDOW_TYPE_POPUP_MENU,
|
||||
WLR_XWAYLAND_NET_WM_WINDOW_TYPE_SPLASH,
|
||||
WLR_XWAYLAND_NET_WM_WINDOW_TYPE_DESKTOP,
|
||||
WLR_XWAYLAND_NET_WM_WINDOW_TYPE_TOOLTIP,
|
||||
WLR_XWAYLAND_NET_WM_WINDOW_TYPE_UTILITY};
|
||||
for (i = 0;
|
||||
i < LENGTH(no_focus_types); ++i) {
|
||||
if (wlr_xwayland_surface_has_window_type(surface,
|
||||
no_focus_types[i])) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
client_wants_focus(Client *c)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user