mirror of
https://github.com/labwc/labwc.git
synced 2025-11-01 22:58:47 -04:00
xwayland: support querying window types
This commit is contained in:
parent
9ecd8c2b43
commit
a04b394e59
3 changed files with 137 additions and 6 deletions
|
|
@ -220,7 +220,8 @@ struct server {
|
|||
struct wl_listener xdg_toplevel_decoration;
|
||||
#if HAVE_XWAYLAND
|
||||
struct wlr_xwayland *xwayland;
|
||||
struct wl_listener xwayland_ready;
|
||||
struct wl_listener xwayland_server_ready;
|
||||
struct wl_listener xwayland_xwm_ready;
|
||||
struct wl_listener xwayland_new_surface;
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,61 @@
|
|||
#ifndef LABWC_XWAYLAND_H
|
||||
#define LABWC_XWAYLAND_H
|
||||
#include "config.h"
|
||||
|
||||
#if HAVE_XWAYLAND
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <xcb/xcb.h>
|
||||
#include "common/macros.h"
|
||||
#include "view.h"
|
||||
|
||||
struct wlr_compositor;
|
||||
struct wlr_output;
|
||||
struct wlr_output_layout;
|
||||
|
||||
enum atom {
|
||||
/* https://specifications.freedesktop.org/wm-spec/wm-spec-1.4.html#idm45649101374512 */
|
||||
NET_WM_WINDOW_TYPE_DESKTOP = 0,
|
||||
NET_WM_WINDOW_TYPE_DOCK,
|
||||
NET_WM_WINDOW_TYPE_TOOLBAR,
|
||||
NET_WM_WINDOW_TYPE_MENU,
|
||||
NET_WM_WINDOW_TYPE_UTILITY,
|
||||
NET_WM_WINDOW_TYPE_SPLASH,
|
||||
NET_WM_WINDOW_TYPE_DIALOG,
|
||||
NET_WM_WINDOW_TYPE_DROPDOWN_MENU,
|
||||
NET_WM_WINDOW_TYPE_POPUP_MENU,
|
||||
NET_WM_WINDOW_TYPE_TOOLTIP,
|
||||
NET_WM_WINDOW_TYPE_NOTIFICATION,
|
||||
NET_WM_WINDOW_TYPE_COMBO,
|
||||
NET_WM_WINDOW_TYPE_DND,
|
||||
NET_WM_WINDOW_TYPE_NORMAL,
|
||||
|
||||
ATOM_LEN
|
||||
};
|
||||
|
||||
static const char * const atom_names[] = {
|
||||
"_NET_WM_WINDOW_TYPE_DESKTOP",
|
||||
"_NET_WM_WINDOW_TYPE_DOCK",
|
||||
"_NET_WM_WINDOW_TYPE_TOOLBAR",
|
||||
"_NET_WM_WINDOW_TYPE_MENU",
|
||||
"_NET_WM_WINDOW_TYPE_UTILITY",
|
||||
"_NET_WM_WINDOW_TYPE_SPLASH",
|
||||
"_NET_WM_WINDOW_TYPE_DIALOG",
|
||||
"_NET_WM_WINDOW_TYPE_DROPDOWN_MENU",
|
||||
"_NET_WM_WINDOW_TYPE_POPUP_MENU",
|
||||
"_NET_WM_WINDOW_TYPE_TOOLTIP",
|
||||
"_NET_WM_WINDOW_TYPE_NOTIFICATION",
|
||||
"_NET_WM_WINDOW_TYPE_COMBO",
|
||||
"_NET_WM_WINDOW_TYPE_DND",
|
||||
"_NET_WM_WINDOW_TYPE_NORMAL",
|
||||
};
|
||||
|
||||
static_assert(
|
||||
ARRAY_SIZE(atom_names) == ATOM_LEN,
|
||||
"Xwayland atoms out of sync");
|
||||
|
||||
extern xcb_atom_t atoms[ATOM_LEN];
|
||||
|
||||
struct xwayland_unmanaged {
|
||||
struct server *server;
|
||||
struct wlr_xwayland_surface *xwayland_surface;
|
||||
|
|
@ -40,10 +88,10 @@ struct xwayland_view {
|
|||
struct wl_listener set_decorations;
|
||||
struct wl_listener set_override_redirect;
|
||||
struct wl_listener set_strut_partial;
|
||||
struct wl_listener set_window_type;
|
||||
|
||||
/* Not (yet) implemented */
|
||||
/* struct wl_listener set_role; */
|
||||
/* struct wl_listener set_window_type; */
|
||||
/* struct wl_listener set_hints; */
|
||||
};
|
||||
|
||||
|
|
@ -57,6 +105,9 @@ void xwayland_adjust_stacking_order(struct server *server);
|
|||
|
||||
struct wlr_xwayland_surface *xwayland_surface_from_view(struct view *view);
|
||||
|
||||
bool xwayland_surface_contains_window_type(
|
||||
struct wlr_xwayland_surface *surface, enum atom window_type);
|
||||
|
||||
void xwayland_server_init(struct server *server,
|
||||
struct wlr_compositor *compositor);
|
||||
void xwayland_server_finish(struct server *server);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue