aboutsummaryrefslogtreecommitdiff
path: root/sway
AgeCommit message (Collapse)Author
2019-07-28input/libinput: fix typo in set_middle_emulationBrian Ashworth
This fixes a typo in set_middle_emulation where it would set left handed instead of middle emulation.
2019-07-27Fix resize sibling amount calculationsPedro Côrte-Real
Sibling amounts were being calculated after the original fraction had been altered. This led to broken resize amounts. Fix that by calculating things upfront before adjusting values which also makes the code cleaner. For sanity checks also calculate the sibling amount with the ceiling so we never go below the sanity check even by one pixel. Fixes #4386
2019-07-27Remove all wayland-server.h includesSimon Ser
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. Replacing wayland-server.h with wayland-server-core.h allows us to drop the WL_HIDE_DEPRECATED declaration. This commit si similar to wlroots' ca45f4490ccc ("Remove all wayland-server.h includes").
2019-07-27Avoid adding duplicate criteria for no_focus and commandAshkan Kiani
2019-07-26arrange: remove gaps for workspace location deltasBrian Ashworth
When arranging the workspace, prev_x and prev_y should be ignoring the current gaps otherwise the workspace diff_x and diff_y location deltas will be off. When the deltas are off, each arrangement of the workspace would incorrectly move floaters an extra -workspace->current_gaps.left along the x-axis and an extra -workspace->current_gaps.top along the y-axis.
2019-07-23ipc: add input::libinput_config eventBrian Ashworth
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.
2019-07-23ipc: add an input eventBrian Ashworth
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
2019-07-18input_cmd_xkb_switch_layout: support input typesBrian Ashworth
This just adds input type config support to input_cmd_xkb_switch_layout so that `input type:keyboard xkb_switch_layout <idx>` will work
2019-07-17cmd_output: support current output aliasBrian Ashworth
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.
2019-07-17input_cmd_xkb_*: cleanup includesEd Younis
2019-07-17Implement input_cmd_xkb_file (#3999)Ed Younis
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.
2019-07-17Add missing description for focus_on_window_activation command in docs.rpigott
2019-07-17Update output manager on layout changeJosef Gajdusek
The output manager config was not properly updated if the position of the output got changed.
2019-07-17Make fullscreen check for fullscreen parentsSauyon Lee
This ensures that a child of a fullscreen container cannot be fullscreened.
2019-07-15Sanity check gaps on the outside of the workspacePedro Côrte-Real
Avoid gaps that are too large around the workspace that you end up without any usable space for children. Fixes #4308
2019-07-15Avoid negative outer gapsPedro Côrte-Real
Make sure we never let the gaps around the workspace go negative. Fixes #4304
2019-07-15Sanity check gaps between tiled containersPedro Côrte-Real
When the gaps become too large for the space available gracefully reduced them all the way to 0 if needed. Fixes #4294
2019-07-15Rework gaps code to be simpler and correctPedro Côrte-Real
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
2019-07-14Layout tiled using a width/height fractionPedro Côrte-Real
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
2019-07-14Layout correctly with several new windowsPedro Côrte-Real
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.
2019-07-11cmd_split: fix toggle split for non-split layoutsBrian Ashworth
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.
2019-07-10cmd_layout: toggle split for tabbed/stack defaultBrian Ashworth
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.
2019-07-10config/output: correctly set width/height in applyBrian Ashworth
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
2019-07-09input/libinput: only reset supported optionsBrian Ashworth
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.
2019-07-09cmd_bindswitch: add option to execute on reloadBrian Ashworth
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.
2019-07-09Make mouse drag in tiled mode swap containers if no edge is selectedSebastian Parborg
Now the highlighted center area of containers triggers a swap action instead of moving around the containers.
2019-07-05calibration_matrix: expect 6 individual valuesSergei Dolgov
Example usage from command line: swaymsg input type:touch calibration_matrix -- -1 0 1 0 -1 1
2019-07-05calibration_matrix: add the current matrix to the IPC description for ↵Sergei Dolgov
libinput devices
2019-07-05Use isnanSergei Dolgov
2019-07-05Add calibration_matrix config optionSergei Dolgov
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
2019-06-27tree: set correct border value before creating floaterrandom human
2019-06-23ws-output-priority: fix logic issue in find_outputBrian Ashworth
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
2019-06-22use surface coordinates for damaging buffersmurray
2019-06-20cmd_mode: allow runtime creation and modificationBrian Ashworth
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.
2019-06-20cmd_seat: split action and config handlersBrian Ashworth
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).
2019-06-20config: fix find_handler logicBrian Ashworth
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.
2019-06-19config/xwayland: retain xwayland status on reloadBrian Ashworth
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.
2019-06-16Fix sway crashes for scratchpad layoutsRouven Czerwinski
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
2019-06-14Add missing underscore in bindswitch documentationRobert Sacks
The missing underscore after "toggle" causes the underline to continue for a whole sentence.
2019-06-12bindings: defer while initiailizingBrian Ashworth
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.
2019-06-11Fix segfaults caused by faulty command parsingMatt Coffin
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
2019-06-10Add docs for new IPC keyboard propertiesSimon Ser
2019-06-10Add missing docs for xkb_switch_layoutSimon Ser
2019-06-09Add a new xkb_switch_layout commandSimon Ser
This allows users to programatically change the active layout.
2019-06-09ipc: add xkb_layout_names and xkb_active_layout_indexSimon Ser
These can be useful to implement per-window layouts as a script. See https://github.com/swaywm/sway/issues/2361
2019-06-09config/input: validate xkb keymap before storingBrian Ashworth
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.
2019-06-09commands/input: perform basic keymap validationBrian Ashworth
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).
2019-06-08Unhide cursor on cursor activity after touchAlex Maese
2019-06-08Fix segfault with "xwayland false" (#4228)Aidan Harris
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.
2019-06-05criteria: reset on semicolon separationBrian Ashworth
This matches i3's behavior of only retaining criteria across comma separated commands. When separating commands with a semicolon, the criteria is reset and allows for new criteria to be set, if desired.