aboutsummaryrefslogtreecommitdiff
path: root/sway
AgeCommit message (Collapse)Author
2019-06-02Remove orbital gamma-control protocolSimon Ser
2019-05-30Use parent get_root_coords in subsurfacesKenny Levinsen
Subsurfaces need access to the parent get_root_coords impl for positioning in popups. To do this, we store a reference to the parent view_child where applicable. Fixes #4191.
2019-05-30Add swaybar protocol documentationBrian Ashworth
This adds swaybar-protocol.7.scd documenting the swaybar status line protocol including some differences from the i3bar counterpart.
2019-05-30bindings: allow unlocked and locked bindingsBrian Ashworth
This changes the behavior of bindings to make the `BINDING_LOCKED` flag conflicting, which will allow for both unlocked and locked bindings. If there are two matching bindings and one has `--locked` and the other does not, the one with `--locked` will be preferred when locked and the one without will be preferred when unlocked. If there are two matching bindings and one has both a matching `--input-device=<input>` and `--locked` and the other has neither, the former will be preferred for both unlocked and locked. This also refactors `get_active_binding` in `sway/input/keyboard.c` to make it easier to read.
2019-05-28Provide current DPMS state in GET_OUTPUTSJosef Gajdusek
2019-05-27input/switch: fix indentation of fileBrian Ashworth
This just changes the indentation of `sway/input/switch.c` to use tabs instead of spaces since I messed up and missed it when approving the PR that added the file.
2019-05-24Update output manager config on all output eventsJosef Gajdusek
The output manager config was not properly updated when output configuration was changed through some other means (such as a command).
2019-05-24Implement wlr-output-management-v1Josef Gajdusek
2019-05-22commands/bar: fix mode and hidden_state at runtimeBrian Ashworth
For compatibility with i3, `bar mode` and `bar hidden_state` do not require bar-ids (in the normal location) at runtime since they follow the alternative syntax: `bar mode|hidden_state <option> [<bar-id>]` This removes the incorrect error that the bar-id is missing for those two bar subcommands
2019-05-19commands/bar: improve error for invalid subcommandAlyssa Ross
Running a command like this produced a confusing error message: $ swaymsg bar bar-0 colors background #ff0000 Error: Unknown/invalid command 'bar-0' This patch makes the error message use argv[1] instead of argv[0] (from config_subcommand's implementation), so it actually uses the name of the command, rather than the id of the bar.
2019-05-17bar: fix segfault with missing or invalid bar idAlyssa Ross
Prior to this patch, if I ran something like this, sway would crash: swaymsg bar height 50 or swaymsg bar not-a-bar-id color bg #ff0000 This was in contrast to other bar subcommands, like status_command, which would exit with a "No bar defined" message. The difference between the subcommands that crashed and the ones that exited was that some subcommands had a check to see if a bar was specified, while others just assumed that it had been and carried on until they segfaulted. Because this check was identical in every subcommand it was present in, and I couldn't think of a case where it would be valid to run a bar subcommand without specifying which bar to apply it to, I moved this check from individual subcommands into the bar command, which is already responsible for actually setting the specified bar. This reduced code duplication, and fixed the crash for the subcommands that were missing this check.
2019-05-14Add infos to help using for_window to man 5Nomeji
2019-05-14input/keyboard: attempt default keymap on failureBrian Ashworth
This attempts to use the default keymap when the one defined in the input config fails to compile. The goal is to make it so the keyboard is always in a usable state, even if it is not the user's requested settings as usability is more important. This also removes the calls to `getenv` for the `XKB_DEFAULT_*` family of environment variables. The reasoning is libxkbcommon will fallback to using those (and then the system defaults) when any of the rule names are `NULL` or an empty string anyway so there is no need for sway to duplicate the efforts.
2019-05-14Implement output toggleMoelf
discussed in #4136, this can't handle wildcard but won't crash.
2019-05-12Spawn swaybar as a wayland clientBrian Ashworth
This just makes it so swaybar is handled as a wayland client
2019-05-09config/output: fix typo in merge_id_on_nameBrian Ashworth
This fixes a typo in `merge_id_on_name` for output configs that resulted in incorrect id-on-name output configs being generated. Instead of using the output that matched the name or identifier, the first output in the list was being used instead. This could cause merging across unrelated output configs and preventing output configs from being applied correctly
2019-05-04Destroy swaybg client on reloadBrian Ashworth
When reloading, this destroys the old config's swaybg client before spawning the new config's swaybg. This fixes a race condition where the old config's swaybg client's destroy was being called after the new config's swaybg client was being spawned. This was causing the reference to the new swaybg client to be removed and never destroyed. This also modifies handle_swaybg_client_destroy to grab the config reference using wl_container_of on the listener since the swaybg client may be the old config swaybg client and should be used instead of the global config instance
2019-05-03Fix xdg-decoration unconfigured if set before first commitSimon Ser
In case a set_mode/unset_mode request is sent before the first commit, we need to handle the value and send our preference accordingly. This fixes xdg-decoration support for Qt apps.
2019-04-30sway.5.scd: clarify workspace config commandsBrian Ashworth
This clarifies that `workspace <name> output <outputs...>` and `workspace <name> gaps ...` do not operate on existing workspaces. Additionally, alternate commands/solutions that operate on existing workspaces are listed.
2019-04-30cmd_move: add support for output currentBrian Ashworth
This adds support for the following commands for i3 compatibility: - `move [window|container] [to] output current` - `move workspace to [output] current` - `move workspace [to] output current` The above commands are only useful when used with criteria.
2019-04-28Fix a silly mistakeAlex Maese
2019-04-28Don't send pointer motion when rebasing the cursorAlex Maese
2019-04-28Clear pointer focus during move and resize seatopsAlex Maese
2019-04-27Remove extra inclusion of stdio.hLane Surface
2019-04-27Don't submit too much damageSimon Ser
2019-04-26config: fix clang warningKonstantin Pospelov
2019-04-26bindsym: change xkb_rule_names initializationKonstantin Pospelov
2019-04-26bindsym: consider xkb_rule_names for --to-codeKonstantin Pospelov
2019-04-26bindsym: update the man page to include --to-codeKonstantin Pospelov
2019-04-26bindsym: change default keymap for --to-codeKonstantin Pospelov
Replace XKB_DEFAULT_LAYOUT with NULL as the default layout.
2019-04-26config: simplify keysym translation fieldsKonstantin Pospelov
Do not store `xkb_keymap` since it can be retrieved from `xkb_state`.
2019-04-26Implement bindsym --to-codeKonstantin Pospelov
* `bindsym --to-code` enables keysym to keycode translation. * If there are no `xkb_layout` commands in the config file, the translation uses the XKB_DEFAULT_LAYOUT value. * It there is one or more `xkb_layout` command, the translation uses the first one. * If the translation is unsuccessful, a message is logged and the binding is stored as BINDING_KEYSYM. * The binding keysyms are stored and re-translated when a change in the input configuration may affect the translated bindings.
2019-04-25swaybg: split into standalone projectDrew DeVault
The new upstream is https://github.com/swaywm/swaybg This commit also refactors our use of gdk-pixbuf a bit, since the only remaining reverse dependency is swaybar tray support.
2019-04-24cmd_move: respect workspace layout when insertingBrian Ashworth
When moving a container to become a direct child of the workspace and the workspace's layout is tabbed or stacked, wrap it in a container with the same layout. This allows for the following: - Run `layout tabbed|stacked` on an empty workspace (or use `workspace_layout tabbed|stacked` in the config) - Open some views - Move one of the views in any direction - Open another view - The new container should also be `tabbed`/`stacked`
2019-04-23Update for wlroots#1660Simon Ser
2019-04-21Fix uninitialized read for wlr_surface_send_frameScott Anderson
2019-04-20ipc: fix criteria for emitting bar_state_updateBrian Ashworth
This fixes the criteria for emitting a `bar_state_update` event to notify swaybar (and any other bars utilizing the event) on whether the bar is visible by modifier. It is not enough to only emit the event when both the bar mode and bar hidden state are `hide` since it is possible to release the modifier while hidden state is `show` and then change hidden state to `hide` without pressing the modifier. This also emits the event whenever visible by modifier is set and should no longer be regardless of the mode and state to ensure that it gets properly cleared. If visible by modifier is not set and the bar is not in `hide`/`hide`, then no events will be sent and visible by modifier will not be set
2019-04-19cmd_move: allow for all i3 syntax optionsBrian Ashworth
This modifies cmd_move to allow for the syntax options allowed by i3. The following syntaxes are supported: - `move left|right|up|down [<amount> [px]]` - `move [--no-auto-back-and-forth] [window|container] [to] workspace <name>|next|prev|next_on_output|prev_on_output|current|number <num>` - `move [window|container] [to] output <name/id>|left|right|up|down` - `move [window|container] [to] mark <mark>` - `move workspace to [output] <name/id>|left|right|up|down` - `move [window|container] [to] [absolute] position <x> [px] <y> [px]` - `move [window|container] [to] [absolute] position center` - `move [window|container] [to] position mouse|cursor|pointer` This also allows retains the following syntax option that is not supported by i3, but is supported in sway 1.0: - `move workspace [to] output <name/id>|left|right|up|down` The changes are: - `window` and `container` are now optional - `output` is now optional for `move workspace` when `to` is given There is also stricter command checking now. If `absolute` or `--no-auto-back-and-forth` are given for commands that do not support them, it will be treated as invalid syntax instead of being silently ignored.
2019-04-19hide_edge_borders.c: add missing case for --i3mwenzkowski
Disable the i3-compatible behavior if the option '--i3' is not given. Previously it was only possible to disable it by changing the config file. Now it also works via swaymsg.
2019-04-17Add unbindsym/unbindcode command for swaybarAlex Maese
2019-04-17Add unbindswitch commandAlex Maese
2019-04-17Create unbindsym and unbindcode commandsAlex Maese
2019-04-16Fix the payload type returned by IPCAshkan Kiani
If a client is subscribed and sends a subsequent ipc command which causes event updates, then those event updates override the `client->current_command` and send the incorrect type for the payload associated with the command. Example: SUBSCRIBE {window} RUN_COMMAND focus -> PAYLOAD_TYPE is 0x80000002 for window events Therefore, we decouple the `client->current_command` by passing it as an argument to the ipc_send_reply function, avoiding a data race. The same is done for the `client->payload_length` as a precautionary measure for the same reason.
2019-04-16Don't apply hide_edge_borders to floating windowsmwenzkowski
This change matches i3's behavior.
2019-04-16view.c: refactor view_autoconfigure()mwenzkowski
2019-04-16Add documentation for rename workspaceAshkan Kiani
2019-04-16Send disabled output available modes on IPC get_outputsRanieri Althoff
- Also fix missing trailing newline on pretty print Signed-off-by: Ranieri Althoff <1993083+ranisalt@users.noreply.github.com>
2019-04-14Add deprecation warnings for new_float, new_window, and force_focus_wrapping.Connor E
2019-04-14Implement input type configs (#3784)Benjamin Cheng
Add support for configurations that apply to a type of inputs (i.e. natural scrolling on all touchpads). A type config is differentiated by a `type:` prefix followed by the type it corresponds to. When new devices appear, the device config is merged on top of its type config (if it exists). New type configs are applied on top of existing configs.
2019-04-14Add heuristics to differentiate touchpadsBenjamin Cheng
Use libinput_device_config_tap_get_finger_count to determine whether a pointer is a touchpad. swaymsg is also updated to reflect the new touchpad type.