mirror of
https://github.com/labwc/labwc.git
synced 2026-02-12 04:27:57 -05:00
xwayland: use wlr_xwayland_surface_has_window_type()
This eliminates a bit of logic, including an extra XWayland connection. See also: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4553
This commit is contained in:
parent
a3d6226728
commit
fd5031731e
4 changed files with 52 additions and 99 deletions
|
|
@ -84,8 +84,15 @@ enum view_wants_focus {
|
|||
VIEW_WANTS_FOCUS_OFFER,
|
||||
};
|
||||
|
||||
/*
|
||||
* Window types are based on the NET_WM constants from X11. See:
|
||||
* https://specifications.freedesktop.org/wm-spec/1.4/ar01s05.html#id-1.6.7
|
||||
*
|
||||
* The enum constants are intended to match wlr_xwayland_net_wm_window_type.
|
||||
* Redefining the same constants here may seem redundant, but is necessary
|
||||
* to make them available even in builds with xwayland support disabled.
|
||||
*/
|
||||
enum window_type {
|
||||
/* 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,
|
||||
|
|
@ -151,7 +158,8 @@ struct view_impl {
|
|||
/* returns true if view reserves space at screen edge */
|
||||
bool (*has_strut_partial)(struct view *self);
|
||||
/* returns true if view declared itself a window type */
|
||||
bool (*contains_window_type)(struct view *view, int32_t window_type);
|
||||
bool (*contains_window_type)(struct view *view,
|
||||
enum window_type window_type);
|
||||
/* returns the client pid that this view belongs to */
|
||||
pid_t (*get_pid)(struct view *view);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,39 +4,12 @@
|
|||
#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;
|
||||
|
||||
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) == WINDOW_TYPE_LEN,
|
||||
"Xwayland atoms out of sync");
|
||||
|
||||
extern xcb_atom_t atoms[WINDOW_TYPE_LEN];
|
||||
|
||||
struct xwayland_unmanaged {
|
||||
struct server *server;
|
||||
struct wlr_xwayland_surface *xwayland_surface;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue