Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chase wlroots master branch up to a289f81 #129

Open
wants to merge 68 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
808b543
(wlroots 9f793d3) layer-shell-v1: specify version in constructor
m-col Oct 3, 2023
a002817
(wlroots c8a5dfc) wlr_scene: Add drag icon helper
m-col Oct 3, 2023
d13f88c
(wlroots 258bf9b) compositor: drop wlr_surface.{sx,sy}
m-col Oct 3, 2023
d56147a
(wlroots ff55663) output: introduce request_state event
m-col Oct 3, 2023
082e3b6
(wlroots a541c95) render: make wlr_renderer_begin return a bool
m-col Oct 4, 2023
f93bc3c
(wlroots 8cfd449) input-inhibitor: deprecate
m-col Oct 4, 2023
8d9661b
(wlroots 41b7acb) backend: return wlr_session in wlr_backend_autocrea…
m-col Oct 4, 2023
db43337
(wlroots e7c556f) backend: drop wlr_backend_get_session()
m-col Oct 4, 2023
1492490
(wlroots 236918d) Nuke deprecated include/wlr/types/wlr_surface.h
m-col Oct 4, 2023
46e931d
(wlroots 42016fa) compositor: make renderer optional
m-col Oct 4, 2023
9906f2d
(wlroots 060df4c) scene: introduce wlr_scene_buffer.events.outputs_up…
m-col Oct 4, 2023
ac6c246
(wlroots f103dc74) linux-dmabuf-v1: introduce wlr_linux_dmabuf_v1_cre…
m-col Oct 4, 2023
03e7047
(wlroots 19dfe99) output-damage: stop listening for output mode events
m-col Oct 4, 2023
bca77bf
(wlroots c8eb24d) output: drop enable/mode events
m-col Oct 4, 2023
7a2f7d7
(wlroots 512deeb) compositor: add wlr_surface.events.precommit
m-col Oct 4, 2023
d3558e4
(wlroots 097ea84) output-layout: improve API
m-col Oct 5, 2023
738e8bb
(wlroots f8e70af) wlr_xdg_activation_v1: add new_token event
m-col Oct 5, 2023
abd56b1
add method for wlr_output_commit_state
m-col Oct 5, 2023
95e2a61
(wlroots 7f6d646) keyboard: only update LEDs when changed
m-col Oct 5, 2023
3fba409
(wlroots df0c926) xdg-shell: rename wlr_xdg_toplevel.added to sent_in…
m-col Oct 5, 2023
7f0e932
(wlroots 0f24d27) xdg-shell: rename wlr_xdg_popup.committed to sent_i…
m-col Oct 5, 2023
99aba48
(wlroots fbf5982) xwayland/xwm: introduce wlr_xwayland_surface_try_fr…
m-col Oct 5, 2023
4984ccf
(wlroots 711a1a3) xdg-shell: convert to try_from
m-col Oct 5, 2023
49eab95
(wlroots f9bd416) layer-shell-v1: convert to try_from
m-col Oct 5, 2023
632bc79
(wlroots 7b32c25) wlr_scene: Rename wlr_scene_surface_from_buffer
m-col Oct 5, 2023
d6d8bbe
(wlroots 0682802) xwayland: Read and publish _NET_WM_STRUT_PARTIAL pr…
m-col Oct 5, 2023
45ea4c3
(wlroots 9ef9845) output-damage: drop
m-col Oct 6, 2023
fdb0f5a
(wlroots 0bb5742) compositor: pass version in wlr_compositor_create
m-col Oct 6, 2023
d49d774
(wlroots 9506290) wlr_scene: Introduce wlr_scene_buffer_set_opacity
m-col Oct 6, 2023
70a2152
(wlroots 75d03f2) xwm: introduce associate/dissociate events
m-col Oct 6, 2023
2968f12
(wlroots 6b40e08) compositor: introduce unified map logic
m-col Oct 6, 2023
ed0aadc
(wlroots c590bb6) subcompositor: use unified map logic
m-col Oct 6, 2023
794fe0b
(wlroots b0437fc) xdg-shell: use unified map logic
m-col Oct 6, 2023
da61575
(wlroots c63f365) layer-shell: use unified map logic
m-col Oct 6, 2023
ae465fa
(wlroots af4181f) drag: use unified map logic
m-col Oct 6, 2023
776abf8
(wlroots 26676c8) xwm: use unified map logic
m-col Oct 6, 2023
b96884a
(wlroots d086ee1) compositor: remove wlr_surface_role.precommit
m-col Oct 6, 2023
143814d
(wlroots 24a479a) drag: don't set icon's role_data
m-col Oct 6, 2023
3d1a427
(wlroots 70c1a57) gamma-control-v1: introduce set_gamma event
m-col Oct 6, 2023
de8f1ff
Add bindings to wlr_output_state methods
m-col Oct 6, 2023
03c7264
fix OutputState.commit_state signature
m-col Oct 6, 2023
73b500b
(wlroots 753f3cc) compositor: add wlr_surface_role.no_object
m-col Oct 6, 2023
95fef04
(wlroots da04b06) cursor: add wlr_cursor_set_xcursor()
m-col Oct 6, 2023
cd9402b
(wlroots 0f67580) compositor: introduce wlr_surface_set_role_object()
m-col Oct 6, 2023
eb44b5d
(wlroots 89cb484) compositor: replace role_data with role_resource
m-col Oct 6, 2023
0a3f197
(wlroots be05097) output: add wlr_output_state_init()
m-col Oct 6, 2023
7847df1
add missing wlr_xwayland_surface.withdrawn
m-col Oct 6, 2023
790438f
(wlroots 18bafbf) xcursor-manager: drop wlr_xcursor_manager_set_curso…
m-col Oct 6, 2023
0891b15
(wlroots 19ba3f0) xwayland: drop struct wlr_xwayland_move_event
m-col Oct 6, 2023
0fefc03
(wlroots 214df8e) scene_output: optionally record and report timings
m-col Oct 6, 2023
6e872e2
(wlroots 88942d4) scene: rename output_present event to output_sample
m-col Oct 6, 2023
1d29bb2
(wlroots 77dc1c2) xwayland: drop wlr_xwayland_surface.events.set_pid
m-col Oct 6, 2023
5e03000
(wlroots bdc3440) xdg-decoration: store an xdg_toplevel instead of xd…
m-col Oct 6, 2023
e87255d
(wlroots bd5c4f4) xdg-shell: rework roles
m-col Oct 6, 2023
8ac80ab
(wlroots 72787db) compositor: drop wlr_surface_destroy_role_object()
m-col Oct 6, 2023
a04476f
(wlroots 91f813f) output_layout: return wlr_output_layout_output when…
m-col Oct 6, 2023
847a5ba
(wlroots f5917f0) scene_output_layout: make output adding explicit
m-col Oct 6, 2023
4d939fa
(wlroots 0fdbdc3) xdg-surface: fix init state flow
m-col Oct 6, 2023
530c527
(wlroots a289f81) drop KDE idle protocol support
m-col Oct 6, 2023
5c10a64
(wlroots bdcf997) xwayland/server: add ready flag
m-col Dec 1, 2023
e1f658d
make xwayland.Surface.surface an optional type
m-col Dec 1, 2023
c92c9f6
add xwayland.Surface associate/dissociate events
m-col Dec 1, 2023
07d91f3
(wlroots 33b437d) wlr_scene: Amend scene_buffer.point_accepts_input t…
m-col Dec 1, 2023
0be469e
ruff
m-col Dec 1, 2023
8f145ca
misc type fixes
m-col Dec 1, 2023
bbaf580
update tinywl
m-col Dec 1, 2023
84f7dfb
bump wlroots version to 0.17 in CI
m-col Dec 1, 2023
24ab9b2
bump protocols version in CI
m-col Dec 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
pixman-version: "0.42.0"
hwdata-version: "0.364"
wayland-version: "1.22.0"
wayland-protocols-version: "1.31"
wayland-protocols-version: "1.32"
strategy:
fail-fast: false
matrix:
wlroots-version: ["0.16.2", master]
wlroots-version: ["0.17.0", master]
steps:
- name: Install dependencies
run: |
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
- "pypy-3.8"
- "pypy-3.9"
- "pypy-3.10"
wlroots-version: ["0.16.2"]
wlroots-version: ["0.17.0"]
include:
- python-version: "3.12"
wlroots-version: master
Expand Down Expand Up @@ -262,7 +262,7 @@ jobs:
needs: build-wayland
env:
python-version: "3.12"
wlroots-version: "0.16.2"
wlroots-version: "0.17.0"
steps:
- name: Download wayland libraries
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -298,7 +298,7 @@ jobs:
needs: build-wayland
env:
python-version: "3.12"
wlroots-version: "0.16.2"
wlroots-version: "0.17.0"
steps:
- name: Download wayland libraries
uses: actions/download-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
libdrm-version: "2.4.114"
seatd-version: "0.6.3"
pixman-version: "0.42.0"
wayland-protocols-version: "1.31"
wayland-protocols-version: "1.32"
wayland-version: "1.22.0"
wlroots-version: "0.16.2"
wlroots-version: "0.17.0"
steps:
- name: Install dependencies
run: |
Expand Down
39 changes: 28 additions & 11 deletions tiny/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
Keyboard,
Output,
OutputLayout,
OutputState,
Scene,
SceneBuffer,
SceneNodeType,
SceneOutput,
SceneSurface,
SceneTree,
Seat,
Expand All @@ -51,6 +53,7 @@
if TYPE_CHECKING:
from wlroots.wlr_types import InputDevice
from wlroots.wlr_types.keyboard import KeyboardKeyEvent, KeyboardModifiers
from wlroots.wlr_types.output import OutputEventRequestState

_weakkeydict: WeakKeyDictionary = WeakKeyDictionary()

Expand Down Expand Up @@ -213,7 +216,7 @@ def process_cursor_motion(self, time) -> None:
logging.debug("Processing cursor motion: %s, %s", sx, sy)

if view is None:
self._cursor_manager.set_cursor_image("left_ptr", self._cursor)
self._cursor.set_xcursor(self._cursor_manager, "default")

if surface is None:
# Clear pointer focus so future button events and such are not sent
Expand Down Expand Up @@ -289,8 +292,8 @@ def focus_view(self, view: View, surface: Surface | None = None) -> None:
if previous_surface is not None:
# Deactivate the previously focused surface
logging.info("Un-focusing previous")
previous_xdg_surface = XdgSurface.from_surface(previous_surface)
previous_xdg_surface.set_activated(False)
if previous_xdg_surface := XdgSurface.try_from_surface(previous_surface):
previous_xdg_surface.set_activated(False)

view.scene_node.raise_to_top()
# roll the given surface to the front of the list, copy and modify the
Expand Down Expand Up @@ -322,10 +325,12 @@ def server_new_xdg_surface(self, listener, xdg_surface: XdgSurface) -> None:
# we must provide the proper parent scene node of the xdg popup. To
# enable this, we always set the user data field of xdg_surfaces to
# the corresponding scene node.
parent_xdg_surface = XdgSurface.from_surface(xdg_surface.popup.parent)
parent_scene_tree = cast(SceneTree, parent_xdg_surface.data)
scene_tree = Scene.xdg_surface_create(parent_scene_tree, xdg_surface)
xdg_surface.data = scene_tree
if parent_xdg_surface := XdgSurface.try_from_surface(
xdg_surface.popup.parent
):
parent_scene_tree = cast(SceneTree, parent_xdg_surface.data)
scene_tree = Scene.xdg_surface_create(parent_scene_tree, xdg_surface)
xdg_surface.data = scene_tree
return

assert xdg_surface.role == XdgSurfaceRole.TOPLEVEL
Expand All @@ -344,16 +349,24 @@ def server_new_xdg_surface(self, listener, xdg_surface: XdgSurface) -> None:
# output and frame handling callbacks

def server_new_output(self, listener, output: Output) -> None:
SceneOutput.create(self._scene, output)
output.init_render(self._allocator, self._renderer)

output.set_mode(output.preferred_mode())
output.enable()
output.commit()
state = OutputState()
state.set_enabled()
if mode := output.preferred_mode():
state.set_mode(mode)

output.commit_state(state)
state.finish()

self.outputs.append(output)
self._output_layout.add_auto(output)
if not self._output_layout.add_auto(output):
logging.warning("Failed to add output to layout.")
return

output.frame_event.add(Listener(self.output_frame))
output.request_state_event.add(Listener(self.output_request_state))

def output_frame(self, listener, data) -> None:
output = self.outputs[0]
Expand All @@ -363,6 +376,10 @@ def output_frame(self, listener, data) -> None:
now = Timespec.get_monotonic_time()
scene_output.send_frame_done(now)

def output_request_state(self, listener, request: OutputEventRequestState) -> None:
output = self.outputs[0]
output.commit_state(request.state)

# #############################################################
# input handling callbacks

Expand Down
4 changes: 2 additions & 2 deletions tiny/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def __init__(
self.x = 0.0
self.y = 0.0

xdg_surface.map_event.add(Listener(self.xdg_toplevel_map))
xdg_surface.unmap_event.add(Listener(self.xdg_toplevel_unmap))
xdg_surface.surface.map_event.add(Listener(self.xdg_toplevel_map))
xdg_surface.surface.unmap_event.add(Listener(self.xdg_toplevel_unmap))
xdg_surface.destroy_event.add(Listener(self.xdg_toplevel_destroy))

toplevel = xdg_surface.toplevel
Expand Down
14 changes: 10 additions & 4 deletions wlroots/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ def __init__(self, display: Display, *, backend_type=BackendType.AUTO) -> None:
backends), $WAYLAND_DISPLAY (for Wayland backends), and
$WLR_BACKENDS (to set the available backends).
"""
self.session: Session | None = None

if backend_type == BackendType.AUTO:
ptr = lib.wlr_backend_autocreate(display._ptr)
session_ptr = ffi.new("struct wlr_session **")
ptr = lib.wlr_backend_autocreate(display._ptr, session_ptr)
self.session = Session(session_ptr[0])
elif backend_type == BackendType.HEADLESS:
ptr = lib.wlr_headless_backend_create(display._ptr)
else:
Expand Down Expand Up @@ -93,17 +97,19 @@ def __exit__(self, exc_type, exc_value, exc_tb) -> None:
self.destroy()

def get_session(self) -> Session:
return Session(self)
if self.session is None:
raise ValueError("Backend does not have a session")
return self.session

@property
def is_headless(self) -> bool:
return lib.wlr_backend_is_headless(self._ptr)


class Session:
def __init__(self, backend: Backend) -> None:
def __init__(self, ptr) -> None:
"""The running session"""
self._ptr = lib.wlr_backend_get_session(backend._ptr)
self._ptr = ptr

def change_vt(self, vt: int) -> bool:
return lib.wlr_session_change_vt(self._ptr, vt)
Loading
Loading