wlroots 0.12.0

Antonin Décimo (3):
       Fix typos
       Fix incorrect format parameters
       xwayland: free server in error path
 
 Daniel De Graaf (1):
       wlr_virtual_keyboard: fix fd leak
 
 Daniel Kondor (2):
       foreign-toplevel-management: report parent toplevel
       foreign toplevel: send parent event only to clients that support it
 
 Devin J. Pohly (1):
       drm: fix uninitialized read
 
 Drew DeVault (1):
       Remove xdg-shell v6
 
 Guido Cella (1):
       render: Don't crash on 0 dimensions
 
 Ilia Bozhinov (9):
       xwayland: do not allow apps to change focus after wlroots request
       make sure to fail setting gamma on disabled outputs
       backend/wayland: destroy relative pointer when output is disconnected
       wayland: emit relative pointer events only for current pointer
       xwayland: disconnect display destroy listener even if xwayland didn't initialize
       xwayland: add set_geometry event
       backend/wayland: add touch support to the wayland backend
       xdg_shell: fix a typo
       xdg_shell: handle inert popups
 
 Isaac Freund (6):
       xdg-shell: split last-acked and current state
       layer-shell: add for_each_popup
       layer-shell: error on 0 dimension without anchors
       xdg_positioner: remove unused field
       wlr_drag: remove unused point_destroy field
       xwayland: remove unused listener
 
 Kenny Levinsen (2):
       session: Add libseat backend
       session: Add missing init to direct-freebsd
 
 Marten Ringwelski (1):
       backend/drm: Check if output is enabled before sending frame event
 
 Mykola Orliuk (5):
       backend/wayland: manage cursor for current pointer
       backend/wayland: factor out wlr_wl_seat
       backend/wayland: add error flow in create_wl_seat
       backend/wayland: fix input creation error handling
       backend/wayland: fix some keyboard/touch leaks
 
 Patrick Steinhardt (1):
       session: Don't refuse unprivileged creation of "direct" backend
 
 Roman Gilg (3):
       output-management-v1: add head identifying events
       output-management-v1: send head identifying information
       output-management-v1: send complete head state on enable change
 
 Ronan Pigott (1):
       virtual_pointer: remember current axis for axis events
 
 Rouven Czerwinski (2):
       examples: remove unnecessary gles2.h imports
       xwm: add loop detection for read_surface_parent
 
 Ryan Walklin (4):
       Implement logind session SetType method to change session type to wayland
       Also set XDG_SESSION_TYPE
       Don't set XDG_SESSION_TYPE unless logind SetType succeeds
       Quieten failure to set login session type
 
 Scott Moreau (2):
       xwm: Set _NET_WM_STATE_FOCUSED property for the focused surface
       foreign toplevel: Fix whitespace error
 
 Simon Ser (31):
       xwayland/xwm: don't insert surface in list on error
       xwayland/xwm: add prop count assert in xsurface_set_net_wm_state
       xwayland/xwm: use initializer for props in xsurface_set_wm_state
       render/gles2: make wlr_gles2_texture_from_* private
       render/gles2: keep ref to wlr_gles2_renderer in wlr_gles2_texture
       render/gles2: make push/pop debug functions take a wlr_renderer
       render/gles2: remove gles2_procs
       gamma-control-v1: fix use-after-free in gamma_control_handle_set_gamma
       examples/simple: use wlr_output_preferred_mode
       examples/simple: use wlr_renderer instead of GL
       Remove unnecessary wl_display_dispatch calls
       output: introduce wlr_output_event_commit
       output-power-management-v1: listen to output commit
       examples/dmabuf-capture: add extra roundtrip for wl_output listener
       backend/session/libseat: register log handler
       backend: remove check for _WAYLAND_DISPLAY
       backend/libinput: improve logger callback
       render: define EGL_NO_PLATFORM_SPECIFIC_TYPES (#2452)
       backend/drm: fix "a page-flip is already pending" errors on modeset
       xwayland: minor code style fixes
       xwayland: log unhandled NET_WM_STATE property changes
       gamma-control-v1: apply gamma LUT when output gets enabled
       screencopy: stop setting needs_frame flag
       backend/drm: export pending FB in export_dmabuf, if any
       output: update docs to reflect reality
       output: add when field to wlr_output_event_commit
       export-dmabuf: export DMA-BUF on output commit
       screencopy: perform DMA-BUF copy on output commit
       screencopy: send failed when copying a DMA-BUF with a region
       input-method: send modifiers in set_keyboard
       Update version to 0.12.0
 
 Tobias Langendorf (1):
       xwm: add support for xwayland minimize
 
 Tudor Brindus (11):
       examples: use `perror` instead of `fprintf` GNU %m `printf` extension
       xwayland: using %m in `wlr_log` is broken, use `wlr_log_errno` instead
       xwayland: fix use-after-free in selection handling
       xwayland: introduce WLR_XWAYLAND for specifying which Xwayland to use
       xwayland: remove stale transfers from the same requestor
       xwayland: notify requestor when we fail to respond to their request
       xwayland: fix minor typo in debug log
       types/wlr_keyboard: use bitmasks for wlr_keyboard_led and wlr_keyboard_modifier enums
       types/wlr_output_layout: use bitmask for wlr_direction
       util/edges: use bitmask for wlr_edges
       render/dmabuf: use bitmask for wlr_dmabuf_attributes_flags
 
 Valentin (2):
       Use fixed size integer type
       Fix undefined behavior
 
 nerdopolis (1):
       Accommodate for CONFIG_VT=0, all TTYs are in seat0, but not all seat0s have TTYs
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEENP+VJs/vDpejQOLkD9574OiPXkgFAl+n+t4ACgkQD9574OiP
 Xkg8TRAAopnm99XA7TE3w0UEDhXUBvlWB05fS6M4wiSNXjMp1ENW0O7PGtIbZt1Y
 /mbJQ8yAXbT0i5X7aE6iKTW8GjHoWpwaYCL3BrDb8A8Hl2s04pxSiLL2JMbHyb02
 KsCjZSbCBGldmgYOaJZl9SM5TDSyYo8xwGprkRiqK8Nz/SL75+sR4Jf/iMfaP1Rx
 qu2o87z3B1DEX+dvf0UaStJSmAb5sBmEW0X8sj8jf6Iubwsxy0BjI00AoTa2TS7k
 U1h3QuHqFy65pVg9Hwe5jPsoKVN5UqFzZNFja+91fXcjohm4gRkrnPZHCXijAl5E
 +sNSkY0SjO1ci4KSRXRTzD9X7HfA2f4yGjDEjoKorop7kUVAHQeKfFbbrKEjoYao
 aJLCFCNjT2ednZJhteYXKEodYfQov6AEirPJtw+UEDe8JgLSDZJZtXnBXKBXEeFa
 BgEzkoQiKqA4J3ToEj2fWrNMLkjfnc99vGn3tso9wfVB93sfg8lX1L9BI9CklGuD
 je6inBDRTa/RmALe1IGE4Y2PwrlmtQqHVjqDKv5MDpy65ffuYS3bH18fSLTW2cWY
 zYQmFOuj1VHxqT1noKAqTeowR691KC7JmAG2RjOZK2huP1xkijdaOVCA4bWlEqS3
 zld5pUUJ4k30UJmJIUK1Vp9eCStnPvxti1ngfuLHZ6WCe/jT8Os=
 =2poj
 -----END PGP SIGNATURE-----

Merge tag '0.12.0' into color-profiles

wlroots 0.12.0

Antonin Décimo (3):
      Fix typos
      Fix incorrect format parameters
      xwayland: free server in error path

Daniel De Graaf (1):
      wlr_virtual_keyboard: fix fd leak

Daniel Kondor (2):
      foreign-toplevel-management: report parent toplevel
      foreign toplevel: send parent event only to clients that support it

Devin J. Pohly (1):
      drm: fix uninitialized read

Drew DeVault (1):
      Remove xdg-shell v6

Guido Cella (1):
      render: Don't crash on 0 dimensions

Ilia Bozhinov (9):
      xwayland: do not allow apps to change focus after wlroots request
      make sure to fail setting gamma on disabled outputs
      backend/wayland: destroy relative pointer when output is disconnected
      wayland: emit relative pointer events only for current pointer
      xwayland: disconnect display destroy listener even if xwayland didn't initialize
      xwayland: add set_geometry event
      backend/wayland: add touch support to the wayland backend
      xdg_shell: fix a typo
      xdg_shell: handle inert popups

Isaac Freund (6):
      xdg-shell: split last-acked and current state
      layer-shell: add for_each_popup
      layer-shell: error on 0 dimension without anchors
      xdg_positioner: remove unused field
      wlr_drag: remove unused point_destroy field
      xwayland: remove unused listener

Kenny Levinsen (2):
      session: Add libseat backend
      session: Add missing init to direct-freebsd

Marten Ringwelski (1):
      backend/drm: Check if output is enabled before sending frame event

Mykola Orliuk (5):
      backend/wayland: manage cursor for current pointer
      backend/wayland: factor out wlr_wl_seat
      backend/wayland: add error flow in create_wl_seat
      backend/wayland: fix input creation error handling
      backend/wayland: fix some keyboard/touch leaks

Patrick Steinhardt (1):
      session: Don't refuse unprivileged creation of "direct" backend

Roman Gilg (3):
      output-management-v1: add head identifying events
      output-management-v1: send head identifying information
      output-management-v1: send complete head state on enable change

Ronan Pigott (1):
      virtual_pointer: remember current axis for axis events

Rouven Czerwinski (2):
      examples: remove unnecessary gles2.h imports
      xwm: add loop detection for read_surface_parent

Ryan Walklin (4):
      Implement logind session SetType method to change session type to wayland
      Also set XDG_SESSION_TYPE
      Don't set XDG_SESSION_TYPE unless logind SetType succeeds
      Quieten failure to set login session type

Scott Moreau (2):
      xwm: Set _NET_WM_STATE_FOCUSED property for the focused surface
      foreign toplevel: Fix whitespace error

Simon Ser (31):
      xwayland/xwm: don't insert surface in list on error
      xwayland/xwm: add prop count assert in xsurface_set_net_wm_state
      xwayland/xwm: use initializer for props in xsurface_set_wm_state
      render/gles2: make wlr_gles2_texture_from_* private
      render/gles2: keep ref to wlr_gles2_renderer in wlr_gles2_texture
      render/gles2: make push/pop debug functions take a wlr_renderer
      render/gles2: remove gles2_procs
      gamma-control-v1: fix use-after-free in gamma_control_handle_set_gamma
      examples/simple: use wlr_output_preferred_mode
      examples/simple: use wlr_renderer instead of GL
      Remove unnecessary wl_display_dispatch calls
      output: introduce wlr_output_event_commit
      output-power-management-v1: listen to output commit
      examples/dmabuf-capture: add extra roundtrip for wl_output listener
      backend/session/libseat: register log handler
      backend: remove check for _WAYLAND_DISPLAY
      backend/libinput: improve logger callback
      render: define EGL_NO_PLATFORM_SPECIFIC_TYPES (#2452)
      backend/drm: fix "a page-flip is already pending" errors on modeset
      xwayland: minor code style fixes
      xwayland: log unhandled NET_WM_STATE property changes
      gamma-control-v1: apply gamma LUT when output gets enabled
      screencopy: stop setting needs_frame flag
      backend/drm: export pending FB in export_dmabuf, if any
      output: update docs to reflect reality
      output: add when field to wlr_output_event_commit
      export-dmabuf: export DMA-BUF on output commit
      screencopy: perform DMA-BUF copy on output commit
      screencopy: send failed when copying a DMA-BUF with a region
      input-method: send modifiers in set_keyboard
      Update version to 0.12.0

Tobias Langendorf (1):
      xwm: add support for xwayland minimize

Tudor Brindus (11):
      examples: use `perror` instead of `fprintf` GNU %m `printf` extension
      xwayland: using %m in `wlr_log` is broken, use `wlr_log_errno` instead
      xwayland: fix use-after-free in selection handling
      xwayland: introduce WLR_XWAYLAND for specifying which Xwayland to use
      xwayland: remove stale transfers from the same requestor
      xwayland: notify requestor when we fail to respond to their request
      xwayland: fix minor typo in debug log
      types/wlr_keyboard: use bitmasks for wlr_keyboard_led and wlr_keyboard_modifier enums
      types/wlr_output_layout: use bitmask for wlr_direction
      util/edges: use bitmask for wlr_edges
      render/dmabuf: use bitmask for wlr_dmabuf_attributes_flags

Valentin (2):
      Use fixed size integer type
      Fix undefined behavior

nerdopolis (1):
      Accommodate for CONFIG_VT=0, all TTYs are in seat0, but not all seat0s have TTYs
This commit is contained in:
Devin Bayer 2021-01-21 17:39:54 +01:00
commit 9d76bca931
105 changed files with 1680 additions and 3182 deletions

View file

@ -134,7 +134,7 @@ struct wlr_drm_connector {
struct wl_list link;
/*
* We've asked for a state change in the kernel, and yet to recieve a
* We've asked for a state change in the kernel, and yet to receive a
* notification for its completion. Currently, the kernel only has a
* queue length of 1, and no way to modify your submissions after
* they're sent.

View file

@ -0,0 +1,8 @@
#ifndef BACKEND_SESSION_SESSION_H
#define BACKEND_SESSION_SESSION_H
struct wlr_session;
void session_init(struct wlr_session *session);
#endif

View file

@ -38,12 +38,9 @@ struct wlr_wl_backend {
struct wp_presentation *presentation;
struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1;
struct zwp_relative_pointer_manager_v1 *zwp_relative_pointer_manager_v1;
struct wl_seat *seat;
struct wl_pointer *pointer;
struct wl_keyboard *keyboard;
struct wlr_wl_seat *seat;
struct wlr_wl_pointer *current_pointer;
struct zwp_tablet_manager_v2 *tablet_manager;
char *seat_name;
struct wlr_drm_format_set linux_dmabuf_v1_formats;
};
@ -107,13 +104,25 @@ struct wlr_wl_pointer {
struct wl_listener output_destroy;
};
struct wlr_wl_seat {
struct wl_seat *wl_seat;
char *name;
struct wl_touch *touch;
struct wl_pointer *pointer;
struct wl_keyboard *keyboard;
};
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_keyboard(struct wl_keyboard *wl_keyboard, struct wlr_wl_backend *wl);
void create_wl_touch(struct wl_touch *wl_touch, struct wlr_wl_backend *wl);
struct wlr_wl_input_device *create_wl_input_device(
struct wlr_wl_backend *backend, enum wlr_input_device_type type);
bool create_wl_seat(struct wl_seat *wl_seat, struct wlr_wl_backend *wl);
void destroy_wl_seats(struct wlr_wl_backend *wl);
extern const struct wl_seat_listener seat_listener;

View file

@ -15,17 +15,6 @@
#include <wlr/render/wlr_texture.h>
#include <wlr/util/log.h>
struct wlr_gles2_procs {
PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES;
PFNGLDEBUGMESSAGECALLBACKKHRPROC glDebugMessageCallbackKHR;
PFNGLDEBUGMESSAGECONTROLKHRPROC glDebugMessageControlKHR;
PFNGLPOPDEBUGGROUPKHRPROC glPopDebugGroupKHR;
PFNGLPUSHDEBUGGROUPKHRPROC glPushDebugGroupKHR;
PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC glEGLImageTargetRenderbufferStorageOES;
};
extern struct wlr_gles2_procs gles2_procs;
struct wlr_gles2_pixel_format {
enum wl_shm_format wl_format;
GLint gl_format, gl_type;
@ -62,6 +51,15 @@ struct wlr_gles2_renderer {
bool egl_image_oes;
} exts;
struct {
PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES;
PFNGLDEBUGMESSAGECALLBACKKHRPROC glDebugMessageCallbackKHR;
PFNGLDEBUGMESSAGECONTROLKHRPROC glDebugMessageControlKHR;
PFNGLPOPDEBUGGROUPKHRPROC glPopDebugGroupKHR;
PFNGLPUSHDEBUGGROUPKHRPROC glPushDebugGroupKHR;
PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC glEGLImageTargetRenderbufferStorageOES;
} procs;
struct {
struct {
GLuint program;
@ -87,7 +85,7 @@ struct wlr_gles2_renderer {
struct wlr_gles2_texture {
struct wlr_texture wlr_texture;
struct wlr_egl *egl;
struct wlr_gles2_renderer *renderer;
// Basically:
// GL_TEXTURE_2D == mutable
@ -110,13 +108,23 @@ const struct wlr_gles2_pixel_format *get_gles2_format_from_gl(
GLint gl_format, GLint gl_type, bool alpha);
const enum wl_shm_format *get_gles2_wl_formats(size_t *len);
struct wlr_gles2_renderer *gles2_get_renderer(
struct wlr_renderer *wlr_renderer);
struct wlr_gles2_texture *gles2_get_texture(
struct wlr_texture *wlr_texture);
void push_gles2_marker(const char *file, const char *func);
void pop_gles2_marker(void);
#define PUSH_GLES2_DEBUG push_gles2_marker(_WLR_FILENAME, __func__)
#define POP_GLES2_DEBUG pop_gles2_marker()
struct wlr_texture *gles2_texture_from_pixels(struct wlr_renderer *wlr_renderer,
enum wl_shm_format wl_fmt, uint32_t stride, uint32_t width, uint32_t height,
const void *data);
struct wlr_texture *gles2_texture_from_wl_drm(struct wlr_renderer *wlr_renderer,
struct wl_resource *data);
struct wlr_texture *gles2_texture_from_dmabuf(struct wlr_renderer *wlr_renderer,
struct wlr_dmabuf_attributes *attribs);
void push_gles2_debug_(struct wlr_gles2_renderer *renderer,
const char *file, const char *func);
#define push_gles2_debug(renderer) push_gles2_debug_(renderer, _WLR_FILENAME, __func__)
void pop_gles2_debug(struct wlr_gles2_renderer *renderer);
// color engine

View file

@ -1,47 +0,0 @@
#ifndef TYPES_WLR_XDG_SHELL_V6_H
#define TYPES_WLR_XDG_SHELL_V6_H
#include <wayland-server-core.h>
#include <wlr/types/wlr_xdg_shell_v6.h>
#include "xdg-shell-unstable-v6-protocol.h"
struct wlr_xdg_positioner_v6_resource {
struct wl_resource *resource;
struct wlr_xdg_positioner_v6 attrs;
};
extern const struct wlr_surface_role xdg_toplevel_v6_surface_role;
extern const struct wlr_surface_role xdg_popup_v6_surface_role;
uint32_t schedule_xdg_surface_v6_configure(struct wlr_xdg_surface_v6 *surface);
struct wlr_xdg_surface_v6 *create_xdg_surface_v6(
struct wlr_xdg_client_v6 *client, struct wlr_surface *surface,
uint32_t id);
void unmap_xdg_surface_v6(struct wlr_xdg_surface_v6 *surface);
void destroy_xdg_surface_v6(struct wlr_xdg_surface_v6 *surface);
void handle_xdg_surface_v6_commit(struct wlr_surface *wlr_surface);
void handle_xdg_surface_v6_precommit(struct wlr_surface *wlr_surface);
void create_xdg_positioner_v6(struct wlr_xdg_client_v6 *client, uint32_t id);
struct wlr_xdg_positioner_v6_resource *get_xdg_positioner_v6_from_resource(
struct wl_resource *resource);
void create_xdg_popup_v6(struct wlr_xdg_surface_v6 *xdg_surface,
struct wlr_xdg_surface_v6 *parent,
struct wlr_xdg_positioner_v6_resource *positioner, int32_t id);
void handle_xdg_surface_v6_popup_committed(struct wlr_xdg_surface_v6 *surface);
struct wlr_xdg_popup_grab_v6 *get_xdg_shell_v6_popup_grab_from_seat(
struct wlr_xdg_shell_v6 *shell, struct wlr_seat *seat);
void destroy_xdg_popup_v6(struct wlr_xdg_surface_v6 *surface);
void create_xdg_toplevel_v6(struct wlr_xdg_surface_v6 *xdg_surface,
uint32_t id);
void handle_xdg_surface_v6_toplevel_committed(struct wlr_xdg_surface_v6 *surface);
void send_xdg_toplevel_v6_configure(struct wlr_xdg_surface_v6 *surface,
struct wlr_xdg_surface_v6_configure *configure);
void handle_xdg_toplevel_v6_ack_configure(struct wlr_xdg_surface_v6 *surface,
struct wlr_xdg_surface_v6_configure *configure);
bool compare_xdg_surface_v6_toplevel_state(struct wlr_xdg_toplevel_v6 *state);
void destroy_xdg_toplevel_v6(struct wlr_xdg_surface_v6 *surface);
#endif

View file

@ -8,6 +8,8 @@
#mesondefine WLR_HAS_SYSTEMD
#mesondefine WLR_HAS_ELOGIND
#mesondefine WLR_HAS_LIBSEAT
#mesondefine WLR_HAS_X11_BACKEND
#mesondefine WLR_HAS_XWAYLAND

View file

@ -15,9 +15,9 @@
#define WLR_DMABUF_MAX_PLANES 4
enum wlr_dmabuf_attributes_flags {
WLR_DMABUF_ATTRIBUTES_FLAGS_Y_INVERT = 1,
WLR_DMABUF_ATTRIBUTES_FLAGS_INTERLACED = 2,
WLR_DMABUF_ATTRIBUTES_FLAGS_BOTTOM_FIRST = 4,
WLR_DMABUF_ATTRIBUTES_FLAGS_Y_INVERT = 1 << 0,
WLR_DMABUF_ATTRIBUTES_FLAGS_INTERLACED = 1 << 1,
WLR_DMABUF_ATTRIBUTES_FLAGS_BOTTOM_FIRST = 1 << 2,
};
struct wlr_dmabuf_attributes {

View file

@ -15,6 +15,9 @@
#ifndef EGL_NO_X11
#define EGL_NO_X11
#endif
#ifndef EGL_NO_PLATFORM_SPECIFIC_TYPES
#define EGL_NO_PLATFORM_SPECIFIC_TYPES
#endif
#include <wlr/config.h>

View file

@ -21,14 +21,6 @@ struct wlr_egl *wlr_gles2_renderer_get_egl(struct wlr_renderer *renderer);
bool wlr_gles2_renderer_check_ext(struct wlr_renderer *renderer,
const char *ext);
struct wlr_texture *wlr_gles2_texture_from_pixels(struct wlr_egl *egl,
enum wl_shm_format wl_fmt, uint32_t stride, uint32_t width, uint32_t height,
const void *data);
struct wlr_texture *wlr_gles2_texture_from_wl_drm(struct wlr_egl *egl,
struct wl_resource *data);
struct wlr_texture *wlr_gles2_texture_from_dmabuf(struct wlr_egl *egl,
struct wlr_dmabuf_attributes *attribs);
struct wlr_gles2_texture_attribs {
GLenum target; /* either GL_TEXTURE_2D or GL_TEXTURE_EXTERNAL_OES */
GLuint tex;

View file

@ -15,6 +15,9 @@
#ifndef EGL_NO_X11
#define EGL_NO_X11
#endif
#ifndef EGL_NO_PLATFORM_SPECIFIC_TYPES
#define EGL_NO_PLATFORM_SPECIFIC_TYPES
#endif
#include <EGL/egl.h>
#include <EGL/eglext.h>

View file

@ -136,7 +136,6 @@ struct wlr_drag {
struct wl_signal destroy;
} events;
struct wl_listener point_destroy;
struct wl_listener source_destroy;
struct wl_listener seat_client_destroy;
struct wl_listener icon_destroy;

View file

@ -29,12 +29,11 @@ struct wlr_export_dmabuf_frame_v1 {
struct wlr_export_dmabuf_manager_v1 *manager;
struct wl_list link; // wlr_export_dmabuf_manager_v1::frames
struct wlr_dmabuf_attributes attribs;
struct wlr_output *output;
bool cursor_locked;
struct wl_listener output_precommit;
struct wl_listener output_commit;
};
struct wlr_export_dmabuf_manager_v1 *wlr_export_dmabuf_manager_v1_create(

View file

@ -50,6 +50,7 @@ struct wlr_foreign_toplevel_handle_v1 {
char *title;
char *app_id;
struct wlr_foreign_toplevel_handle_v1 *parent;
struct wl_list outputs; // wlr_foreign_toplevel_v1_output
uint32_t state; // wlr_foreign_toplevel_v1_state
@ -104,6 +105,12 @@ struct wlr_foreign_toplevel_manager_v1 *wlr_foreign_toplevel_manager_v1_create(
struct wlr_foreign_toplevel_handle_v1 *wlr_foreign_toplevel_handle_v1_create(
struct wlr_foreign_toplevel_manager_v1 *manager);
/* Destroy the given toplevel handle, sending the closed event to any
* client. Also, if the destroyed toplevel is set as a parent of any
* other valid toplevel, clients still holding a handle to both are
* sent a parent signal with NULL parent. If this is not desired, the
* caller should ensure that any child toplevels are destroyed before
* the parent. */
void wlr_foreign_toplevel_handle_v1_destroy(
struct wlr_foreign_toplevel_handle_v1 *toplevel);
@ -126,4 +133,14 @@ void wlr_foreign_toplevel_handle_v1_set_activated(
void wlr_foreign_toplevel_handle_v1_set_fullscreen(
struct wlr_foreign_toplevel_handle_v1* toplevel, bool fullscreen);
/* Set the parent of a toplevel. If the parent changed from its previous
* value, also sends a parent event to all clients that hold handles to
* both toplevel and parent (no message is sent to clients that have
* previously destroyed their parent handle). NULL is allowed as the
* parent, meaning no parent exists. */
void wlr_foreign_toplevel_handle_v1_set_parent(
struct wlr_foreign_toplevel_handle_v1 *toplevel,
struct wlr_foreign_toplevel_handle_v1 *parent);
#endif

View file

@ -21,6 +21,10 @@ struct wlr_gamma_control_v1 {
struct wlr_output *output;
struct wl_list link;
uint16_t *table;
size_t ramp_size;
struct wl_listener output_commit_listener;
struct wl_listener output_destroy_listener;
void *data;

View file

@ -18,22 +18,22 @@
#define WLR_LED_COUNT 3
enum wlr_keyboard_led {
WLR_LED_NUM_LOCK = 1,
WLR_LED_CAPS_LOCK = 2,
WLR_LED_SCROLL_LOCK = 4,
WLR_LED_NUM_LOCK = 1 << 0,
WLR_LED_CAPS_LOCK = 1 << 1,
WLR_LED_SCROLL_LOCK = 1 << 2,
};
#define WLR_MODIFIER_COUNT 8
enum wlr_keyboard_modifier {
WLR_MODIFIER_SHIFT = 1,
WLR_MODIFIER_CAPS = 2,
WLR_MODIFIER_CTRL = 4,
WLR_MODIFIER_ALT = 8,
WLR_MODIFIER_MOD2 = 16,
WLR_MODIFIER_MOD3 = 32,
WLR_MODIFIER_LOGO = 64,
WLR_MODIFIER_MOD5 = 128,
WLR_MODIFIER_SHIFT = 1 << 0,
WLR_MODIFIER_CAPS = 1 << 1,
WLR_MODIFIER_CTRL = 1 << 2,
WLR_MODIFIER_ALT = 1 << 3,
WLR_MODIFIER_MOD2 = 1 << 4,
WLR_MODIFIER_MOD3 = 1 << 5,
WLR_MODIFIER_LOGO = 1 << 6,
WLR_MODIFIER_MOD5 = 1 << 7,
};
#define WLR_KEYBOARD_KEYS_CAP 32

View file

@ -138,6 +138,10 @@ struct wlr_layer_surface_v1 *wlr_layer_surface_v1_from_wlr_surface(
void wlr_layer_surface_v1_for_each_surface(struct wlr_layer_surface_v1 *surface,
wlr_surface_iterator_func_t iterator, void *user_data);
/* Calls the iterator function for each popup of this surface */
void wlr_layer_surface_v1_for_each_popup(struct wlr_layer_surface_v1 *surface,
wlr_surface_iterator_func_t iterator, void *user_data);
/**
* Find a surface within this layer-surface tree at the given surface-local
* coordinates. Returns the surface and coordinates in the leaf surface

View file

@ -163,7 +163,7 @@ struct wlr_output {
// Emitted right before commit
struct wl_signal precommit; // wlr_output_event_precommit
// Emitted right after commit
struct wl_signal commit;
struct wl_signal commit; // wlr_output_event_commit
// Emitted right after the buffer has been presented to the user
struct wl_signal present; // wlr_output_event_present
struct wl_signal enable;
@ -200,6 +200,12 @@ struct wlr_output_event_precommit {
struct timespec *when;
};
struct wlr_output_event_commit {
struct wlr_output *output;
uint32_t committed; // bitmask of enum wlr_output_state_field
struct timespec *when;
};
enum wlr_output_present_flag {
// The presentation was synchronized to the "vertical retrace" by the
// display hardware such that tearing does not happen.
@ -388,8 +394,7 @@ size_t wlr_output_get_gamma_size(struct wlr_output *output);
void wlr_output_set_gamma(struct wlr_output *output, size_t size,
const uint16_t *r, const uint16_t *g, const uint16_t *b);
/**
* Exports the output's current back-buffer as a DMA-BUF (ie. the buffer that
* will be displayed on next commit).
* Exports the last committed buffer as a DMA-BUF.
*
* The caller is responsible for cleaning up the DMA-BUF attributes.
*/

View file

@ -124,10 +124,10 @@ struct wlr_output *wlr_output_layout_get_center_output(
struct wlr_output_layout *layout);
enum wlr_direction {
WLR_DIRECTION_UP = 1,
WLR_DIRECTION_DOWN = 2,
WLR_DIRECTION_LEFT = 4,
WLR_DIRECTION_RIGHT = 8,
WLR_DIRECTION_UP = 1 << 0,
WLR_DIRECTION_DOWN = 1 << 1,
WLR_DIRECTION_LEFT = 1 << 2,
WLR_DIRECTION_RIGHT = 1 << 3,
};
/**

View file

@ -25,7 +25,7 @@ struct wlr_output_power_v1 {
struct wl_list link;
struct wl_listener output_destroy_listener;
struct wl_listener output_enable_listener;
struct wl_listener output_commit_listener;
void *data;
};

View file

@ -53,6 +53,7 @@ struct wlr_screencopy_frame_v1 {
struct wlr_output *output;
struct wl_listener output_precommit;
struct wl_listener output_commit;
struct wl_listener output_destroy;
struct wl_listener output_enable;

View file

@ -409,6 +409,12 @@ void wlr_seat_pointer_notify_enter(struct wlr_seat *wlr_seat,
*/
void wlr_seat_pointer_notify_clear_focus(struct wlr_seat *wlr_seat);
/**
* Warp the pointer of this seat to the given surface-local coordinates, without
* generating motion events.
*/
void wlr_seat_pointer_warp(struct wlr_seat *wlr_seat, double sx, double sy);
/**
* Notify the seat of motion over the given surface. Pass surface-local
* coordinates where the pointer motion occurred. Defers to any grab of the

View file

@ -48,8 +48,6 @@ struct wlr_xdg_client {
};
struct wlr_xdg_positioner {
struct wl_resource *resource;
struct wlr_box anchor_rect;
enum xdg_positioner_anchor anchor;
enum xdg_positioner_gravity gravity;
@ -124,6 +122,7 @@ struct wlr_xdg_toplevel {
struct wlr_xdg_toplevel_state client_pending;
struct wlr_xdg_toplevel_state server_pending;
struct wlr_xdg_toplevel_state last_acked;
struct wlr_xdg_toplevel_state current;
char *title;

View file

@ -1,374 +0,0 @@
/*
* This protocol is obsolete and will be removed in a future version. The
* recommended replacement is xdg-shell.
*/
/*
* This an unstable interface of wlroots. No guarantees are made regarding the
* future consistency of this API.
*/
#ifndef WLR_USE_UNSTABLE
#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
#endif
#ifndef WLR_TYPES_WLR_XDG_SHELL_V6_H
#define WLR_TYPES_WLR_XDG_SHELL_V6_H
#include <wayland-server-core.h>
#include <wlr/types/wlr_box.h>
#include <wlr/types/wlr_seat.h>
#include "xdg-shell-unstable-v6-protocol.h"
/**
* An interface enabling clients to turn their wl_surfaces into windows in a
* desktop environment.
*/
struct wlr_xdg_shell_v6 {
struct wl_global *global;
struct wl_list clients;
struct wl_list popup_grabs;
uint32_t ping_timeout;
struct wl_listener display_destroy;
struct {
/**
* The `new_surface` event signals that a client has requested to
* create a new shell surface. At this point, the surface is ready to
* be configured but is not mapped or ready receive input events. The
* surface will be ready to be managed on the `map` event.
*/
struct wl_signal new_surface;
struct wl_signal destroy;
} events;
void *data;
};
struct wlr_xdg_client_v6 {
struct wlr_xdg_shell_v6 *shell;
struct wl_resource *resource;
struct wl_client *client;
struct wl_list surfaces;
struct wl_list link; // wlr_xdg_shell_v6::clients
uint32_t ping_serial;
struct wl_event_source *ping_timer;
};
struct wlr_xdg_positioner_v6 {
struct wlr_box anchor_rect;
enum zxdg_positioner_v6_anchor anchor;
enum zxdg_positioner_v6_gravity gravity;
enum zxdg_positioner_v6_constraint_adjustment constraint_adjustment;
struct {
int32_t width, height;
} size;
struct {
int32_t x, y;
} offset;
};
struct wlr_xdg_popup_v6 {
struct wlr_xdg_surface_v6 *base;
struct wl_list link;
struct wl_resource *resource;
bool committed;
struct wlr_xdg_surface_v6 *parent;
struct wlr_seat *seat;
// Position of the popup relative to the upper left corner of the window
// geometry of the parent surface
struct wlr_box geometry;
struct wlr_xdg_positioner_v6 positioner;
struct wl_list grab_link; // wlr_xdg_popup_grab_v6::popups
};
// each seat gets a popup grab
struct wlr_xdg_popup_grab_v6 {
struct wl_client *client;
struct wlr_seat_pointer_grab pointer_grab;
struct wlr_seat_keyboard_grab keyboard_grab;
struct wlr_seat_touch_grab touch_grab;
struct wlr_seat *seat;
struct wl_list popups;
struct wl_list link; // wlr_xdg_shell_v6::popup_grabs
struct wl_listener seat_destroy;
};
enum wlr_xdg_surface_v6_role {
WLR_XDG_SURFACE_V6_ROLE_NONE,
WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL,
WLR_XDG_SURFACE_V6_ROLE_POPUP,
};
struct wlr_xdg_toplevel_v6_state {
bool maximized, fullscreen, resizing, activated;
uint32_t width, height;
uint32_t max_width, max_height;
uint32_t min_width, min_height;
// Since the fullscreen request may be made before the toplevel's surface
// is mapped, this is used to store the requested fullscreen output (if
// any) for wlr_xdg_toplevel_v6::client_pending.
struct wlr_output *fullscreen_output;
struct wl_listener fullscreen_output_destroy;
};
/**
* An xdg-surface is a user interface element requiring management by the
* compositor. An xdg-surface alone isn't useful, a role should be assigned to
* it in order to map it.
*
* When a surface has a role and is ready to be displayed, the `map` event is
* emitted. When a surface should no longer be displayed, the `unmap` event is
* emitted. The `unmap` event is guaranteed to be emitted before the `destroy`
* event if the view is destroyed when mapped.
*/
struct wlr_xdg_toplevel_v6 {
struct wl_resource *resource;
struct wlr_xdg_surface_v6 *base;
struct wlr_xdg_surface_v6 *parent;
bool added;
struct wlr_xdg_toplevel_v6_state client_pending;
struct wlr_xdg_toplevel_v6_state server_pending;
struct wlr_xdg_toplevel_v6_state current;
char *title;
char *app_id;
struct {
struct wl_signal request_maximize;
struct wl_signal request_fullscreen;
struct wl_signal request_minimize;
struct wl_signal request_move;
struct wl_signal request_resize;
struct wl_signal request_show_window_menu;
struct wl_signal set_parent;
struct wl_signal set_title;
struct wl_signal set_app_id;
} events;
};
struct wlr_xdg_surface_v6_configure {
struct wl_list link; // wlr_xdg_surface_v6::configure_list
uint32_t serial;
struct wlr_xdg_toplevel_v6_state *toplevel_state;
};
struct wlr_xdg_surface_v6 {
struct wlr_xdg_client_v6 *client;
struct wl_resource *resource;
struct wlr_surface *surface;
struct wl_list link; // wlr_xdg_client_v6::surfaces
enum wlr_xdg_surface_v6_role role;
union {
struct wlr_xdg_toplevel_v6 *toplevel;
struct wlr_xdg_popup_v6 *popup;
};
struct wl_list popups; // wlr_xdg_popup_v6::link
bool added, configured, mapped;
uint32_t configure_serial;
struct wl_event_source *configure_idle;
uint32_t configure_next_serial;
struct wl_list configure_list;
bool has_next_geometry;
struct wlr_box next_geometry;
struct wlr_box geometry;
struct wl_listener surface_destroy;
struct wl_listener surface_commit;
struct {
struct wl_signal destroy;
struct wl_signal ping_timeout;
struct wl_signal new_popup;
/**
* The `map` event signals that the shell surface is ready to be
* managed by the compositor and rendered on the screen. At this point,
* the surface has configured its properties, has had the opportunity
* to bind to the seat to receive input events, and has a buffer that
* is ready to be rendered. You can now safely add this surface to a
* list of views.
*/
struct wl_signal map;
/**
* The `unmap` event signals that the surface is no longer in a state
* where it should be shown on the screen. This might happen if the
* surface no longer has a displayable buffer because either the
* surface has been hidden or is about to be destroyed.
*/
struct wl_signal unmap;
} events;
void *data;
};
struct wlr_xdg_toplevel_v6_move_event {
struct wlr_xdg_surface_v6 *surface;
struct wlr_seat_client *seat;
uint32_t serial;
};
struct wlr_xdg_toplevel_v6_resize_event {
struct wlr_xdg_surface_v6 *surface;
struct wlr_seat_client *seat;
uint32_t serial;
uint32_t edges;
};
struct wlr_xdg_toplevel_v6_set_fullscreen_event {
struct wlr_xdg_surface_v6 *surface;
bool fullscreen;
struct wlr_output *output;
};
struct wlr_xdg_toplevel_v6_show_window_menu_event {
struct wlr_xdg_surface_v6 *surface;
struct wlr_seat_client *seat;
uint32_t serial;
uint32_t x, y;
};
struct wlr_xdg_shell_v6 *wlr_xdg_shell_v6_create(struct wl_display *display);
/**
* Send a ping to the surface. If the surface does not respond in a reasonable
* amount of time, the ping_timeout event will be emitted.
*/
void wlr_xdg_surface_v6_ping(struct wlr_xdg_surface_v6 *surface);
/**
* Request that this toplevel surface be the given size. Returns the associated
* configure serial.
*/
uint32_t wlr_xdg_toplevel_v6_set_size(struct wlr_xdg_surface_v6 *surface,
uint32_t width, uint32_t height);
/**
* Request that this toplevel surface show itself in an activated or deactivated
* state. Returns the associated configure serial.
*/
uint32_t wlr_xdg_toplevel_v6_set_activated(struct wlr_xdg_surface_v6 *surface,
bool activated);
/**
* Request that this toplevel surface consider itself maximized or not
* maximized. Returns the associated configure serial.
*/
uint32_t wlr_xdg_toplevel_v6_set_maximized(struct wlr_xdg_surface_v6 *surface,
bool maximized);
/**
* Request that this toplevel surface consider itself fullscreen or not
* fullscreen. Returns the associated configure serial.
*/
uint32_t wlr_xdg_toplevel_v6_set_fullscreen(struct wlr_xdg_surface_v6 *surface,
bool fullscreen);
/**
* Request that this toplevel surface consider itself to be resizing or not
* resizing. Returns the associated configure serial.
*/
uint32_t wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface,
bool resizing);
/**
* Request that this xdg surface closes.
*/
void wlr_xdg_surface_v6_send_close(struct wlr_xdg_surface_v6 *surface);
/**
* Find a surface within this xdg-surface tree at the given surface-local
* coordinates. Returns the surface and coordinates in the leaf surface
* coordinate system or NULL if no surface is found at that location.
*/
struct wlr_surface *wlr_xdg_surface_v6_surface_at(
struct wlr_xdg_surface_v6 *surface, double sx, double sy,
double *sub_x, double *sub_y);
/**
* Get the geometry for this positioner based on the anchor rect, gravity, and
* size of this positioner.
*/
struct wlr_box wlr_xdg_positioner_v6_get_geometry(
struct wlr_xdg_positioner_v6 *positioner);
/**
* Get the anchor point for this popup in the toplevel parent's coordinate system.
*/
void wlr_xdg_popup_v6_get_anchor_point(struct wlr_xdg_popup_v6 *popup,
int *toplevel_sx, int *toplevel_sy);
/**
* Convert the given coordinates in the popup coordinate system to the toplevel
* surface coordinate system.
*/
void wlr_xdg_popup_v6_get_toplevel_coords(struct wlr_xdg_popup_v6 *popup,
int popup_sx, int popup_sy, int *toplevel_sx, int *toplevel_sy);
/**
* Set the geometry of this popup to unconstrain it according to its
* xdg-positioner rules. The box should be in the popup's root toplevel parent
* surface coordinate system.
*/
void wlr_xdg_popup_v6_unconstrain_from_box(struct wlr_xdg_popup_v6 *popup,
struct wlr_box *toplevel_sx_box);
/**
Invert the right/left anchor and gravity for this positioner. This can be
used to "flip" the positioner around the anchor rect in the x direction.
*/
void wlr_positioner_v6_invert_x(
struct wlr_xdg_positioner_v6 *positioner);
/**
Invert the top/bottom anchor and gravity for this positioner. This can be
used to "flip" the positioner around the anchor rect in the y direction.
*/
void wlr_positioner_v6_invert_y(
struct wlr_xdg_positioner_v6 *positioner);
bool wlr_surface_is_xdg_surface_v6(struct wlr_surface *surface);
struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6_from_wlr_surface(
struct wlr_surface *surface);
/**
* Get the surface geometry.
* This is either the geometry as set by the client, or defaulted to the bounds
* of the surface + the subsurfaces (as specified by the protocol).
*
* The x and y value can be <0
*/
void wlr_xdg_surface_v6_get_geometry(struct wlr_xdg_surface_v6 *surface, struct wlr_box *box);
/**
* Call `iterator` on each surface and popup in the xdg-surface tree, with the
* surface's position relative to the root xdg-surface. The function is called
* from root to leaves (in rendering order).
*/
void wlr_xdg_surface_v6_for_each_surface(struct wlr_xdg_surface_v6 *surface,
wlr_surface_iterator_func_t iterator, void *user_data);
/**
* Call `iterator` on each popup in the xdg-surface tree, with the popup's
* position relative to the root xdg-surface. The function is called from root
* to leaves (in rendering order).
*/
void wlr_xdg_surface_v6_for_each_popup(struct wlr_xdg_surface_v6 *surface,
wlr_surface_iterator_func_t iterator, void *user_data);
#endif

View file

@ -19,10 +19,10 @@
enum wlr_edges {
WLR_EDGE_NONE = 0,
WLR_EDGE_TOP = 1,
WLR_EDGE_BOTTOM = 2,
WLR_EDGE_LEFT = 4,
WLR_EDGE_RIGHT = 8,
WLR_EDGE_TOP = 1 << 0,
WLR_EDGE_BOTTOM = 1 << 1,
WLR_EDGE_LEFT = 1 << 2,
WLR_EDGE_RIGHT = 1 << 3,
};
#endif

View file

@ -84,7 +84,6 @@ struct wlr_xwayland {
struct wl_listener server_ready;
struct wl_listener server_destroy;
struct wl_listener client_destroy;
struct wl_listener seat_destroy;
void *data;
@ -173,6 +172,7 @@ struct wlr_xwayland_surface {
bool modal;
bool fullscreen;
bool maximized_vert, maximized_horz;
bool minimized;
bool has_alpha;
@ -181,6 +181,7 @@ struct wlr_xwayland_surface {
struct wl_signal request_configure;
struct wl_signal request_move;
struct wl_signal request_resize;
struct wl_signal request_minimize;
struct wl_signal request_maximize;
struct wl_signal request_fullscreen;
struct wl_signal request_activate;
@ -196,6 +197,7 @@ struct wlr_xwayland_surface {
struct wl_signal set_hints;
struct wl_signal set_decorations;
struct wl_signal set_override_redirect;
struct wl_signal set_geometry;
struct wl_signal ping_timeout;
} events;
@ -221,6 +223,11 @@ struct wlr_xwayland_resize_event {
uint32_t edges;
};
struct wlr_xwayland_minimize_event {
struct wlr_xwayland_surface *surface;
bool minimize;
};
struct wlr_xwayland_server *wlr_xwayland_server_create(
struct wl_display *display, struct wlr_xwayland_server_options *options);
void wlr_xwayland_server_destroy(struct wlr_xwayland_server *server);
@ -250,6 +257,9 @@ void wlr_xwayland_surface_configure(struct wlr_xwayland_surface *surface,
void wlr_xwayland_surface_close(struct wlr_xwayland_surface *surface);
void wlr_xwayland_surface_set_minimized(struct wlr_xwayland_surface *surface,
bool minimized);
void wlr_xwayland_surface_set_maximized(struct wlr_xwayland_surface *surface,
bool maximized);

View file

@ -26,8 +26,10 @@
#ifndef XCURSOR_H
#define XCURSOR_H
typedef int XcursorBool;
typedef unsigned int XcursorUInt;
#include <stdint.h>
typedef int XcursorBool;
typedef uint32_t XcursorUInt;
typedef XcursorUInt XcursorDim;
typedef XcursorUInt XcursorPixel;

View file

@ -40,11 +40,14 @@ enum atom_name {
NET_ACTIVE_WINDOW,
NET_WM_MOVERESIZE,
NET_SUPPORTING_WM_CHECK,
NET_WM_STATE_FOCUSED,
NET_WM_STATE_MODAL,
NET_WM_STATE_FULLSCREEN,
NET_WM_STATE_MAXIMIZED_VERT,
NET_WM_STATE_MAXIMIZED_HORZ,
NET_WM_STATE_HIDDEN,
NET_WM_PING,
WM_CHANGE_STATE,
WM_STATE,
CLIPBOARD,
PRIMARY,
@ -125,6 +128,7 @@ struct wlr_xwm {
#if WLR_HAS_XCB_ERRORS
xcb_errors_context_t *errors_context;
#endif
unsigned int last_focus_seq;
struct wl_listener compositor_new_surface;
struct wl_listener compositor_destroy;