Commit graph

5745 commits

Author SHA1 Message Date
Ryan Dwyer 3ede5983b9 Fix click behaviour
By the time seatop_allows_events was called, seatop_impl was already
NULL, causing the function to always return false. This means a press
event was sent to clients without a corresponding release event.

This patch moves the call to seatop_finish to after the
seatop_allows_events check.
2019-03-11 10:57:16 -04:00
Ryan Dwyer 9bfb38521a Don't send button events to surfaces when dragging or resizing
It turns out sending button events during all seat operations is not
desirable. This patch introduces a new property
`seatop_impl.allows_events` which allows each operation to define
whether button events should be passed to the surface or not.

The `down` seat operation is the only one that supports this. As all the
other seatops don't support it, the calls to seat_pointer_notify_button
prior to starting them have been removed.
2019-03-11 10:57:16 -04:00
Ian Fan ab1b1dab1f stringop.c: refactor a few functions 2019-03-11 10:57:16 -04:00
Ian Fan 29a67a1a12 stringop.c: clean up headers 2019-03-11 10:57:16 -04:00
Ian Fan 2b70e8518b stringop.c: remove unused functions
The only use of `join_list` in swaybar/tray/icon.c has been rewritten.
2019-03-11 10:57:16 -04:00
Brian Ashworth 4284de1c7b sway_view_child: add listener for view unmap
Since not all child views's have an unmap event, it is possible for it
to still be mapped (default state) in the destruction handler. When
the destruction handler is called, the corresponding view may have
already been freed and the memory location reallocated. This adds a
listener for the view unmapping and removes the mapped status. This
ensures that the child view is damaged due to destruction while the
view still exists and not after.
2019-03-11 10:57:16 -04:00
Brian Ashworth c01a3ca538 detect_proprietary: use strncmp
Only the main nvidia module needs to be blocked. Others such as
nvidiafb are benign and do not need to be blocked
2019-03-11 10:57:16 -04:00
Brian Ashworth 80343587cc fullscreen: init floating on disable without size
If a container gets mapped as fullscreen and set to floating by
criteria, the size and location are never set for the floating
container. This adds a check in container_fullscreen_disable for a
width or height of 0 and calls container_init_floating
2019-03-11 10:57:16 -04:00
emersion 2c0b65f575 meson: use pkg-config var for scdoc path 2019-03-11 10:57:16 -04:00
emersion 0717b76715 Fix crash in cmd_workspace when layer surface has focus 2019-03-11 10:57:14 -04:00
Drew DeVault e3dd074a31 Update language in sway.desktop & sway(1) 2019-03-11 10:56:20 -04:00
Brian Ashworth d57755d05c arrange: use int not size_t for title offsets
This changes `apply_tabbed_layout` and `apply_stacked_layout` to use
`int` instead of `size_t`. This is necessary for tabbed and stacked
containers to be positioned correctly when the y-location is negative.
The reasoning for this is signed plus unsigned is always an unsigned
value. This was causing the y-location of the container to be
positioned near `INT_MIN` due to an unsigned integer underflow
2019-03-11 10:56:20 -04:00
Brian Ashworth fb4838c943 damage: remove output_damage_view
This removes `output_damage_view` since it is unnecessary. The logic
has been moved into its only caller `output_damage_from_view`. When
damaging the whole view, `output_damage_whole_container` should be used
instead
2019-03-11 10:56:20 -04:00
Brian Ashworth e7788c22ee output_damage_whole_container: damage subsurfaces
This adds an iterative call in `output_damage_whole_container` to
damage the subsurfaces for all visible views that are inside of the
container. This is needed to damage subsurfaces that extend outside the
box of the container. Without this, those subsurfaces will create
artifacts when moving or resizing.
2019-03-11 10:56:20 -04:00
Jeff Peeler f0eedfa8e0 fix "directive argument is null" errors 2019-03-11 10:56:20 -04:00
minus e28163249f Fix crash when moving window to scratchpad 2019-03-11 10:56:20 -04:00
Peter Grayson 7d8083c16a Add missing swaymsg completions
The `-m/--monitor` option was missing from the bash and fish completions.

The `subscribe` IPC message type was missing from the bash, fish, and zsh
completions.

Signed-off-by: Peter Grayson <pete@jpgrayson.net>
2019-03-11 10:56:20 -04:00
Peter Grayson bedf2ac2fb Add -p/--pretty option to swaymsg
This new option forces pretty (non-raw/non-JSON) output. By default, when
not using a tty, swaymsg outputs using the "raw" format. This makes it
impossible to, for example, pipe the pretty output to a pager such as
`less` since piping does not use a tty.

The new -p/--pretty option gives the user explicit control over the output
format while retaining the default tty-dependent behavior.

Signed-off-by: Peter Grayson <pete@jpgrayson.net>
2019-03-11 10:56:20 -04:00
Brian Ashworth c8085038cf ipc: describe libinput device configuration
This adds the device configurations to the ipc response for libinput
devices. Only supported configuration options for the device will be
added. This also moves `libinput_send_events` inside a new `libinput`
object that contains the rest of the configuration options. sway-ipc(7)
has been updated to reflect the changes and document the new additions.
2019-03-11 10:56:20 -04:00
Brian Ashworth 7b5429b443 ipc: fix fullscreen deco_rect
This fixes the deco_rect reported by the ipc for fullscreen containers
to be all zeroes. Children of the fullscreen container should still
have their decorations reported correctly
2019-03-11 10:56:20 -04:00
Brian Ashworth 776d8d8d08 ipc: fix rect for stacked children
This now takes all titlebars for stacked children into account for the
ipc property `rect`
2019-03-11 10:56:20 -04:00
emersion 8dfdb3fa11 Fix container_parent_layout for scratchpad windows 2019-03-11 10:56:20 -04:00
Brian Ashworth 7a44b542b8 ipc: change {,deco_}rect to match i3
This fixes the `deco_rect` and `rect` properties in the IPC responses
to match i3's behavior.

`deco_rect` should be relative to the parent node, not the current
node. This also takes tabbed and stacked decorations into account and
will calculate `deco_rect` for all containers since tabbed and stacked
child containers will have decorations.

`rect` should exclude the window decorations.
2019-03-11 10:56:20 -04:00
emersion 704450ad17 Set DISPLAY after initializing Xwayland
This is necessary after https://github.com/swaywm/wlroots/pull/1596
2019-03-11 10:56:20 -04:00
Ben Challenor 3121352f6f Make raw keysyms take precedence over translated
Allows both BackSpace and Shift+BackSpace to be bound under the US
keyboard layout, per #3705.
2019-03-10 22:47:46 +01:00
Brian Ashworth e8eab3b825 meson: update scdoc requirement to >= 1.9.2
Since scdoc 1.9.1 is bugged, this updates the meson version check to
>= 1.9.2 and drops the version requirement from the README. This should
make it more obvious to users who have 1.9.1 that they need to update
scdoc to be able to compile man pages and hopefully cut down on the
duplicate issues
2019-03-04 12:50:56 -05:00
Ryan Dwyer 0c1605784d Allow concurrent clicks
If two cursor buttons are pressed at the same time, the client will now
be notified of the second button press.

The main reason for not sending the concurrent presses was due to an
early return in dispatch_cursor_button if a seatop is in progress. This
patch makes it call seat_pointer_notify_button prior to returning. But
it also has to make sure there's not a mismatch in events such as a
release without a press.

Prior to this patch, the down seatop would send press and release events
in its begin and finish functions. No other seatops did this. A press
event would be sent prior to starting tiling drag, but never an
associated release.

After this patch, no seatops send their own press or release events. We
send them prior to calling the seatop begin functions, then the first
part of dispatch_cursor_button handles all presses during seatops and
when releasing the seatop.
2019-03-04 12:50:47 -05:00
Brian Ashworth 1749f24499 sway.1.scd: document environment vars set by sway
This just documents the few environment variables set by sway in
sway.1.scd
2019-03-04 12:50:47 -05:00
Brian Ashworth 9dafaa87ce render_floating: skip fullscreen floaters
If a floater is fullscreen either on a workspace or globally, it
should not be rendered on any output is is not fullscreened on. When
rendering it on an output it should not be rendered on, there will be
an extraneous border along the adjacent side of the output. This adds
a check in render_floating to skip all fullscreened floaters
2019-03-04 12:50:47 -05:00
Noam Preil 4c2d36d730 Fixes crash in spawn_swaybg (closes #3733) 2019-03-04 12:50:47 -05:00
Brian Ashworth a3b9f2dcfa floating_maximum_size: change default behavior
This changes the way zero (which is the default) is interpreted for both
the width and height of `floating_maximum_size`. It now refers to the
width and height of the entire output layout, which matches i3's
behavior.

This also removes duplicated code to calculate the floating constraints
in three files. Before this, `container_init_floating` used two-thirds
of the workspace width/height as the max and the entire workspace
width/height was used everywhere else. Now, all callers use a single
function `floating_calculate_constraints`.
2019-03-04 12:50:47 -05:00
hugbubby e0cdcad9a7 Minor fix of code duplication.
Removes 3~ lines of code that didn't need to be restated.
2019-03-04 12:50:47 -05:00
emersion 9593c72616 meson: check scdoc version 2019-03-04 12:50:47 -05:00
emersion acb23fe891 seat: don't send button release when not pressed
All seat operations except "down" eat the button pressed event and don't send
it to clients. Thus, when ending such seat operations we shouldn't send the
button released event.

This commit moves the logic used to send pressed/released into the "down"
operation.
2019-03-04 12:50:47 -05:00
Ian Fan 7b5862d08c tray: fix pixmap colors
by converting from network byte order to host byte order
2019-03-04 12:50:47 -05:00
Brian Ashworth ecb646e12b sway-ipc.7: clarify window_rect omits decorations
According to the i3 ipc documentation, `window_rect` excludes the window
decorations from the calculation. This just clarifies that in
`sway-ipc.7.scd`
2019-03-04 12:50:47 -05:00
emersion 9b26661e47 Add output dpms to manpage 2019-03-04 12:50:47 -05:00
emersion acc28cf9bb Print Meson features 2019-03-04 12:50:47 -05:00
emersion 1a34dbf551 Set minimum wlroots version 2019-03-04 12:50:47 -05:00
Brian Ashworth 7371ed55fe Add sway-ipc.7.scd to document IPC protocol
This add `sway-ipc.7.scd` that documents the IPC protocol.

This also increased the minimum scdoc version from 1.8.1 to 1.9.0 to
allow for table cells to be continued on the following line
2019-03-04 12:50:43 -05:00
Rouven Czerwinski e91349f2a0 config: remove double assignement to result in get_output_config 2019-03-04 12:50:27 -05:00
Rouven Czerwinski a95c4abd66 cursor: intitialize sx and sy to zero
If node_at_coords does an early return without setting these values, they can be
used uninitialized later. Initialize both to zero.
2019-03-04 12:50:27 -05:00
Rouven Czerwinski 97d3fb17a4 cursor: remove unused node assignement
The node variable is not used before its reassigned later in the function,
remove the assignement.
2019-03-04 12:50:27 -05:00
Brian Ashworth 8460924a7c execute_command: do not strip qoutes for cmd_mode
`cmd_mode` performs its own quote stripping for the mode string to
avoid double stripping quotes for `cmd_bindcode` and `cmd_bindsym` in
`config_command` and `execute_command`. Stripping quotes in
`execute_command` for `cmd_mode` will also result in double stripping,
which will cause issues for any mode string with spaces, such as pango
markup.
2019-03-04 12:50:27 -05:00
Carlo Abelli c129767bc0 fix smart_borders description in manual
The wording for smart_borders was opposite the actual behavior.
2019-02-25 17:10:04 -05:00
Connor E 401df9cff4 Make load_include_configs void. Fix some cases where WD would not be restored. 2019-02-25 17:10:04 -05:00
minus 3924039bc0 Fix crash exiting fullscreened floating container
container_floating_move_to_center and container_fullscreen_disable were
calling recursively when the container spawned as a fullscreen floating
container (via for_window). Such a window now doesn't crash sway anymore
but is still configured with a wrong, zero size, making it not directly
usable.
2019-02-25 17:10:04 -05:00
Caleb Bassi b2abc6041a ipc: add missing fields to disabled outputs
i3 requires all outputs to have certain fields, including 'primary', 'current_workspace', and 'rect' which were missing on disabled outputs.

https://i3wm.org/docs/ipc.html#_outputs_reply
2019-02-25 17:10:04 -05:00
emersion 54ad31a9dc Update for swaywm/wlroots#1517 2019-02-25 17:10:04 -05:00
Brian Ashworth 41a771ae23 handle_seat_node_destroy: update seat->workspace
If an unmanaged or layer surface is focused when an output gets
disabled and an empty workspace on the output was focused by the seat,
the seat needs to refocus it's focus inactive to update the value of
`seat->workspace`.
2019-02-25 17:10:04 -05:00