aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config
Commit message (Collapse)AuthorAge
* Don't use SOCK_CLOEXECLibravatar emersion2019-02-25
| | | | Manually set the CLOEXEC flag instead, since SOCK_CLOEXEC isn't POSIX.
* Disconnect swaybg instead of killing itLibravatar emersion2019-02-18
| | | | | This is much more reliable. This also fixes race conditions when killing swaybg while it's doing a wl_display_roundtrip.
* Fix reload freeze when not modsetting current modeLibravatar Brian Ashworth2019-02-18
| | | | | | | | | | | | | | | | | | | | | | This fixes the issue of the display freezing on reload with wlroots#1545. On master, all output configs are applied on reload. This may cause an output to have its config applied up to three times, instead of just once. The three cases are: output name, output identifier, and wildcard. Not only is this inefficient, but it can cause swaybg to be spawned and immediately killed. However, swaybg requires two roundtrips of wl_display (to obtain needed globals) before it enters its normal event loop. Modesetting will roundtrip the wl_display. Without modesetting, waitpid for killing swaybg could block infinitely due to swaybg being blocked by wl_display_roundtrip. This only configured an output once. It either uses the wildcard config or creates an empty wildcard config and applies that. This also fixes a bug where an output would not be reset when there is no output config to apply to it.
* apply_output_config: dpms on before modesetLibravatar Brian Ashworth2019-02-18
| | | | | | | | | | | | On the DRM backend, if an output is dpms'd off and a different output is hotplugged, the CRTC for the output is reclaimed. When modesetting an output without a CRTC, a CRTC will not be given to an output that is not desired to be enabled. This splits setting the dpms state in apply_output_config. If the output should be dpms on, the it is enabled before attempting to modeset. Otherwise, it is dpms'd off after setting everything else. This also adds DPMS_ON to the default output configs.
* fix misc memory leaksLibravatar Brian Ashworth2019-02-11
| | | | | | | | | This fixes a few misc memory leaks reported by asan: - Items of `config->config_chain` are now freed instead of just the list itself - `bar->swaybar_command` is now freed - The result returned by a seat subcommand is now returned instead of leaked
* Revert "More frees."Libravatar Connor E2019-02-01
| | | | This reverts commit eda1bf769f239a9e8d5a9907255a330e3113a649.
* Revert "Add some missing frees."Libravatar Connor E2019-02-01
| | | | This reverts commit b5d95f264d5b08f6228e05be680ee36fc06ca6d6.
* pointer_constraint: change to a seat subcommandLibravatar Brian Ashworth2019-01-31
| | | | | | | | | | | | This changes the `pointer_constraint` command to be a subcommand of seat to allow for per-seat settings. The current implementation that is not a seat subcommand will only operate on the current seat and will segfault in the config due to `config->handler_context.seat` only being set at runtime. This also allows for the wildcard identifier to be used to alter the pointer constraint settings on all seats and allows for the setting to be merged with the rest of the seat config.
* Add pointer_constraint commandLibravatar Drew DeVault2019-01-30
|
* Don't allow noop output to be configuredLibravatar Ryan Dwyer2019-01-22
|
* Move sway-specific functions in common/util.c into sway/Libravatar M Stoeckl2019-01-21
| | | | | | Modifier handling functions were moved into sway/input/keyboard.c; opposite_direction for enum wlr_direction into sway/tree/output.c; and get_parent_pid into sway/tree/root.c .
* 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
|
* bar_cmd_tray_bind: Use mouse button helpersLibravatar Brian Ashworth2019-01-16
| | | | | | | | | | | | | | | | This modifies `bar_cmd_tray_bindsym` to use `get_mouse_bindsym` for parsing mouse buttons. This also introduces `bar_cmd_tray_bindcode`, which will use `get_mouse_bindcode` for parsing mouse buttons. Like with sway bindings, the two commands are encapsulated in a single file to maximize shared code. This also modifies tray bindings to work off of events codes rather than x11 buttons, which allows for any mouse buttons to be used. For `get_bar_config`, `event_code` has been added to the `tray_bindings` section and will include to event code for the button. If the event code can be mapped to a x11 button, `input_code` will still be the x11 button number. Otherwise, `input_code` will be `0`.
* Merge pull request #3397 from RedSoxFan/fix-swaybar-heightLibravatar Drew DeVault2019-01-13
|\ | | | | swaybar: obey height if given
| * swaybar: obey height if givenLibravatar Brian Ashworth2019-01-09
| | | | | | | | | | If there is a bar height given, use that as the height rather than as a minimum height. This matches i3-gaps behavior.
* | swaybar: add status_edge_padding commandLibravatar Brian Ashworth2019-01-11
| | | | | | | | | | This adds the bar subcommand `status_edge_padding <padding>` to set the padding used when the status line is on the right edge of the bar.
* | swaybar: add status_padding commandLibravatar Brian Ashworth2019-01-11
|/ | | | | | Adds the bar subcommand `status_padding <padding>` which allows setting the padding used for swaybar. If `status_padding` is set to `0`, blocks will be able to take up the full height of the bar.
* swaybar: implement tray configLibravatar Ian Fan2018-12-31
|
* hide_cursor: change to a seat subcommandLibravatar Brian Ashworth2018-12-30
| | | | | This makes hide_cursor a seat subcommand, which allows for seat specific timeouts.
* Revamp seat configsLibravatar Brian Ashworth2018-12-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes seat configs work like output and input configs do. This also adds support for wildcard seat configs. A seat config is still created in the main seat command handler, but instead of creating a new one in the subcommands and destroying the main seat command's instance, the seat subcommands modify the main one. The seat config is then stored, where it is merged appropriately. The seat config returned from `store_seat_config` is then applied. When attempting to apply a wildcard seat config, a seat specific config is queried for and if found, that is used. Otherwise, the wildcard config is applied directly. Additionally, instead of adding input devices to the default seat directly when there is no seat configs, a seat config for the default seat is created with only fallback set to true, which is more explicit. It also fixes an issue where running a seat command at runtime (with no seat config in the sway config), would result in all input devices being removed from the default seat and leaving sway in an unusable state. Also, instead of checking for any seat config, the search is for a seat config with a fallback option seat. This makes it so if there are only seat configs with fallback set to -1, the default seat is still created since there is no explicit notion on what to do regarding fallbacks. However, if there is even a single fallback 0, then the default seat is not used as a fallback. This will be needed for seat subcommands like hide_cursor where the user may only want to set that property without effecting anything else.
* 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
* list.c: rename free_flat_list to list_free_items_and_destroyLibravatar Ian Fan2018-12-09
|
* Cleanup list codeLibravatar Ian Fan2018-12-09
|
* list.c: Remove list_foreachLibravatar Ian Fan2018-12-09
| | | | | Most occurrences have been replaced by `free_flat_list` which has been moved from stringop.c to list.c. The rest have been replaced by for loops.
* 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.
* Merge pull request #3083 from c-edw/feature/StripWorkspaceNameLibravatar emersion2018-11-19
|\ | | | | Implement strip_workspace_name.
| * Implement strip_workspace_name.Libravatar Connor E2018-11-17
| |
* | Add scroll factor config option.Libravatar Spencer Michaels2018-11-18
| |
* | More frees.Libravatar Connor E2018-11-13
| |
* | Add some missing frees.Libravatar Connor E2018-11-13
|/
* swaybar: show hidden bar on key eventLibravatar Ian Fan2018-10-14
| | | | | | Since wayland does not currently allow swaybar to create global keybinds, this is handled within sway and sent to the bar using a custom event, so as not to pollute existing events, called bar_state_update.
* Fix bar subcommand handler structs and selectionLibravatar Brian Ashworth2018-10-13
|
* bar-bindsym: address ianyfan's commentsLibravatar Brian Ashworth2018-10-09
|
* Implement bar bindsymLibravatar Brian Ashworth2018-10-09
|
* Allow swaybg to be disabledLibravatar emersion2018-10-08
| | | | | | Same as #2791 but for swaybg. Fixes #2790
* swaybar: allow null status_commandLibravatar Ryan Dwyer2018-10-08
| | | | | | | | | Sway sets a default status_command which runs date every second. This patch removes this behaviour so the user can have a NULL status bar if desired. I had to swap swaybar's event_loop_poll and wl_display_flush so that it would map the initial surface.
* Merge pull request #2725 from PumbaPe/add-tap-and-dragLibravatar Drew DeVault2018-09-30
|\ | | | | Add tap and drag to sway-input
| * add tap-and-drag setting to sway-inputLibravatar PP2018-09-29
| |
* | Turn funcs() into funcs(void)Libravatar Arkadiusz Hiler2018-09-30
| | | | | | | | If they really do not take undefined number of arguments.
* | 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.
* input config: merge left_handed optionLibravatar Ian Fan2018-09-27
|
* Implement support for input wildcardLibravatar Brian Ashworth2018-09-23
|
* swaybar: handle hotpluggingLibravatar emersion2018-09-20
| | | | Don't kill and respawn swaybars on hotplug.
* config: free strings fields when freeing input configLibravatar Ian Fan2018-09-19
|