Skip to content

Commit

Permalink
Merge pull request #180 from heuer/backend_multi
Browse files Browse the repository at this point in the history
Added is_multi property to Backend
  • Loading branch information
flacjacket authored Apr 16, 2024
2 parents c2455ae + 7a74158 commit 68f2331
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 10 additions & 0 deletions wlroots/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ def get_session(self) -> Session:
def is_headless(self) -> bool:
return lib.wlr_backend_is_headless(self._ptr)

@property
def is_multi(self) -> bool:
"""
Returns if this backend represents a multi-backend.
Multi-backends wrap an arbitrary number of backends and aggregate
their new_output/new_input signals.
"""
return lib.wlr_backend_is_multi(self._ptr)


class Session:
def __init__(self, backend: Backend) -> None:
Expand Down
8 changes: 7 additions & 1 deletion wlroots/ffi_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,17 @@ def has_xwayland() -> bool:
struct wlr_session *wlr_backend_get_session(struct wlr_backend *backend);
"""

# backend/libinput.h
# wlr/backend/libinput.h
CDEF += """
struct libinput_device *wlr_libinput_get_device_handle(struct wlr_input_device *dev);
bool wlr_input_device_is_libinput(struct wlr_input_device *device);
"""

# wlr/backend/multi.h
CDEF += """
bool wlr_backend_is_multi(struct wlr_backend *backend);
"""

# backend/session.h
CDEF += """
bool wlr_session_change_vt(struct wlr_session *session, unsigned vt);
Expand Down Expand Up @@ -2963,6 +2968,7 @@ def has_xwayland() -> bool:
#include <wlr/backend.h>
#include <wlr/backend/headless.h>
#include <wlr/backend/libinput.h>
#include <wlr/backend/multi.h>
#include <wlr/interfaces/wlr_keyboard.h>
#include <wlr/render/allocator.h>
#include <wlr/render/drm_format_set.h>
Expand Down

0 comments on commit 68f2331

Please sign in to comment.