aboutsummaryrefslogtreecommitdiffstats
path: root/sway
Commit message (Collapse)AuthorAge
* 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.
* Log libinput_config_status errorsLibravatar Brian Ashworth2019-01-21
| | | | | | This add errors from calls to `libinput_device_config_*_set` to the debug log. This may be useful when looking at issues related to input devices and config settings not working.
* Merge pull request #3468 from emersion/fix-output-gain-crtcLibravatar Drew DeVault2019-01-20
|\ | | | | Fix re-enabling outputs gaining a CRTC
| * Fix re-enabling outputs gaining a CRTCLibravatar emersion2019-01-19
| | | | | | | | | | | | If output->configured is true, then the output has been modeset correctly and we don't need to try again. If output->enabled is true, then we are in the process of configuring the output and we shouldn't do anything.
* | 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.
* Prevent crashes in handle_transform and handle_scale tooLibravatar emersion2019-01-19
|
* Fix crash in cursor_rebase with multiple screensLibravatar emersion2019-01-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Designing the output configuration sequence without invalid state is tricky. We have one function, apply_output_config, that takes an output and (besides other things) performs a modeset and inserts the output in the output layout. The modeset can fail, in which case we don't want the output to be enabled. We also have an output_enable function, which calls output_apply_config and also configures the output's workspace and inserts it in the root container. Now, we have two choices. Either we configure the output before it's been inserted in the root container and then, if the modeset was successful, we insert it and create the workspace. The main issue with this approach is that configuring the output triggers a handful of signals, namely wlr_output.mode and wlr_output_layout.change. In those event handlers, we need to make sure to ignore these outputs in the process of being configured. Either we first insert the output, create the workspace and then try to configure it. It means we need to undo everything if the modeset fails. The main issue with this solution is that it enables and disables the output very quickly, creates a workspace and immediately destroys it, and maybe moves views back and forth (see output_evacuate). I've tried to make it so an output isn't enabled then immediately disabled. We already have code for ignoring outputs when the output is being destructed. Fixes https://github.com/swaywm/sway/issues/3462
* Merge pull request #3452 from emersion/meson-featuresLibravatar Drew DeVault2019-01-18
|\ | | | | Use Meson feature options
| * meson: remove rpath optionsLibravatar emersion2019-01-18
| |
| * Use Meson feature optionsLibravatar emersion2019-01-17
| |
* | Fix segfault in output_enableLibravatar emersion2019-01-18
| |
* | Merge pull request #3457 from emersion/swaybg-no-escapeLibravatar Drew DeVault2019-01-18
|\ \ | | | | | | Don't escape swaybg arguments anymore
| * | Don't escape swaybg arguments anymoreLibravatar emersion2019-01-18
| |/ | | | | | | | | | | | | swaybg used to be invoked with sh, which made escaping necessary. This is no longer necessary. Fixes https://github.com/swaywm/sway/issues/3456
* | 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.
* | output: remove output_add_listenersLibravatar emersion2019-01-18
|/ | | | | Simplify the code by registering signals when outputs are created and removing signals when they are destroyed.
* Don't use sh when spawning swaybgLibravatar emersion2019-01-17
|
* swaybg: use output names instead of output indexesLibravatar emersion2019-01-17
|
* Use static arrays where possible.Libravatar Connor E2019-01-16
|
* Remove usage of VLAs.Libravatar Connor E2019-01-16
|
* 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`.
* layer_shell: do not SIGABRT sway on zero outputsLibravatar Brian Ashworth2019-01-16
| | | | | If there are no outputs, do not SIGABRT when a layer surface is created, just close the layer surface.
* cmd_resize: allow resizing hidden scratchpad by pxLibravatar Brian Ashworth2019-01-16
| | | | | | Allow resizing a hidden scratchpad container by px. Resizing a hidden scratchpad container by ppt is still not allowed since there is no workspace
* seatop_begin_down: raise floatingLibravatar Brian Ashworth2019-01-15
| | | | | In `seatop_begin_down`, raise the floating container. This appears to have been dropped in the transition to seatops.
* Do not send ipc_event_shutdown from ipc clientLibravatar Brian Ashworth2019-01-15
| | | | | | In `sway_terminate`, `ipc_event_shutdown` was being sent regardless which mode sway was running in. When running as an ipc client, `sway_terminate` should just exit
* cursor: send clear_focus on hide and enter event on unhideLibravatar Rouven Czerwinski2019-01-15
| | | | | | | | | | | | Clear the focus when we hide the cursor and show it again during the unhide action. The unhide function will rebase the cursor after the unhide. Tested by looking at the WAYLAND_DEBUG=1 output of termite. Also call cursor_handle_activity before sending pointer events to send the enter events to the surface if the cursor was hidden before. Fixes #3431
* Remove wlr_xdg_surface_send_close.Libravatar Connor E2019-01-15
|
* Do not damage view child when container is NULLLibravatar Brian Ashworth2019-01-15
| | | | | In `view_child_damage`, do not damage the surface if it has been unmapped or if the container is NULL.
* Handle hidden scratchpad containers in commandsLibravatar Brian Ashworth2019-01-15
| | | | | | | This fixes the handling of hidden scratchpad containers for some commands. For the most part, this just prevents running the commands on hidden scratchpad containers, but there are some commands that have some special handling for them.
* Fix invalid pointers when using resize grow width on first/last siblingsLibravatar Ryan Dwyer2019-01-15
|
* Resize only current and immediate siblings rather than all siblingsLibravatar Ryan Dwyer2019-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | For example, create layout V[view view view] and resize the leftmost view using mod+rightclick. Previously, the edge between view 2 and 3 would be adjusted as well. Now this edge will remain constant, which matches the behaviour of i3. To do this operation correctly, the resize tiling seatop now keeps track of two containers, as the container that resizes horizontally will be a different container to the one which resizes vertically (one will be an ancestor). The tiling resize seatop now figures out these containers during the start of the operation and keeps references to them in the event. A new function container_find_resize_parent has been introduced to do this. This function is also used by the resize command. During cursor motion, the seatop logic is similar to before, but now has to choose the correct container to resize. In resize.c, container_resize_tiled and resize_tiled have been merged into one. One of them originally did nothing except pass the values through to the other. container_resize_tiled now takes a simplified approach where it just finds the immediate siblings on either side and resizes them without worrying about the others. The parellel_coord and parallel_size functions are no longer needed and have been removed.
* Disarm key repeat on reloadLibravatar Brian Ashworth2019-01-14
| | | | | | When resetting the keyboard during reload, disarm the key repeat on all keyboards since the bindings (and possibly keyboard) will be freed before the key repeat can go off.
* Remove now-unused "input" argument of cmd_results_newLibravatar M Stoeckl2019-01-14
| | | | | | | | | Patch tested by compiling with `__attribute__ ((format (printf, 2, 3)))` applied to `cmd_results_new`. String usage constants have been converted from pointers to arrays when encountered. General handler format strings were sometimes modified to include the old input string, especially for unknown command errors.
* Remove 'input' field of IPC command return jsonLibravatar M Stoeckl2019-01-14
| | | | | | | | This field is not in i3 and provides imprecise and redundant information. (Specifically, when swaymsg is given a list of commands, the IPC return array already indicates precisely which number command failed; knowing the name of the command is not useful when multiple commands of the same type are provided.)
* Use uint32_t where resize axis might contain a bitfieldLibravatar Ryan Dwyer2019-01-14
|
* Replace resize_axis with wlr_edgesLibravatar Ryan Dwyer2019-01-14
| | | | | | | | | | | This patch removes the resize_axis enum in favour of wlr_edges. As wlr_edges has no `horizontal` or `vertical` value, it denotes these by bitwise `or`ing the left/right and up/down values. Two constants are defined to make it easier to refer to these. This will allow the tiling resize seatop to utilise the functions in this file. resize_axis was local to the resize command and couldn't be exposed in function arguments.
* Merge pull request #3144 from emersion/cmd-xwaylandLibravatar Drew DeVault2019-01-13
|\ | | | | Add xwayland command
| * Add xwayland commandLibravatar emersion2018-11-19
| |
* | Merge pull request #3344 from RedSoxFan/bar-mouse-bindings-improvedLibravatar Drew DeVault2019-01-13
|\ \ | | | | | | Improve mouse button parsing: bar mouse bindings
| * | bar_cmd_bind: utilize mouse button helpersLibravatar Brian Ashworth2019-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies `bar_cmd_bindsym` to use `get_mouse_bindsym` for parsing mouse buttons. This also introduces `cmd_bar_bindcode`, which will use `get_mouse_bindcode` for parsing mouse buttons. Like sway bindings, the two commands are encapsulated in a single file with shared code. This also modifies swaybar to operate off of event codes rather than x11 button numbers, which allows for any mouse button to be used. This introduces two new IPC properties: - For `get_bar_config`, `event_code` has been added to the `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`. - Likewise for `click_events`, `event` has been added and will include the event code for the button clicked. If the event code can be mapped to a x11 button, `button` will still be the x11 button number. Otherwise, `button` will be `0`.
* | | Merge pull request #3343 from RedSoxFan/seat-cursor-buttons-improvedLibravatar Drew DeVault2019-01-13
|\ \ \ | | | | | | | | Improve mouse button parsing: seat cursor buttons
| * | | seat_cmd_cursor: utilize mouse button helpersLibravatar Brian Ashworth2019-01-10
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies `seat_cmd_cursor` to utilize `get_mouse_button` when parsing mouse buttons for the `press` and `release` operations. All x11 buttons, button event names, and button event codes are supported. For x11 axis buttons, `dispatch_cursor_axis` is used instead of `dispatch_cursor_button`. However the `press`/`release` state is ignored and the either axis event is processed. This also removes support for `left` and `right` in favor of `BTN_LEFT` and `BTN_RIGHT`.
* | | Merge pull request #3342 from RedSoxFan/scroll-buttons-improvedLibravatar Drew DeVault2019-01-13
|\ \ \ | | | | | | | | Improve mouse button parsing: input scroll_button
| * | | input_cmd_scroll_button: utilize mouse btn helpersLibravatar Brian Ashworth2019-01-10
| |/ / | | | | | | | | | | | | | | | | | | | | | This modifies `input_cmd_scroll_button` to utilize the mouse button helper `get_mouse_button` when parsing the button. x11 axis buttons are not supported with this command and `CMD_INVALID` will be returned, but all other x11 buttons, button event names, and button event codes should be working
* | | Merge pull request #3402 from RyanDwyer/refactor-seatopsLibravatar Drew DeVault2019-01-13
|\ \ \ | | | | | | | | Refactor seat operations to use an interface
| * | | Refactor seat operations to use an interfaceLibravatar Ryan Dwyer2019-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This splits each seat operation (drag/move tiling/floating etc) into a separate file and introduces a struct sway_seatop_impl to abstract the operation. The move_tiling_threshold operation has been merged into move_tiling. The main logic for each operation is untouched aside from variable renames. The following previously-static functions have been made public: * node_at_coords * container_raise_floating * render_rect * premultiply_alpha * scale_box
* | | | Merge pull request #3388 from RedSoxFan/reset-inputs-on-reloadLibravatar Drew DeVault2019-01-13
|\ \ \ \ | | | | | | | | | | reload: reset input configs
| * | | | reload: reset input configsLibravatar Brian Ashworth2019-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | This resets all input options to their defaults on reload. This also fixes some debug log typos in `input_manager_libinput_config_pointer`.
* | | | | 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.
* | | | | Merge pull request #3398 from RedSoxFan/toggle-input-eventsLibravatar Drew DeVault2019-01-13
|\ \ \ \ \ | | | | | | | | | | | | input events: toggle and ipc get_inputs