diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/backend/wayland.h | 11 | ||||
-rw-r--r-- | include/backend/x11.h | 26 | ||||
-rw-r--r-- | include/rootston/desktop.h | 2 | ||||
-rw-r--r-- | include/rootston/server.h | 2 | ||||
-rw-r--r-- | include/rootston/view.h | 6 | ||||
-rw-r--r-- | include/wlr/backend/meson.build | 2 | ||||
-rw-r--r-- | include/wlr/backend/x11.h | 2 | ||||
-rw-r--r-- | include/wlr/config.h.in | 1 | ||||
-rw-r--r-- | include/wlr/meson.build | 2 | ||||
-rw-r--r-- | include/wlr/render/egl.h | 2 | ||||
-rw-r--r-- | include/wlr/render/interface.h | 2 | ||||
-rw-r--r-- | include/wlr/render/wlr_renderer.h | 5 | ||||
-rw-r--r-- | include/wlr/types/wlr_output.h | 19 | ||||
-rw-r--r-- | include/wlr/types/wlr_primary_selection.h | 4 | ||||
-rw-r--r-- | include/xwayland/xwm.h | 6 |
15 files changed, 45 insertions, 47 deletions
diff --git a/include/backend/wayland.h b/include/backend/wayland.h index 47585d9e..dbc309ca 100644 --- a/include/backend/wayland.h +++ b/include/backend/wayland.h @@ -2,10 +2,12 @@ #define BACKEND_WAYLAND_H #include <stdbool.h> + #include <wayland-client.h> #include <wayland-egl.h> #include <wayland-server.h> #include <wayland-util.h> + #include <wlr/backend/wayland.h> #include <wlr/render/egl.h> #include <wlr/render/wlr_renderer.h> @@ -32,6 +34,7 @@ struct wlr_wl_backend { struct wl_shm *shm; struct wl_seat *seat; struct wl_pointer *pointer; + struct wl_keyboard *keyboard; struct wlr_wl_pointer *current_pointer; char *seat_name; }; @@ -78,13 +81,11 @@ struct wlr_wl_pointer { struct wl_listener output_destroy; }; -struct wlr_wl_backend *get_wl_backend_from_backend( - struct wlr_backend *wlr_backend); -void poll_wl_registry(struct wlr_wl_backend *backend); +struct wlr_wl_backend *get_wl_backend_from_backend(struct wlr_backend *backend); void update_wl_output_cursor(struct wlr_wl_output *output); struct wlr_wl_pointer *pointer_get_wl(struct wlr_pointer *wlr_pointer); -void create_wl_pointer(struct wl_pointer *wl_pointer, - struct wlr_wl_output *output); +void create_wl_pointer(struct wl_pointer *wl_pointer, struct wlr_wl_output *output); +void create_wl_keyboard(struct wl_keyboard *wl_keyboard, struct wlr_wl_backend *wl); extern const struct wl_seat_listener seat_listener; diff --git a/include/backend/x11.h b/include/backend/x11.h index 37e3e4b6..1a8341f6 100644 --- a/include/backend/x11.h +++ b/include/backend/x11.h @@ -2,14 +2,17 @@ #define BACKEND_X11_H #include <stdbool.h> + +#include <X11/Xlib-xcb.h> #include <wayland-server.h> -#include <wlr/config.h> +#include <xcb/xcb.h> + #include <wlr/backend/x11.h> +#include <wlr/config.h> #include <wlr/interfaces/wlr_input_device.h> #include <wlr/interfaces/wlr_output.h> #include <wlr/render/egl.h> -#include <X11/Xlib-xcb.h> -#include <xcb/xcb.h> +#include <wlr/render/wlr_renderer.h> #define XCB_EVENT_RESPONSE_TYPE_MASK 0x7f @@ -30,6 +33,8 @@ struct wlr_x11_output { struct wl_event_source *frame_timer; int frame_delay; + + bool cursor_hidden; }; struct wlr_x11_backend { @@ -38,7 +43,7 @@ struct wlr_x11_backend { bool started; Display *xlib_conn; - xcb_connection_t *xcb_conn; + xcb_connection_t *xcb; xcb_screen_t *screen; size_t requested_outputs; @@ -61,14 +66,7 @@ struct wlr_x11_backend { // The time we last received an event xcb_timestamp_t time; - // A blank cursor - xcb_cursor_t cursor; - -#ifdef WLR_HAS_XCB_XKB - bool xkb_supported; - uint8_t xkb_base_event; - uint8_t xkb_base_error; -#endif + uint8_t xinput_opcode; struct wl_listener display_destroy; }; @@ -82,8 +80,8 @@ extern const struct wlr_keyboard_impl keyboard_impl; extern const struct wlr_pointer_impl pointer_impl; extern const struct wlr_input_device_impl input_device_impl; -void handle_x11_input_event(struct wlr_x11_backend *x11, - xcb_generic_event_t *event); +void handle_x11_xinput_event(struct wlr_x11_backend *x11, + xcb_ge_generic_event_t *event); void update_x11_pointer_position(struct wlr_x11_output *output, xcb_timestamp_t time); diff --git a/include/rootston/desktop.h b/include/rootston/desktop.h index 345c9c09..4ce92e2b 100644 --- a/include/rootston/desktop.h +++ b/include/rootston/desktop.h @@ -76,7 +76,7 @@ struct roots_desktop { struct wl_listener virtual_keyboard_new; struct wl_listener pointer_constraint; -#ifdef WLR_HAS_XWAYLAND +#if WLR_HAS_XWAYLAND struct wlr_xwayland *xwayland; struct wl_listener xwayland_surface; #endif diff --git a/include/rootston/server.h b/include/rootston/server.h index 7ab15682..1836a374 100644 --- a/include/rootston/server.h +++ b/include/rootston/server.h @@ -7,7 +7,7 @@ #include <wlr/config.h> #include <wlr/render/wlr_renderer.h> #include <wlr/types/wlr_data_device.h> -#ifdef WLR_HAS_XWAYLAND +#if WLR_HAS_XWAYLAND #include <wlr/xwayland.h> #endif #include "rootston/config.h" diff --git a/include/rootston/view.h b/include/rootston/view.h index 14448fc6..0c75737b 100644 --- a/include/rootston/view.h +++ b/include/rootston/view.h @@ -79,7 +79,7 @@ enum roots_view_type { ROOTS_WL_SHELL_VIEW, ROOTS_XDG_SHELL_V6_VIEW, ROOTS_XDG_SHELL_VIEW, -#ifdef WLR_HAS_XWAYLAND +#if WLR_HAS_XWAYLAND ROOTS_XWAYLAND_VIEW, #endif }; @@ -117,7 +117,7 @@ struct roots_view { struct wlr_wl_shell_surface *wl_shell_surface; struct wlr_xdg_surface_v6 *xdg_surface_v6; struct wlr_xdg_surface *xdg_surface; -#ifdef WLR_HAS_XWAYLAND +#if WLR_HAS_XWAYLAND struct wlr_xwayland_surface *xwayland_surface; #endif }; @@ -125,7 +125,7 @@ struct roots_view { struct roots_wl_shell_surface *roots_wl_shell_surface; struct roots_xdg_surface_v6 *roots_xdg_surface_v6; struct roots_xdg_surface *roots_xdg_surface; -#ifdef WLR_HAS_XWAYLAND +#if WLR_HAS_XWAYLAND struct roots_xwayland_surface *roots_xwayland_surface; #endif }; diff --git a/include/wlr/backend/meson.build b/include/wlr/backend/meson.build index e005b854..3d6f0e40 100644 --- a/include/wlr/backend/meson.build +++ b/include/wlr/backend/meson.build @@ -9,7 +9,7 @@ install_headers( subdir: 'wlr/backend', ) -if conf_data.get('WLR_HAS_X11_BACKEND', false) +if conf_data.get('WLR_HAS_X11_BACKEND', 0) == 1 install_headers('x11.h', subdir: 'wlr/backend') endif diff --git a/include/wlr/backend/x11.h b/include/wlr/backend/x11.h index 56360bf7..5793a3b9 100644 --- a/include/wlr/backend/x11.h +++ b/include/wlr/backend/x11.h @@ -2,7 +2,9 @@ #define WLR_BACKEND_X11_H #include <stdbool.h> + #include <wayland-server.h> + #include <wlr/backend.h> #include <wlr/types/wlr_input_device.h> #include <wlr/types/wlr_output.h> diff --git a/include/wlr/config.h.in b/include/wlr/config.h.in index 17277c07..94273fac 100644 --- a/include/wlr/config.h.in +++ b/include/wlr/config.h.in @@ -12,6 +12,5 @@ #mesondefine WLR_HAS_XCB_ERRORS #mesondefine WLR_HAS_XCB_ICCCM -#mesondefine WLR_HAS_XCB_XKB #endif diff --git a/include/wlr/meson.build b/include/wlr/meson.build index 43b5aec9..8874dbc7 100644 --- a/include/wlr/meson.build +++ b/include/wlr/meson.build @@ -15,7 +15,7 @@ install_headers( 'xcursor.h', subdir: 'wlr' ) -if conf_data.get('WLR_HAS_XWAYLAND', false) +if conf_data.get('WLR_HAS_XWAYLAND', 0) == 1 install_headers('xwayland.h', subdir: 'wlr') endif diff --git a/include/wlr/render/egl.h b/include/wlr/render/egl.h index 9ba2996a..fedb6fdd 100644 --- a/include/wlr/render/egl.h +++ b/include/wlr/render/egl.h @@ -11,7 +11,7 @@ #include <wlr/config.h> -#if !(defined(WLR_HAS_X11_BACKEND) || defined(WLR_HAS_WAYLAND)) +#if !WLR_HAS_X11_BACKEND && !WLR_HAS_XWAYLAND #define MESA_EGL_NO_X11_HEADERS #endif diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h index 9500bced..a7f97a89 100644 --- a/include/wlr/render/interface.h +++ b/include/wlr/render/interface.h @@ -11,7 +11,7 @@ #include <wlr/config.h> -#if !(defined(WLR_HAS_X11_BACKEND) || defined(WLR_HAS_WAYLAND)) +#if !WLR_HAS_X11_BACKEND && !WLR_HAS_XWAYLAND #define MESA_EGL_NO_X11_HEADERS #endif diff --git a/include/wlr/render/wlr_renderer.h b/include/wlr/render/wlr_renderer.h index 02b4a11e..9c031b7f 100644 --- a/include/wlr/render/wlr_renderer.h +++ b/include/wlr/render/wlr_renderer.h @@ -97,11 +97,6 @@ int wlr_renderer_get_dmabuf_formats(struct wlr_renderer *renderer, int wlr_renderer_get_dmabuf_modifiers(struct wlr_renderer *renderer, int format, uint64_t **modifiers); /** - * Get the preferred format for reading pixels. - */ -bool wlr_renderer_preferred_read_format(struct wlr_renderer *renderer, - enum wl_shm_format *fmt); -/** * Reads out of pixels of the currently bound surface into data. `stride` is in * bytes. * diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 9ccfbbb5..6d38152a 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -106,11 +106,6 @@ struct wlr_output { struct wl_event_source *idle_frame; - struct wlr_surface *fullscreen_surface; - struct wl_listener fullscreen_surface_commit; - struct wl_listener fullscreen_surface_destroy; - int fullscreen_width, fullscreen_height; - struct wl_list cursors; // wlr_output_cursor::link struct wlr_output_cursor *hardware_cursor; int software_cursor_locks; // number of locks forcing software cursors @@ -198,6 +193,12 @@ void wlr_output_effective_resolution(struct wlr_output *output, */ bool wlr_output_make_current(struct wlr_output *output, int *buffer_age); /** + * Get the preferred format for reading pixels. + * This function might change the current rendering context. + */ +bool wlr_output_preferred_read_format(struct wlr_output *output, + enum wl_shm_format *fmt); +/** * Swaps the output buffers. If the time of the frame isn't known, set `when` to * NULL. If the compositor doesn't support damage tracking, set `damage` to * NULL. @@ -226,8 +227,6 @@ bool wlr_output_set_gamma(struct wlr_output *output, size_t size, const uint16_t *r, const uint16_t *g, const uint16_t *b); bool wlr_output_export_dmabuf(struct wlr_output *output, struct wlr_dmabuf_attributes *attribs); -void wlr_output_set_fullscreen_surface(struct wlr_output *output, - struct wlr_surface *surface); struct wlr_output *wlr_output_from_resource(struct wl_resource *resource); /** * Locks the output to only use software cursors instead of hardware cursors. @@ -237,6 +236,12 @@ struct wlr_output *wlr_output_from_resource(struct wl_resource *resource); * a lock. */ void wlr_output_lock_software_cursors(struct wlr_output *output, bool lock); +/** + * Renders software cursors. This is a utility function that can be called when + * compositors render. + */ +void wlr_output_render_software_cursors(struct wlr_output *output, + pixman_region32_t *damage); struct wlr_output_cursor *wlr_output_cursor_create(struct wlr_output *output); diff --git a/include/wlr/types/wlr_primary_selection.h b/include/wlr/types/wlr_primary_selection.h index f33f6368..192bfc02 100644 --- a/include/wlr/types/wlr_primary_selection.h +++ b/include/wlr/types/wlr_primary_selection.h @@ -14,6 +14,7 @@ struct wlr_primary_selection_device_manager { struct wl_global *global; + struct wl_list resources; struct wl_listener display_destroy; @@ -24,8 +25,6 @@ struct wlr_primary_selection_device_manager { void *data; }; -struct wlr_primary_selection_offer; - struct wlr_primary_selection_source { // source metadata struct wl_array mime_types; @@ -36,7 +35,6 @@ struct wlr_primary_selection_source { void (*cancel)(struct wlr_primary_selection_source *source); // source status - struct wlr_primary_selection_offer *offer; struct wlr_seat_client *seat_client; struct { diff --git a/include/xwayland/xwm.h b/include/xwayland/xwm.h index dc40cc3e..c1be572b 100644 --- a/include/xwayland/xwm.h +++ b/include/xwayland/xwm.h @@ -5,10 +5,10 @@ #include <wlr/config.h> #include <wlr/xwayland.h> #include <xcb/render.h> -#ifdef WLR_HAS_XCB_ICCCM +#if WLR_HAS_XCB_ICCCM #include <xcb/xcb_icccm.h> #endif -#ifdef WLR_HAS_XCB_ERRORS +#if WLR_HAS_XCB_ERRORS #include <xcb/xcb_errors.h> #endif #include "xwayland/selection.h" @@ -122,7 +122,7 @@ struct wlr_xwm { struct wlr_xwayland_surface *drag_focus; const xcb_query_extension_reply_t *xfixes; -#ifdef WLR_HAS_XCB_ERRORS +#if WLR_HAS_XCB_ERRORS xcb_errors_context_t *errors_context; #endif |