Commit graph

36 commits

Author SHA1 Message Date
Jonathan GUILLOT
6f78d9d5b2 cage: add basic wlr-output-management support
Co-authored-by: Dima Krasner <dima@dimakrasner.com>
2023-07-28 15:36:34 +02:00
Alexander Orzechowski
36c9c52d3f Port 0.16 surface header includes 2022-12-17 21:56:03 +01:00
Alexander Orzechowski
32c44ddb5f Port 0.16 scene changes 2022-12-17 21:56:03 +01:00
Jente Hidskes
ba9c245393 view: implement view_from_wlr_surface in terms of wlr_surface->data pointer 2022-01-14 14:59:13 +01:00
Simon Ser
7a7325c0ee Drop cg_view_child
This is now unused.
2021-12-21 21:53:28 +01:00
Simon Ser
d46e8a82dd Use scene-graph for damage tracking
References: https://github.com/swaywm/wlroots/pull/3117
2021-12-21 21:53:28 +01:00
Simon Ser
128fa90ea1 Use scene-graph helpers for sub-surfaces
Delegate sub-surface handling to wlr_scene_surface_tree_create.

References: https://github.com/swaywm/wlroots/pull/3128
2021-12-21 21:53:28 +01:00
Simon Ser
fb3dc58237 Replace view_wlr_surface_at with scene-graph 2021-12-21 21:53:28 +01:00
Simon Ser
6d60c6c464 Drop view_for_each_surface and view_for_each_popup_surface
With the scene-graph, these are no longer used.
2021-12-21 21:53:28 +01:00
Simon Ser
f544483340 Use the wlroots scene-graph API
References: https://github.com/swaywm/wlroots/pull/1966
2021-12-21 21:53:28 +01:00
Simon Ser
395189fb05 Upgrade to wlroots 0.15
- Update wlr_box includes to util/box.h: the wlroots header has
  been moved upstream.
- Subsurface fields have been moved
- Create renderer and allocator, stop using wlr_backend_get_renderer
- Initalize output rendering
2021-12-21 21:53:28 +01:00
Jan Beich
82bad3f0fc xdg_shell: chase swaywm/wlroots@07111828c5
xdg_shell.c:230:2: warning: implicit declaration of function 'wlr_xdg_surface_for_each_popup' is invalid in C99 [-Wimplicit-function-declaration]
        wlr_xdg_surface_for_each_popup(xdg_shell_view->xdg_surface, iterator, data);
        ^
ld: error: undefined symbol: wlr_xdg_surface_for_each_popup
>>> referenced by xdg_shell.c:230 (../xdg_shell.c:230)
>>>               cage.p/xdg_shell.c.o:(for_each_popup)

Based on 5438cc158a
2021-04-09 19:33:14 +02:00
Jente Hidskes
6cbc202662 Apply clang-format 2020-02-18 21:20:23 +01:00
Jente Hidskes
a53dca91ce Render popups separately from their toplevel view when possible 2020-01-11 17:07:33 +01:00
Jente Hidskes
1c59946e20
Rename view_damage_surface to view_damage_part
To better align it with its counterpart view_damage_whole
2019-12-29 22:54:25 +01:00
Jente Hidskes
95b7782c72
Be explicit about output- and layout coordinates 2019-12-29 16:07:14 +01:00
Jente Hidskes
0aeba8085c
Replace all wayland-server.h includes with wayland-server-core.h
The documentation for `wayland-server.h` says:

> Use of this header file is discouraged. Prefer including
> wayland-server-core.h instead, which does not include the server protocol
> header and as such only defines the library PI, excluding the deprecated API
> below.

See also
ca45f4490c (diff-b57e10fe0774258a6d21b22077001cff)
2019-12-20 17:16:53 +01:00
Jente Hidskes
1308c0ffc3 view: add function to damage whole view 2019-02-16 00:35:17 +01:00
Jente Hidskes
36670f02f3 view: implement subsurfaces 2019-02-16 00:35:17 +01:00
Jente Hidskes
e981cb8a1c Implement damage tracking
Fixes #5.
2019-02-16 00:35:17 +01:00
Jente Hidskes
5c403edc0b view: replace view_has_children with view_is_transient_for
This is a much cleaner implementation but allows us to do the same
things.
2019-01-31 14:47:11 +01:00
Jente Hidskes
7175100d0d view: reorder functions
It had gotten a bit messy. Now functions are grouped together (i.e.,
getters, queries, etc).
2019-01-31 14:47:11 +01:00
Jente Hidskes
64b971a665 view: add proper abstraction with interface 2019-01-31 14:47:11 +01:00
Jente Hidskes
24517922cc view: remove cg_ prefix 2019-01-31 14:47:11 +01:00
Jente Hidskes
c00ac5c462 Set Cage's window title to toplevel's title
When using the Wayland or X11 backend, Cage is drawn inside a window.
This commit sets this window's title to that of the currently focused
toplevel window inside Cage.

Fixes #29.
2019-01-24 16:15:03 +01:00
Jente Hidskes
b0bd4e680d view: add view_has_children to query if a view has children
This allows us to check per-view whether is has dialogs open, instead of
diong it on a global basis as we are doing currently. This is necessary
for fully supporting multiple primary clients.
2019-01-12 19:27:24 +01:00
Jente Hidskes
29009ddd77
view: hide maximize and center functions
This is now handled in view_position.
2019-01-10 15:57:25 +01:00
Jente Hidskes
a4a3a4954a
output: handle size changes
Fixes #23.
2019-01-10 15:50:31 +01:00
Jente Hidskes
905199a1a8
view.h: conditionally include xwayland.h 2019-01-04 20:23:33 +01:00
Jente Hidskes
183e509dd9
s/ifdef/if/g
ifdef gives us some troubles with the thing being set to 0 but still be
defined, so let's just use if.
2019-01-03 22:30:34 +01:00
Jente Hidskes
2847e0d54f
Seat: abstract away a view switch statement
We have our view abstraction, so why not use it?
2019-01-02 21:31:30 +01:00
Jente Hidskes
9a99ba604f
Output: abstract away a view switch statement
We have our view abstraction, so why not use it?
2019-01-02 21:23:16 +01:00
Jente Hidskes
a34c726a1c
Add XWayland support
With Cage becoming more popular since its mention on Phoronix and
therefore getting more use-cases than just my own project, add XWayland
support. The refactoring of 2cf40f7 makes this much easier. Note that
this is a no-cost addition for those of us not using XWayland as it is a
compile-time option that needs to be explicitly enabled by adding
`-Dxwayland=true` to your meson command.
2019-01-02 20:58:48 +01:00
Jente Hidskes
48f8f69556
view_get_geometry: only out width and height
This is the only thing we need, as we don't use a view's x and y
coordinates for placing windows.
2019-01-02 20:47:46 +01:00
Jente Hidskes
786e28bdac
Properly track mapping and unmapping
We shouldn't render a window before it is mapped (obviously), but we
render all windows in the view list. Hence, only insert the window once
it is mapped.

We could run into the case where a window is destroyed without being in
the window list, so we now track unmapping again and remove windows from
the list when they get unmapped.
2018-12-31 20:00:23 +01:00
Jente Hidskes
2cf40f7a9b
Refactor cage into separate source files
This makes Cage much easier to maintain. Not only is it easier where to
look and to maintain a mental model of the code, there is also more
encapsulation, better abstractions and better extendability.
2018-12-31 00:12:33 +01:00