summaryrefslogtreecommitdiffstats
path: root/sway/config/output.c
Commit message (Collapse)AuthorAge
* Revert "Add some missing frees."Libravatar Connor E2019-02-01
| | | | This reverts commit b5d95f264d5b08f6228e05be680ee36fc06ca6d6.
* Don't allow noop output to be configuredLibravatar Ryan Dwyer2019-01-22
|
* Replace wlr_log with sway_logLibravatar M Stoeckl2019-01-21
| | | | | | | | | | | | | This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
* apply_output_config: remove output_iLibravatar Brian Ashworth2019-01-19
| | | | | output_i was used in apply_output_config when swaybar used wl_output index numbers instead of xdg-output names. This is no longer needed.
* Better handle outputs without CRTCLibravatar emersion2019-01-18
| | | | | | | This happens if you plug in more outputs than supported by your GPU. This patch makes it so outputs without CRTCs appear as disabled. As soon as they get a CRTC (signalled via the mode event), we can enable them.
* Don't use sh when spawning swaybgLibravatar emersion2019-01-17
|
* swaybg: use output names instead of output indexesLibravatar emersion2019-01-17
|
* Terminate swaybg in output_disableLibravatar Brian Ashworth2018-12-19
| | | | | | | | Moves the call to `terminate_swaybg` from inside `apply_output_config` to `output_disable`. The former was only called when an output was being disabled. The latter is called when an output is being disabled and when an output becomes disconnected. Without this, disconnecting an enabled output would result in a defunct swaybg process.
* Rework default output configsLibravatar Brian Ashworth2018-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | Default output configs were generated on reload to reset an output to its default settings. The idea was that anything that was removed from the config or changed at runtime and not in the config should be reset on reload. Originally, they were created using the output name. Recently, they were changed to use the output identifier. It turns out that there are issues of shadowing with that solution as well. This should fix those issues. Instead of generating the default output configs on reload and storing them in the output config list to merge on top of, they are now only generated when retrieving the output config for an output during a reload. This means that the default output configs are never stored anywhere and just used as a base to merge unaltered user configs on top of during a reload. Starting with a blank output config, merges get applied in the following order: 1. Default output config (only during a reload) 2. Wildcard config (only if neither output name or output identifier exist) 3. Output name config 4. Output identifier config
* Fix identifier output configs on reloadLibravatar Brian Ashworth2018-12-03
| | | | | | | | | | | | | | | | | | | | | | When generating default output configs to reset the outputs to their default settings on reload, the output name was being used. Additionally when determining the output config to apply, if there was an output config with the output name, that was being used without checking for an identifier config. This caused sway to completely ignore the users specified output config. To fix this issue, the following changes have been made: 1. Default output configs as created for the identifier now instead of name. This actually makes more sense anyway since you could hotplug multiple different outputs to the same port. 2. In get_output_config, which is only used to determine which output config to apply, output configs for both the name and identifier are queried. If both are found, a new output config is generated with the identifier config merged on top of the name config. If just one is found, a copy of that config is returned. This change also requires that the result from get_output_config be freed after use to prevent memory leaks, which required some minor changes to logic in apply_output_config_to_outputs.
* Replace _XOPEN_SOURCE with _POSIX_C_SOURCELibravatar emersion2018-11-25
| | | | And make sure we don't define both in the same source file.
* Add some missing frees.Libravatar Connor E2018-11-13
|
* Allow swaybg to be disabledLibravatar emersion2018-10-08
| | | | | | Same as #2791 but for swaybg. Fixes #2790
* Handle shell special characters in bg file pathLibravatar Brian Ashworth2018-09-28
| | | | | | | | | | | This changes it back so the path given to swaybg is enclosed in quotes. Additionally, the only character that is escaped in the path stored is double quotes now. This makes it so we don't need to keep an exhaustive list of characters that need to be escaped. The end user will still need to escape these characters in their config or when passed to swaybg.
* Call wlr_output_enable on enable/disable if neededLibravatar Brian Ashworth2018-09-05
|
* Implement type safe arguments and demote sway_containerLibravatar Ryan Dwyer2018-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the meaning of sway_container so that it only refers to layout containers and view containers. Workspaces, outputs and the root are no longer known as containers. Instead, root, outputs, workspaces and containers are all a type of node, and containers come in two types: layout containers and view containers. In addition to the above, this implements type safe variables. This means we use specific types such as sway_output and sway_workspace instead of generic containers or nodes. However, it's worth noting that in a few places places (eg. seat focus and transactions) referring to them in a generic way is unavoidable which is why we still use nodes in some places. If you want a TL;DR, look at node.h, as well as the struct definitions for root, output, workspace and container. Note that sway_output now contains a workspaces list, and workspaces now contain a tiling and floating list, and containers now contain a pointer back to the workspace. There are now functions for seat_get_focused_workspace and seat_get_focused_container. The latter will return NULL if a workspace itself is focused. Most other seat functions like seat_get_focus and seat_set_focus now accept and return nodes. In the config->handler_context struct, current_container has been replaced with three pointers: node, container and workspace. node is the same as what current_container was, while workspace is the workspace that the node resides on and container is the actual container, which may be NULL if a workspace itself is focused. The global root_container variable has been replaced with one simply called root, which is a pointer to the sway_root instance. The way outputs are created, enabled, disabled and destroyed has changed. Previously we'd wrap the sway_output in a container when it is enabled, but as we don't have containers any more it needs a different approach. The output_create and output_destroy functions previously created/destroyed the container, but now they create/destroy the sway_output. There is a new function output_disable to disable an output without destroying it. Containers have a new view property. If this is populated then the container is a view container, otherwise it's a layout container. Like before, this property is immutable for the life of the container. Containers have both a `sway_container *parent` and `sway_workspace *workspace`. As we use specific types now, parent cannot point to a workspace so it'll be NULL for containers which are direct children of the workspace. The workspace property is set for all containers, except those which are hidden in the scratchpad as they have no workspace. In some cases we need to refer to workspaces in a container-like way. For example, workspaces have layout and children, but when using specific types this makes it difficult. Likewise, it's difficult for a container to get its parent's layout when the parent could be another container or a workspace. To make it easier, some helper functions have been created: container_parent_layout and container_get_siblings. container_remove_child has been renamed to container_detach and container_replace_child has been renamed to container_replace. `container_handle_fullscreen_reparent(con, old_parent)` has had the old_parent removed. We now unfullscreen the workspace when detaching the container, so this function is simplified and only needs one argument now. container_notify_subtree_changed has been renamed to container_update_representation. This is more descriptive of its purpose. I also wanted to be able to call it with whatever container was changed rather than the container's parent, which makes bubbling up to the workspace easier. There are now state structs per node thing. ie. sway_output_state, sway_workspace_state and sway_container_state. The focus, move and layout commands have been completely refactored to work with the specific types. I considered making these a separate PR, but I'd be backporting my changes only to replace them again, and it's easier just to test everything at once.
* Do not modeset disabled outputsLibravatar emersion2018-09-01
|
* Merge pull request #2513 from RyanDwyer/rename-root-outputsLibravatar Drew DeVault2018-08-26
|\ | | | | Rename sway_root.outputs to sway_root.all_outputs
| * Rename sway_root.outputs to sway_root.all_outputsLibravatar Ryan Dwyer2018-08-25
| | | | | | | | | | | | | | | | This list includes disabled outputs. When sway_container is demoted, we'll need to store the root's children (ie. enabled outputs) in the sway_root. It makes sense to put these in a list called `outputs`, so I'm renaming the existing list in advance.
* | Remove layout.cLibravatar Ryan Dwyer2018-08-26
|/ | | | | | | | | | | | | | | | | | | | | | | | | When we have type safety we'll need to have functions for workspace_add_tiling and so on. This means the existing container functions will be just for containers, so they are being moved to container.c. At this point layout.c doesn't contain much else, so I've relocated everything and removed the file. * container_swap and its static functions have been moved to the swap command and made static. * container_recursive_resize has been moved to the resize command and made static. * The following have been moved to container.c: * container_handle_fullscreen_reparent * container_insert_child * container_add_sibling * container_add_child * container_remove_child * container_replace_child * container_split * enum movement_direction and sway_dir_to_wlr have been moved to util.c. Side note: Several commands included layout.h which then included root.h. With layout.h gone, root.h has to be included by those commands.
* Refactor destroy functions and save workspaces when there's no outputsLibravatar Ryan Dwyer2018-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the destroy functions to the following: * output_begin_destroy * output_destroy * workspace_begin_destroy * workspace_destroy * container_begin_destroy * container_destroy * view_begin_destroy * view_destroy The terminology was `destroy` and `free`, and it has been changed to `begin_destroy` and `destroy` respectively. When the last output is disconnected, its workspaces will now be stashed in the root. Upon connection of a new output they will be restored. There is a new function `workspace_consider_destroy` which decides whether the given workspace should be destroyed or not (ie. empty and not visible). Calling container_begin_destroy will no longer automatically reap the parents. In some places we want to reap the parents and in some we don't, so this is left to the caller. container_reap_empty_recursive and container_reap_empty have been combined into one function and it will recurse up the tree.
* Allow a fallback color to be specified for swaybgLibravatar Brian Ashworth2018-08-08
| | | | | | This allows for a color to be set when the wallpaper does not fill the entire output. If specified, the fallback color is also used when the image path is inaccessible.
* Reset outputs on reloadLibravatar Brian Ashworth2018-07-20
|
* Fix output wildcard handlingLibravatar Brian Ashworth2018-07-20
|
* config output: free command string if unusedLibravatar Ian Fan2018-07-15
|
* Update for swaywm/wlroots#1126Libravatar emersion2018-07-09
|
* Store sway_outputs so that they can be reenabledLibravatar Brian Ashworth2018-06-06
|
* Idle handling for dpms/lockscreen et alLibravatar Mattias Eriksson2018-05-13
| | | | | | | | | Swayidle handles idle events and allows for dpms and lockscreen handling. It also handles systemd sleep events, and can raise a lockscreen on sleep Fixes #541
* Fix layer surface crash on output destroyLibravatar db2018-05-01
| | | | | | Before freeing sway_output, NULL the wlr_output reference to it. Check for that NULL in layer_shell handle_destroy. Don't damage null container in unmap. Additionaly, terminate swaybg if its output is being disabled.
* Merge branch 'wlroots' into split-containers2Libravatar Tony Crisci2018-04-04
|\
| * Fix wrong output container coordinatesLibravatar emersion2018-04-03
| |
* | unify container destroy functionsLibravatar Tony Crisci2018-04-03
|/
* Merge remote-tracking branch 'origin/wlroots' into swaybar-layersLibravatar Drew DeVault2018-03-30
|\
| * Revert "Merge pull request #1653 from swaywm/revert-1647-refactor-tree"Libravatar Tony Crisci2018-03-29
| | | | | | | | | | This reverts commit 472e81f35d689d67cda241acafda91c688d61046, reversing changes made to 6b7841b11ff4cd35f54d69dc92029855893e5ce0.
| * Revert "Refactor tree"Libravatar Drew DeVault2018-03-29
| |
| * more renaming thingsLibravatar Tony Crisci2018-03-29
| |
| * rename container functionsLibravatar Tony Crisci2018-03-29
| |
* | Add swaybg_commandLibravatar Drew DeVault2018-03-29
| |
* | Move bar config into its own fileLibravatar Drew DeVault2018-03-29
|/
* Address review feedbackLibravatar Drew DeVault2018-03-28
|
* Render layer surfaces and respect exclusive zoneLibravatar Drew DeVault2018-03-28
|
* sway: change all sway_log to wlr_logLibravatar Dominique Martinet2018-01-05
|
* Allow to configure outputs by their identifierLibravatar emersion2017-12-29
|
* Refactor output command, add output enableLibravatar emersion2017-12-27
|
* Add support for fractional output scaleLibravatar emersion2017-12-18
|
* Replace refresh_rate and position by mode in output commandLibravatar emersion2017-12-14
|
* Update output containers on output layout changeLibravatar emersion2017-12-13
|
* Update output container box in event handlerLibravatar emersion2017-12-12
|
* Listen to output layout changeLibravatar emersion2017-12-12
|
* Add scale and transform events to sway_outputLibravatar emersion2017-12-12
|