aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
Commit message (Collapse)AuthorAge
* Define _POSIX_C_SOURCE globallyLibravatar Simon Ser2024-02-23
| | | | See discussion in https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4555
* Drop unnecessary includes from sway/server.hLibravatar Simon Ser2024-02-15
|
* scene_graph: port wlr_forgein_toplevel_management output enter/leave eventsLibravatar Alexander Orzechowski2024-01-18
|
* container: Don't track outputsLibravatar Alexander Orzechowski2024-01-18
| | | | The scene graph abstraction does this for us
* Delete old damage tracking codeLibravatar Alexander Orzechowski2024-01-18
| | | | The new scene graph abstraction handles this for us.
* scene_graph: Port container server side decorationsLibravatar Alexander Orzechowski2024-01-18
|
* input: Query scene graph for relevant surface/node intersectionsLibravatar Alexander Orzechowski2024-01-18
|
* scene_graph: Use built-in linux dmabuf feedback handlingLibravatar Alexander Orzechowski2024-01-18
|
* scene_graph: Maintain `wlr_scene_node`s for the sway tree.Libravatar Alexander Orzechowski2024-01-18
|
* chore: chase wlroots xdg-surface role reworkLibravatar Kirill Primak2023-08-21
|
* root: Try to preserve relative positions of floating containersLibravatar Ankit Pandey2023-03-14
| | | | | | | | | | | | | | | This makes the behavior of floating containers more consistent with i3. The coordinates of the container are scaled when the size of the workspace it is on changes or when the container is moved between workspaces on different outputs. For scratchpad containers, add a new state that preserves the dimensions of the last output the window appeared on. This is necessary because after a container is hidden in the scratchpad, we expect it to be in the same relative position on the output when it reappears. We can't just use the container's attached workspace because that workspace's dimensions might have been changed or the workspace as a whole could have been destroyed.
* sway{,bar}: use default font hint styleLibravatar llyyr2023-02-27
| | | | | | | | | | CAIRO_HINT_STYLE_FULL attempts to maximize contrast at the expense of fidelity, this makes most fonts that haven't been hand hinted, which makes up the majority of fonts out there, appear much worse. In the absence of explicitly set hint style, cairo will default to CAIRO_HINT_STYLE_SLIGHT, which attempts to improve contrast while retaining fidelity to the original shapes, which is what we want.
* container: rehome the container_swap function into container.cLibravatar Ronan Pigott2023-02-19
| | | | | | | | | | | This function was already declared in container.h but defined in commands/swap.c for some unknown reason. Everything in commands/ assumes the handler context has been set appropriately by the command preludes but this function snuck its way into seatop_* which doesn't set anything in the handler context. The fact that the seatop drag actions manipulate the focus without custody of the seat means they are definitely very broken in multiseat.
* Introduce surface_{enter,leave}_output()Libravatar Simon Ser2023-02-10
| | | | We can centralize all output-related surface events from there.
* Use wlr_linux_dmabuf_feedback_v1_init_with_options()Libravatar Simon Ser2023-02-07
| | | | | | References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3933 Closes: https://github.com/swaywm/sway/issues/7436 Closes: https://github.com/swaywm/sway/pull/7437
* Convert to *_try_from_wlr_surface()Libravatar Simon Ser2023-02-02
| | | | References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3991
* tree/container: drop unnecessary check in container_get_siblings()Libravatar Simon Ser2023-01-03
| | | | | | The check for container->pending.workspace already covers this. References: https://github.com/swaywm/sway/pull/7315#issuecomment-1341716204
* container_get_siblings: handle NULL workspaceLibravatar Baltazár Radics2022-11-11
|
* Use wl_signal_emit_mutable()Libravatar Simon Ser2022-11-10
| | | | | This function fixes segfaults when emitting a signal potentially removes arbitrary listeners.
* container_floating_set_default_size: Store workspace size box on the stackLibravatar Alexander Orzechowski2022-10-29
|
* Reuse parsed PangoFontDescriptionLibravatar Hugo Osvaldo Barrera2022-07-01
| | | | Avoids parsing the configured font each time text is rendered.
* Remove all sprintf callsLibravatar Simon Ser2022-02-08
| | | | | Replace them with snprintf, which ensures buffer overflows won't happen.
* xdg-shell: use wlr_xdg_toplevel in sway_viewLibravatar Simon Ser2022-02-07
| | | | | | Improved type safety. Closes: https://github.com/swaywm/sway/issues/6813
* chore: chase wlr_output_layout_get_box() updateLibravatar Kirill Primak2022-01-31
| | | | https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3439
* Upgrade for wlroots surface refactoringLibravatar Simon Ser2022-01-13
| | | | | | See [1] for details. [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3412
* container: Fix crash when view unmaps + maps quicklyLibravatar David Rosca2022-01-07
| | | | | | | | | | | | | | | | Followup on 4e4898e90f. If a view quickly maps and unmaps repeatedly, there will be multiple destroyed containers with same view in a single transaction. Each of these containers will then try to destroy this view, resulting in use after free. The container should only destroy the view if the view still belongs to the container. Simple reproducer: couple XMapWindow + XUnmapWindow in a loop followed by XDestroyWindow. See #6605
* Add cairo_image_surface_create error handlingLibravatar Simon Ser2021-12-21
| | | | | | | cairo_image_surface_create can fail, e.g. when running out of memory or when the size is too big. Avoid crashing in this case. Closes: https://github.com/swaywm/sway/issues/6531
* Add support for linux-dmabuf surface hintsLibravatar Simon Ser2021-12-13
| | | | References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/1376
* Add focused_tab_titleLibravatar Vsevolod2021-12-10
|
* sway: create wlr_renderer and wlr_allocatorLibravatar Simon Zeni2021-11-18
| | | | | wlroots now required the compositor to create its own wlr_renderer and wlr_allocator to initialize the wlr_output
* container: fix surface_is_popup()Libravatar Kirill Primak2021-11-15
|
* Rename pango_printf to render_textLibravatar Simon Ser2021-09-13
| | | | | This avoids using the pango_ prefix, reserved for functions coming from the Pango library.
* Fix overly-wide mark texturesLibravatar Daniel De Graaf2021-09-04
| | | | | The width of the texture needs to be calculated using the string that is actually displayed in the texture.
* Deduplicate code for rendering titlebar textsLibravatar Hugo Osvaldo Barrera2021-08-27
| | | | | | | | | The title itself and marks were being rendered by two very-similar yet different functions, and any changes made to one had to be reflected on the other. This mostly prevents such oversights from happening, and keeps makes sure we keep both consistent.
* Use fixed titlebar heightsLibravatar Hugo Osvaldo Barrera2021-08-26
| | | | | | | | | | | | | | | Use fixed titlebar heights. The default height is calculated based on font metrics for the configured font and current locale. Some testing with titles with emoji and CJK characters (which are substantially higher in my setup) shows that the titlebars retain their initial value, text does shift up or down, and all titlebars always remain aligned. Also drop some also now-unecessary title_height calculations. Makes also needed to be updated, since they should be positioned with the same rules.
* xdg-decoration: let floating clients set bordersLibravatar Dudemanguy2021-08-12
| | | | | | | | | The xdg-decoration protocol allows clients to request whether they want to use server side decorations or client side decorations. Currently, sway ignores this and always enforces whatever the server is currently set to. Although tiled clients cannot be allowed to set borders, there is no harm in listening requests from floating clients. Sidenote: also fix an unrelated style error.
* container: ignore borders in fullscreen windowsLibravatar Dudemanguy2021-07-06
| | | | | | | | | | | | | | When setting the geometry from content for floating windows, the coordinates for borders are normally taken into account. However in the case of a floating fullscreen window, we should not be doing this. Since the content of the container takes the space of the entire output, this causes the calculated borders to neccesarily be outside of the output. This later causes a problem when sending surface entrance events since in a multi-monitor setup, the border coordinates will overlap with another output despite the surface not actually being on that output at all. The fix is to just ignore border coordinates for a floating fullscreen container since fullscreen, of course, does not actually have any borders. Fixes #6080.
* tree/container: fix indentationLibravatar Simon Ser2021-07-05
|
* cairo: Replace <cairo/cairo.h> by <cairo.h>Libravatar Issam E. Maghni2021-05-10
| | | | | | | For full context, read https://gitlab.freedesktop.org/cairo/cairo/-/issues/479 TL;DR, cairo’s pc file adds `/cairo` to CFLAGS. So namespace cairo shouldn’t be used.
* Avoid creating zero-sized textures for marksLibravatar Simon Ser2021-04-20
| | | | | Same as 6327f1b36196 ("Avoid creating zero-sized textures for titlebars") but for marks.
* Use cairo_image_surface_get_stride instead of guessing itLibravatar Simon Ser2021-04-20
|
* Avoid creating zero-sized textures for titlebarsLibravatar Simon Ser2021-04-20
| | | | Creating a zero-sized wlr_texture is incorrect.
* container: don't set fullscreen on childrenLibravatar ash lea2021-04-15
| | | | | | the original behavior set fullscreen for all descendents of a container, which causes issues when firefox is one of those children because it sends its own set_fullscreen request in response to being fullscreened.
* container: retain focus position on floating enableLibravatar Ronan Pigott2021-04-11
| | | | | | When a tiling container is floated, the focus stack needs to be appropraitely modified to return the container to its original position in the tree upon floating disable, like i3.
* container: Add view_container_content_atLibravatar Kenny Levinsen2021-03-10
| | | | | | | | | | | | | | | | container_at checks if the position provided matches the currently focused container with view_container_at as a fast path. view_container_at checks using the main container geometry, which includes the titlebar and border area. If a tabbed container is focused, then positions over unfocused tabs are incorrectly reported as belonging to the focused container, breaking focus on click. Add view_container_content_at for use in the focused container fast path which only tests container content area, and fall back to full workspace scans for border and titlebar areas. Closes: https://github.com/swaywm/sway/issues/6074
* container: Limit tiled focus to container geometryLibravatar Kenny Levinsen2021-03-01
| | | | | | | | | container_at would maintain the current focus as long as a position was over one of the container view's surfaces. If an oversized surface was being clipped, this lead to weird focus behavior. Instead, use view_container_at for this test, which intersects the container box before looking at surfaces.
* focus: beyond fullscreen when focused explicitlyLibravatar lbonn2021-02-25
| | | | | | | When issuing a focus command on a specific container, users expect to proceed it even if is hidden by a fullscreen window. This matches the behavior of i3.
* Fix wl_shm_format passed to wlr_texture_from_pixelsLibravatar Simon Ser2021-02-23
| | | | See https://github.com/swaywm/wlroots/pull/2744
* container: Add container_is_current_floatingLibravatar Kenny Levinsen2021-02-22
| | | | | Needed to check if containers are currently floating from render code, as container_is_floating checks pending state.
* container: Move pending state to state structLibravatar Kenny Levinsen2021-02-16
| | | | | | | | | Pending state is currently inlined directly in the container struct, while the current state is in a state struct. A side-effect of this is that it is not immediately obvious that pending double-buffered state is accessed, nor is it obvious what state is double-buffered. Instead, use the state struct for both current and pending.