Commit graph

6445 commits

Author SHA1 Message Date
Ryan Dwyer 4feedbf7cf Ignore unrelated cursor buttons while doing seat operations
* Click and hold a scrollbar
* Drag the cursor onto another surface
* While still holding the original button, press and release another
cursor button
* Things get weird

There's two ways to fix this. Either cancel the seat operation and do
the other click, or continue the seat operation and ignore the other
click. I opted for the latter (ignoring the click) because it's easier
to implement, and I suspect a second click during a seat operation is
probably unintentional anyway.
2018-10-04 20:57:03 +10:00
Ryan Dwyer 32cb631143 Give focus to another swaylock surface when output is disconnected
* Have multiple outputs
* Launch swaylock
* Unplug an output (possibly has to be the last "connected" one)
* The swaylock surface on the remaining output would not respond to key
events

This was happening because when the output destroys, focus was not given
to the other swaylock surface.

This patch makes focus be transferred to another surface owned by the
same Wayland client, but only if input was inhibited by the surface
being destroyed, and only if it's in the overlay layer. I figure it's
best to be overly specific and relax the requirements later if needed.

This patch removes a check in seat_set_focus_surface which was
preventing focus from being passed from a layer surface to any other
surface. I don't know of a use case for this check, but it's possible
that this change could produce issues.
2018-10-04 19:36:19 +10:00
emersion 681ed1826d
Merge pull request #2759 from minus7/fix-view-container-null
Fix crash if view has no container
2018-10-03 21:22:25 +02:00
Drew DeVault 7fdc557f1e
Merge pull request #2709 from BuJo/feature/raise_floating
raise floating
2018-10-03 21:21:25 +02:00
minus 95d7d5f4ee Fix crash if view has no container 2018-10-03 21:01:34 +02:00
Jonathan Buch 426c33f4dc
Reenable popup-handling for determining focus
This reenables the popup-handling code before the floating-window
focus change.
2018-10-03 16:23:14 +02:00
Jonathan Buch 7e978d7a4c
Use "raycasting" for determining focus for floating windows
Floating containers and their surfaces are ordered in "raised last".
This is used to detect the topmost surface and thus the focus.
2018-10-03 16:23:14 +02:00
Jonathan Buch 7727d54faf
Fix focusing topmost floating windows
Re-focus on the container on which the cursor hovers over.  A
special case is, if there are menus or other subsurfaces open
in the focused container.  It will prefer the focused container
as long as there are subsurfaces.

This commit starts caching the previous node as well as the
previous x/y cursor position.  Re-calculating the previous
focused node by looking at the current state of the cursor
position does not work, if the environment changes.
2018-10-03 16:23:14 +02:00
Jonathan Buch 8bec0c90c7
Add manpage documentatioon for raise_floating 2018-10-03 16:23:14 +02:00
Jonathan Buch ec713125c6
Simplify raising a container in seat
* Factor out raising a floating window into s separate function to
  enable reuse.
2018-10-03 16:23:14 +02:00
Jonathan Buch 298ccb539c
Add configuration for raising containers on focus
* New configuration option: raise_floating
  (From the discussion on https://github.com/i3/i3/issues/2990)
* By default, it still raises the window on focus, otherwise it
  will raise the window on click.
2018-10-03 16:23:12 +02:00
emersion 01b8e171b8
Merge pull request #2757 from RyanDwyer/check-focus-stack-empty
Add sanity check for empty focus stack
2018-10-03 14:17:28 +02:00
Ryan Dwyer 5dd535b67a Add sanity check for empty focus stack 2018-10-03 22:09:20 +10:00
Drew DeVault 54a835e962 Remove HACKING.md
Half of this is outdated and the other half is questionable.
2018-10-03 08:02:46 -04:00
Drew DeVault e60ad3f677 Fix some missing commands in sway-input(5) 2018-10-03 07:50:37 -04:00
Drew DeVault 06c214a800
Merge pull request #2703 from RyanDwyer/csd-border
Add CSD to border modes
2018-10-03 13:03:06 +02:00
Drew DeVault f74829d390
Merge pull request #2755 from RyanDwyer/fix-tiling-criteria
Fix tiling criteria
2018-10-03 13:02:06 +02:00
Ryan Dwyer a519fb6fde Fix tiling criteria 2018-10-03 20:33:32 +10:00
Drew DeVault 4e4d0c5191
Merge pull request #2749 from ianyfan/swaybar
swaybar: add leading comma to click event JSON
2018-10-02 17:00:33 +02:00
Ian Fan 65593f49bc swaybar: add leading comma to click event JSON 2018-10-02 14:05:51 +01:00
Drew DeVault 90352986e0
Merge pull request #2745 from RyanDwyer/fix-focus-inactive-on-destroy
Set focus_inactive on a sibling when a container closes in an inactive workspace
2018-10-02 14:14:13 +02:00
Ryan Dwyer 677e112733 Set focus_inactive on a sibling when a container closes in an inactive workspace
To reproduce the problem, create layout
H[view V[view view view-focused]], then switch to another workspace and
have the previously focused view in the vsplit close (eg. using
criteria, or an mpv video finishing). Return to the workspace using
`$mod+<num>` and the entire vsplit would be focused. This happens
because handle_seat_node_destroy would only set a new focus if the
currently focused view or a parent was being destroyed. To fix it, it
needs to set a sibling of the destroying container to focus_inactive
regardless of the current focus, then restore current focus if needed.

This patch changes the function accordingly. Additionally:

* The function now makes an early return if the node being destroyed is
a workspace.
* set_focus has been renamed to needs_new_focus. This variable is true
if the head focus needs to be changed.
2018-10-02 15:45:20 +10:00
Ryan Dwyer 183a4b0d6b
Merge pull request #2740 from RedSoxFan/gap-borders
Handle gap borders
2018-10-02 11:37:33 +10:00
Brian Ashworth bb25194844 Handle border options for gaps
Fixes `hide_edge_borders smart` when gaps are in use.
Implements `hide_edge_borders smart_no_gaps` and `smart_borders
on|no_gaps|off`.

Since `smart_borders on` is equivalent to `hide_edge_borders smart`
and `smart_borders no_gaps` is equivalent to `hide_edge_borders
smart_no_gaps`, I opted to just save the last value set for
`hide_edge_borders` and restore that on `smart_borders off`. This
simplifies the conditions for setting the border.
2018-10-01 21:19:06 -04:00
Ryan Dwyer b542c5413e
Merge pull request #2739 from RedSoxFan/fix-2653
Fix smart gaps
2018-10-02 08:57:55 +10:00
Ryan Dwyer 82559c16c7
Merge branch 'master' into fix-2653 2018-10-02 08:14:01 +10:00
Drew DeVault 9956a1a9ab
Merge pull request #2735 from RedSoxFan/fix-quotes
Do not strip quotes for exec or bind commands
2018-10-01 20:18:54 +02:00
Brian Ashworth 742d1764a6 Fix smart gaps 2018-10-01 09:41:15 -04:00
Drew DeVault 51f68e10ad
Merge pull request #2737 from Ragnis/criteria-floating
Parse floating criteria
2018-09-30 19:29:26 +02:00
Ragnis Armus 1bd695ffd2 Parse floating criteria 2018-09-30 19:59:32 +03:00
Brian Ashworth a125575eb5 Do not strip quotes for cmd_set 2018-09-30 12:35:45 -04:00
Brian Ashworth 87a70b3591 Do not strip quotes for exec or bind commands
Leave quotes intact for cmd_exec, cmd_exec_always, cmd_bindcode,
and cmd_bindsym
2018-09-30 10:39:29 -04:00
emersion bebe7dea8c
Merge pull request #2734 from ivyl/use_rpath
Add support for installing binaries with DT_RPATH
2018-09-30 15:04:13 +02:00
Arkadiusz Hiler eed0bc3ebd Add support for installing binaries with DT_RPATH
It's better to use DT_RPATH dynamic section of the elf binary to store
the paths of libraries to load instead of overwriting LD_LIBRARY_PATH
for the whole environment, causing surprises. This solution is much more
transparent and perfectly suitable for running contained installations
of wayland/wlroots/sway.

The code unsetting the LD_LIBRARY_PATH/LD_PRELOAD was also deleted as
it's a placebo security at best - we should trust the execution path
that leads us to running sway, and it's way too late to care about those
variables since we already started executing our compositor, thus we
would be compromised anyway.
2018-09-30 15:37:01 +03:00
Drew DeVault f1dbdce0b2
Merge pull request #2726 from RyanDwyer/overhaul-gaps
Make gaps implementation consistent with i3-gaps
2018-09-30 13:47:35 +02:00
Drew DeVault e518c5dbaf
Merge pull request #2728 from RedSoxFan/move-sticky-on-evac
Move sticky containers in output_evacuate
2018-09-30 13:45:31 +02:00
Drew DeVault 8f6aca2166
Merge pull request #2725 from PumbaPe/add-tap-and-drag
Add tap and drag to sway-input
2018-09-30 13:44:11 +02:00
Drew DeVault 7355959d7f
Merge pull request #2730 from ivyl/remove_cap_leftovers
Remove libcap/prctl artifacts
2018-09-30 13:41:36 +02:00
Arkadiusz Hiler 1e70f7b19e Turn funcs() into funcs(void)
If they really do not take undefined number of arguments.
2018-09-30 14:09:05 +03:00
Arkadiusz Hiler d8200012fb Remove declarations that do no have definitions
There is a couple of leftover header files/declarations, which were
fronting implementations that are long gone.

Let's get rid of them.
2018-09-30 14:09:05 +03:00
Arkadiusz Hiler 00dfb76832 Remove libcap/prctl artifacts
They seem like relics of the pasts, from when we were retaining the
ptrace cap.

Some translations still may need updates.
2018-09-30 13:39:26 +03:00
emersion 98b524abd7
Merge pull request #2733 from ianyfan/swaybar
swaybar: synchronize rendering to output frames
2018-09-30 11:44:27 +02:00
Ian Fan 02dfeea54c swaybar: synchronize rendering to output frames 2018-09-30 10:07:33 +01:00
emersion 4eb3fe4830
Merge pull request #2732 from RyanDwyer/fix-zero-outputs
Fix hotplugging down to zero outputs
2018-09-30 10:03:59 +02:00
Ryan Dwyer 24bcb507ec Fix hotplugging down to zero outputs
When the last output is disconnected, output_disable is called like
usual and evacuates the output to the root->saved_workspaces list. It
then calls root_for_each_container to remove (untrack) the output from
each container's outputs list. However root_for_each_container did not
iterate the saved workspaces, so when the output gets freed the
containers would have a dangling pointer in their outputs list. Upon
reconnect, container_discover_outputs would attempt to use the dangling
pointer, causing a crash.

This makes root_for_each_container check the saved workspaces list,
which fixes the problem.
2018-09-30 11:58:56 +10:00
emersion a53171669a
Merge pull request #2698 from ianyfan/hide-cursor
Only show cursor if pointer configured
2018-09-29 14:32:05 +02:00
PP ae2b70f59e add tap-and-drag setting to sway-input 2018-09-29 11:49:41 +02:00
emersion 351e722b6e
Merge pull request #2729 from RyanDwyer/resize-return-false
Return an error when resizing is a no op
2018-09-29 11:24:54 +02:00
emersion 0f0d0c7f9b
Merge pull request #2635 from RedSoxFan/fix-bg-special
Handle shell special characters in bg file path
2018-09-29 11:23:38 +02:00
Ryan Dwyer 42f1fdf015 Return an error when resizing is a no op 2018-09-29 17:05:55 +10:00