aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
...
* ipc: add input::libinput_config eventLibravatar Brian Ashworth2019-07-23
| | | | | | | | | This adds a libinput_config change type to the input event for when the libinput config for a device changes In order for this to be possible to track, the libinput config code had to be refactored. It is now extracted into a separate file to isolate it from the rest of the input management code.
* ipc: add an input eventLibravatar Brian Ashworth2019-07-23
| | | | | | | | | This adds an ipc event related to input devices. Currently the following changes are supported: - added: when an input device becomes available - removed: when an input device is no longer available - xkb_keymap_changed: (keyboards only) the keymap changed - xkb_layout_changed: (keyboards only) the effective layout changed
* input_cmd_xkb_switch_layout: support input typesLibravatar Brian Ashworth2019-07-18
| | | | | This just adds input type config support to input_cmd_xkb_switch_layout so that `input type:keyboard xkb_switch_layout <idx>` will work
* cmd_output: support current output aliasLibravatar Brian Ashworth2019-07-17
| | | | | | | | Similar to seat command, this provides an alias for the current output. Instead of the output name or identifier, `-` can be used to operate on the focused output by name and `--` can be used to operate on the focused output by its identifier. This will prevent operating on the no-op output when using either alias.
* input_cmd_xkb_*: cleanup includesLibravatar Ed Younis2019-07-17
|
* Implement input_cmd_xkb_file (#3999)Libravatar Ed Younis2019-07-17
| | | | | | | Adds a new commend "xkb_file", which constructs the internal xkb_keymap from a xkb file rather than an RMLVO configuration. This allows greater flexibility when specifying xkb configurations. An xkb file can be dumped with the xkbcomp program.
* Add missing description for focus_on_window_activation command in docs.Libravatar rpigott2019-07-17
|
* Added Dutch translation of READMELibravatar jasperro2019-07-17
|
* Update output manager on layout changeLibravatar Josef Gajdusek2019-07-17
| | | | | The output manager config was not properly updated if the position of the output got changed.
* Make fullscreen check for fullscreen parentsLibravatar Sauyon Lee2019-07-17
| | | | | This ensures that a child of a fullscreen container cannot be fullscreened.
* Sanity check gaps on the outside of the workspaceLibravatar Pedro Côrte-Real2019-07-15
| | | | | | | Avoid gaps that are too large around the workspace that you end up without any usable space for children. Fixes #4308
* Avoid negative outer gapsLibravatar Pedro Côrte-Real2019-07-15
| | | | | | Make sure we never let the gaps around the workspace go negative. Fixes #4304
* Sanity check gaps between tiled containersLibravatar Pedro Côrte-Real2019-07-15
| | | | | | | When the gaps become too large for the space available gracefully reduced them all the way to 0 if needed. Fixes #4294
* Rework gaps code to be simpler and correctLibravatar Pedro Côrte-Real2019-07-15
| | | | | | | | | | | | | Instead of tracking gaps per child apply gaps in two logical places: 1. In tiled containers use the layout code to add the gaps between windows. This is much simpler and guarantees that the sizing of children is correct. 2. In the workspace itself apply all the gaps around the edge. Here we're in the correct position to size inner and outer gaps correctly and decide on smart gaps in a single location. Fixes #4296
* Use -fmacro-prefix-map to strip build pathLibravatar Manuel Stoeckl2019-07-15
| | | | | | | | | | | | | | Because meson does not provide a simple way to get the relative build path, it is computed with a pair of foreach loops. As meson does not have a simple way to compute string length (except via underscorify and 63 split operations), the build script uses a shell command instead. If the compiler does not suppot -fmacro-prefix-map, then fall back to passing in the relative path prefix, and use its length to offset the uses of __FILE__ in log messages so that the build path is at least still not included in the logs. This is significantly more efficient than calling _sway_strip_path.
* Layout tiled using a width/height fractionLibravatar Pedro Côrte-Real2019-07-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using container->width/height as both the input and output of the layout calculation have container->width_fraction/height_fraction as the share of the parent this container occupies and calculate the layout based on that. That way the container arrangement can always be recalculated even if width/height have been altered by things like fullscreen. To do this several parts are reworked: - The vertical and horizontal arrangement code is ajusted to work with fractions instead of directly with width/height - The resize code is then changed to manipulate the fractions when working on tiled containers. - Finally the places that manipulated width/height are adjusted to match. The adjusted parts are container split, swap, and the input seat code. It's possible that some parts of the code are now adjusting width and height only for those to be immediately recalculated. That's harmless and since non-tiled containers are still sized with width/height directly it may avoid breaking other corner cases. Fixes #3547 Fixes #4297
* Layout correctly with several new windowsLibravatar Pedro Côrte-Real2019-07-14
| | | | | | | | | | | | | If there is more than one new window layout correctly by calculating the default size of the new windows using the information of how many of them there are in total. This helps with issue #3547 but doesn't fix it in all situations. Things now work correctly if the first layout of new windows happens after leaving fullscreen. But if for some reason an arrange_container() gets called while we are fullscreen the windows will still be incorrectly sized after saved_width/saved_height get used to restore the first window's size before going fullscreen.
* cmd_split: fix toggle split for non-split layoutsLibravatar Brian Ashworth2019-07-11
| | | | | | | | | | Previously, `layout toggle` and `layout toggle split` would set L_VERT when layout was L_HORIZ, otherwise it would set L_HORIZ. This meant that when the layout was L_TABBED or L_STACKED, it would always be L_HORIZ. This extends #4315 (which corrects the handling when multiple layouts are given) to try prev_split_layout, config->default_orientation, and then falling back to L_VERT when the output is taller than wide and L_HORIZ when wider than tall.
* cmd_layout: toggle split for tabbed/stack defaultLibravatar Brian Ashworth2019-07-10
| | | | | | | | | | | This fixes the logic of split for layout toggle when the default layout is L_TABBED or L_STACKED. When the default layout is L_TABBED or L_STACKED, the container/workspace may not have a prev_split_layout. This was causing L_NONE to be returned by get_layout_toggle, which was being handled as a syntax error. This adds logic to try config->default_orientation when prev_split_layout is L_NONE. If that is also L_NONE, then L_VERT is used when the output is taller than wide, otherwise, L_HORIZ is used.
* config/output: correctly set width/height in applyLibravatar Brian Ashworth2019-07-10
| | | | | | | | | | | | In apply_output_config, this sets output->{width,height} using the values in the output box. Previously, they were being set using wlr_output_transformed_resolution, which takes the width and height from the wlr_output and just checks whether they should be swapped based on the transform. This did not take into account the output's scale. wlr_output_effective_resolution could be used instead, which handles both transform and scale. However, the values in the output box have already been processed by wlr_output_effective_resolution so they can just be used directly
* input/libinput: only reset supported optionsLibravatar Brian Ashworth2019-07-09
| | | | | | | | This adds checks to the input_manager_libinput_reset_* functions to only attempt resetting supported options on reload. This should have no functional difference to the user, but will remove several `Failed to apply libinput config: Unsupported configuration option` lines from the log that can be noisy and potential red herrings.
* cmd_bindswitch: add option to execute on reloadLibravatar Brian Ashworth2019-07-09
| | | | | | | This adds a --reload flag to cmd_bindswitch that allows for the binding to be executed on reload. One possible use case for this is to allow users to disable outputs when the lid closes and enable them when the lid opens without having to open and re-close the lid after a reload.
* Make mouse drag in tiled mode swap containers if no edge is selectedLibravatar Sebastian Parborg2019-07-09
| | | | | Now the highlighted center area of containers triggers a swap action instead of moving around the containers.
* calibration_matrix: expect 6 individual valuesLibravatar Sergei Dolgov2019-07-05
| | | | | | Example usage from command line: swaymsg input type:touch calibration_matrix -- -1 0 1 0 -1 1
* calibration_matrix: add the current matrix to the IPC description for ↵Libravatar Sergei Dolgov2019-07-05
| | | | libinput devices
* Use isnanLibravatar Sergei Dolgov2019-07-05
|
* Add calibration_matrix config optionLibravatar Sergei Dolgov2019-07-05
| | | | | | | | | | | | | | | | | | | | | | Can be used to change the orientation of a touchscreen. Example usage with swaymsg: # identity swaymsg input type:touch calibration_matrix '"1 0 0 0 1 0"' # 90 degree clockwise swaymsg input type:touch calibration_matrix '"0 -1 1 1 0 0"' # 180 degree clockwise swaymsg input type:touch calibration_matrix '"-1 0 1 0 -1 1"' # 270 degree clockwise swaymsg input type:touch calibration_matrix '"0 1 0 -1 0 1"' Documentation: https://wayland.freedesktop.org/libinput/doc/latest/absolute-axes.html#calibration-of-absolute-devices
* swaybar-protocol.7: fix block border descriptionsLibravatar Brian Ashworth2019-06-28
| | | | | | | This corrects the description of border_{top,bottom,left,right} in the block properties table in swaybar-protocol.7. The values should be an integer denoting the width/height rather than a boolean denoting whether to show them.
* tree: set correct border value before creating floaterLibravatar random human2019-06-27
|
* Replace meson generator with custom_targetLibravatar Manuel Stoeckl2019-06-24
| | | | | | | | | | | | This change mimics the wlroots protocol meson.build. It replaces meson generators with custom_targets, which will only run wayland-scanner once per output file. The idle protocol is not used by any clients, so its client protocol header is not generated. The check for the availability of the private-code scanner options has been removed, since the wlroots dependency requires wayland >= 1.16.
* ws-output-priority: fix logic issue in find_outputLibravatar Brian Ashworth2019-06-23
| | | | | | | The function used for comparing two output names in the workspace output priority lists was inverted. This was causing priority to not be stored correctly resulting in workspaces not always being restored or moved to the desired outputs
* use surface coordinates for damaging buffersLibravatar murray2019-06-22
|
* cmd_mode: allow runtime creation and modificationLibravatar Brian Ashworth2019-06-20
| | | | | | | This allows for modes to be created, bindings to be added to modes, and bindings to be removed from modes at runtime. Additionally, this also allows for `mode <mode>` to be deferred in the config to set an initial mode.
* cmd_seat: split action and config handlersLibravatar Brian Ashworth2019-06-20
| | | | | | | | | This separates the logic for seat subcommand handlers that only perform actions on the seat and handlers that alter the seat config. The former group can immediately free the seat config after running the command as it is only used by the subcommand to find the name of the seat to operate on. The latter group alters the seat config so it will need to go through the storage and application stage (assuming success).
* config: fix find_handler logicLibravatar Brian Ashworth2019-06-20
| | | | | | | | | | Without this change, the handlers listed in the config_handlers or command_handlers arrays (depending on reading or active) in commands.c would be valid subcommands. To make matters worse, they would also take precedence over the defined subcommand handlers. This corrects find_handler to only work on the handler array given instead of implicitly trying others.
* config/xwayland: retain xwayland status on reloadLibravatar Brian Ashworth2019-06-19
| | | | | | | | | | Since xwayland can only be enabled/disabled at launch, the xwayland status should be retained on reload. Having `xwayland enabled|disabled` in the config, should not cause `config->xwayland` to be invalid on reload. This also returns `CMD_FAILURE` with a message that xwayland can only be enabled/disabled on launch when trying to set the invalid status on reload. This allows swaynag to notify the user that the change will not take effect until sway is restarted.
* Fix sway crashes for scratchpad layoutsLibravatar Rouven Czerwinski2019-06-16
| | | | | | | | | | | | | | Currently container_replace removes the container from the scratchpad and re-adds it afterwards. For the split commands this results in the container being send to the scratchpad, which results in a NULL segfault if the same container should be shown. Pass an optional workspace to root_scratchpad_add_container, if the workspace is passed the window will continue to show on the workspace. If NULL is passed it is sent to the scratchpad. This was an issue if no other window except the scratchpad container was on the workspace. Fixes #4240
* Add missing underscore in bindswitch documentationLibravatar Robert Sacks2019-06-14
| | | | | The missing underscore after "toggle" causes the underline to continue for a whole sentence.
* bindings: defer while initiailizingLibravatar Brian Ashworth2019-06-12
| | | | | | | | This adds the logic to defer binding execution while sway is still initializing. Without this, the binding command would be executed, but the command handler would return CMD_DEFER, which was being treated as a failure to run. To avoid partial executions, this will defer all bindings while config->active is false.
* Fix segfaults caused by faulty command parsingLibravatar Matt Coffin2019-06-11
| | | | | | | | | | | | | | | | This patch fixes faulty command parsing introduced by f0f5de9a9e87ca1f0d74e7cbf82ffceba51ffbe6. When that commit allowed criteria reset on ';' delimeters in commands lists, it failed to account for its inner ','-parsing loop eating threw the entire rest of the string. This patch refactors argsep to use a list of multiple separators, and (optionally) return the separator that it matched against in this iteration via a pointer. This allows it to hint at the command parser which separator was used at the end of the last command, allowing it to trigger a potential secondary read of the criteria. Fixes #4239
* Add docs for new IPC keyboard propertiesLibravatar Simon Ser2019-06-10
|
* Add missing docs for xkb_switch_layoutLibravatar Simon Ser2019-06-10
|
* Add a new xkb_switch_layout commandLibravatar Simon Ser2019-06-09
| | | | This allows users to programatically change the active layout.
* ipc: add xkb_layout_names and xkb_active_layout_indexLibravatar Simon Ser2019-06-09
| | | | | | These can be useful to implement per-window layouts as a script. See https://github.com/swaywm/sway/issues/2361
* config/input: validate xkb keymap before storingLibravatar Brian Ashworth2019-06-09
| | | | | | | | This allows for an optional validation stage when storing an input config. Currently, only the xkb keymap is validated. If storing the delta input config will result in any invalid xkb keymaps, the input config will not be stored and error will be populated with the first line of the xkbcommon log.
* commands/input: perform basic keymap validationLibravatar Brian Ashworth2019-06-09
| | | | | | | | | | | | | Before the delta input config is stored, this attempts to compile a keymap with it. If the keymap fails to compile, then the first line of the xkbcommon log entry will be included with a `CMD_FAILURE`, the entire xkbcommon log entry will be included in the sway error log, and the delta will not be stored. This only handles basic issues such as a layouts not existing. This will NOT catch more complex issues such as when a variant does exist, but not for the given layout (ex: `azerty` is a valid variant, but the `us` layout does not have a `azerty` variant).
* Unhide cursor on cursor activity after touchLibravatar Alex Maese2019-06-08
|
* Fix segfault with "xwayland false" (#4228)Libravatar Aidan Harris2019-06-08
| | | | | | Commit 190546fd315a24c04006fb1b177069933f4350da failed to consider the edge case where xwayland is disabled via the sway config. This leads to a SEGFAULT when setting the xwayland cursor since the xwayland server is not running.
* Add the missing constant for the switch input typeLibravatar Abdelhakim Qbaich2019-06-07
|
* check for empty string before calling strtoul() and check errnoLibravatar Daniel Eklöf2019-06-05
| | | | | | Note: since strtoul() has no real error return code (both 0 and ULONG_MAX may be returned on both success and failure), set errno=0 before calling strtoul().