Merge pull request #851 from emersion/xwayland-window-type-menu
xwayland: add _NET_WM_WINDOW_TYPE_MENU support
This commit is contained in:
commit
cedd151e17
|
@ -53,12 +53,14 @@ enum atom_name {
|
||||||
TEXT,
|
TEXT,
|
||||||
TIMESTAMP,
|
TIMESTAMP,
|
||||||
DELETE,
|
DELETE,
|
||||||
|
NET_WM_WINDOW_TYPE_NORMAL,
|
||||||
NET_WM_WINDOW_TYPE_UTILITY,
|
NET_WM_WINDOW_TYPE_UTILITY,
|
||||||
NET_WM_WINDOW_TYPE_TOOLTIP,
|
NET_WM_WINDOW_TYPE_TOOLTIP,
|
||||||
NET_WM_WINDOW_TYPE_DND,
|
NET_WM_WINDOW_TYPE_DND,
|
||||||
NET_WM_WINDOW_TYPE_DROPDOWN_MENU,
|
NET_WM_WINDOW_TYPE_DROPDOWN_MENU,
|
||||||
NET_WM_WINDOW_TYPE_POPUP_MENU,
|
NET_WM_WINDOW_TYPE_POPUP_MENU,
|
||||||
NET_WM_WINDOW_TYPE_COMBO,
|
NET_WM_WINDOW_TYPE_COMBO,
|
||||||
|
NET_WM_WINDOW_TYPE_MENU,
|
||||||
DND_SELECTION,
|
DND_SELECTION,
|
||||||
DND_AWARE,
|
DND_AWARE,
|
||||||
DND_STATUS,
|
DND_STATUS,
|
||||||
|
|
|
@ -405,24 +405,3 @@ void wlr_xwayland_set_seat(struct wlr_xwayland *xwayland,
|
||||||
xwayland->seat_destroy.notify = wlr_xwayland_handle_seat_destroy;
|
xwayland->seat_destroy.notify = wlr_xwayland_handle_seat_destroy;
|
||||||
wl_signal_add(&seat->events.destroy, &xwayland->seat_destroy);
|
wl_signal_add(&seat->events.destroy, &xwayland->seat_destroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool wlr_xwayland_surface_is_unmanaged(const struct wlr_xwayland_surface *surface) {
|
|
||||||
static enum atom_name needles[] = {
|
|
||||||
NET_WM_WINDOW_TYPE_UTILITY,
|
|
||||||
NET_WM_WINDOW_TYPE_TOOLTIP,
|
|
||||||
NET_WM_WINDOW_TYPE_DND,
|
|
||||||
NET_WM_WINDOW_TYPE_DROPDOWN_MENU,
|
|
||||||
NET_WM_WINDOW_TYPE_POPUP_MENU,
|
|
||||||
NET_WM_WINDOW_TYPE_COMBO,
|
|
||||||
};
|
|
||||||
|
|
||||||
for (size_t i = 0; i < sizeof(needles) / sizeof(needles[0]); ++i) {
|
|
||||||
if (xwm_atoms_contains(surface->xwm, surface->window_type,
|
|
||||||
surface->window_type_len, needles[i])) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
|
@ -52,12 +52,14 @@ const char *atom_map[ATOM_LAST] = {
|
||||||
"TEXT",
|
"TEXT",
|
||||||
"TIMESTAMP",
|
"TIMESTAMP",
|
||||||
"DELETE",
|
"DELETE",
|
||||||
|
"_NET_WM_WINDOW_TYPE_NORMAL",
|
||||||
"_NET_WM_WINDOW_TYPE_UTILITY",
|
"_NET_WM_WINDOW_TYPE_UTILITY",
|
||||||
"_NET_WM_WINDOW_TYPE_TOOLTIP",
|
"_NET_WM_WINDOW_TYPE_TOOLTIP",
|
||||||
"_NET_WM_WINDOW_TYPE_DND",
|
"_NET_WM_WINDOW_TYPE_DND",
|
||||||
"_NET_WM_WINDOW_TYPE_DROPDOWN_MENU",
|
"_NET_WM_WINDOW_TYPE_DROPDOWN_MENU",
|
||||||
"_NET_WM_WINDOW_TYPE_POPUP_MENU",
|
"_NET_WM_WINDOW_TYPE_POPUP_MENU",
|
||||||
"_NET_WM_WINDOW_TYPE_COMBO",
|
"_NET_WM_WINDOW_TYPE_COMBO",
|
||||||
|
"_NET_WM_WINDOW_TYPE_MENU",
|
||||||
"XdndSelection",
|
"XdndSelection",
|
||||||
"XdndAware",
|
"XdndAware",
|
||||||
"XdndStatus",
|
"XdndStatus",
|
||||||
|
@ -1575,3 +1577,25 @@ bool xwm_atoms_contains(struct wlr_xwm *xwm, xcb_atom_t *atoms,
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wlr_xwayland_surface_is_unmanaged(
|
||||||
|
const struct wlr_xwayland_surface *surface) {
|
||||||
|
static enum atom_name needles[] = {
|
||||||
|
NET_WM_WINDOW_TYPE_COMBO,
|
||||||
|
NET_WM_WINDOW_TYPE_DND,
|
||||||
|
NET_WM_WINDOW_TYPE_DROPDOWN_MENU,
|
||||||
|
NET_WM_WINDOW_TYPE_MENU,
|
||||||
|
NET_WM_WINDOW_TYPE_POPUP_MENU,
|
||||||
|
NET_WM_WINDOW_TYPE_TOOLTIP,
|
||||||
|
NET_WM_WINDOW_TYPE_UTILITY,
|
||||||
|
};
|
||||||
|
|
||||||
|
for (size_t i = 0; i < sizeof(needles) / sizeof(needles[0]); ++i) {
|
||||||
|
if (xwm_atoms_contains(surface->xwm, surface->window_type,
|
||||||
|
surface->window_type_len, needles[i])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue