Commit graph

5155 commits

Author SHA1 Message Date
Ryan Dwyer 057635f1a3
Merge pull request #2665 from emersion/render-output-segfault
Fix segfault in output_render
2018-09-21 20:15:27 +10:00
Ryan Dwyer 0798fadff2
Merge branch 'master' into render-output-segfault 2018-09-21 20:05:39 +10:00
emersion 8a5ff5a4db swaybar: don't wl_display_roundtrip on each frame
This was the source of numerous bugs, from hotplug events not being
received to segfaults because wl_display_roundtrip was making the
bar process unplug events while blocking in an iteration over all
outputs.
2018-09-20 19:31:03 +02:00
emersion 82f1393cbb swaybar: handle hotplugging
Don't kill and respawn swaybars on hotplug.
2018-09-20 18:37:51 +02:00
emersion fa4308c5ab
Merge pull request #2671 from emersion/output-execute-no-focus
Fix segfault when executing command without focus
2018-09-20 18:36:47 +02:00
Drew DeVault 6ec3626228
Merge pull request #2676 from ianyfan/ipc
ipc: add pid information for views in layout tree
2018-09-19 17:37:58 -04:00
Ian Fan 81f3fda6fa ipc: add pid information for views in layout tree 2018-09-19 22:21:09 +01:00
emersion efc08ec888 Fix segfault when executing command without focus 2018-09-19 15:50:42 +02:00
Drew DeVault f0fb27aba6
Merge pull request #2669 from RyanDwyer/create-output-command
Introduce create_output command (for developer use)
2018-09-19 09:24:15 -04:00
emersion a2090d4222
Merge branch 'master' into create-output-command 2018-09-19 14:19:22 +02:00
Drew DeVault a83773e5ca
Merge pull request #2670 from ianyfan/commands
config: free strings fields when freeing input config
2018-09-19 08:16:20 -04:00
Ian Fan 8e8a5ca217 config: free strings fields when freeing input config 2018-09-19 12:55:49 +01:00
Ryan Dwyer db28459634 Introduce create_output command (for developer use)
Should help with testing hotplugging.
2018-09-19 21:54:27 +10:00
emersion 4289343e17 Fix segfault in output_render 2018-09-19 11:03:25 +02:00
Drew DeVault cdce604d8e
Merge pull request #2640 from ianyfan/swaybar
Overhaul swaybar protocol handling (+fixes)
2018-09-18 22:52:36 -04:00
Ian Fan 47a66da5de swaybar: only free tokener when using i3bar protocol 2018-09-18 18:06:19 +01:00
Ian Fan 5912325d5c swaybar: add debugging statements for handling i3bar json 2018-09-18 16:10:34 +01:00
Ryan Dwyer c6ff1f67f1 Fix double iteration of scratchpad containers
root_for_each_container and root_find_container were using incorrect
logic to determine if a container was hidden in the scratchpad.
Containers will have a NULL parent if they are a direct child of a
workspace. Containers will have a NULL workspace if they are hidden in
the scratchpad.

The incorrect check meant that root_for_each_container would run the
callback on scratchpad containers twice. This meant that executing a
command such as `[class="$something"] scratchpad show` would cause the
command to run twice, resulting in the container being shown and hidden
again which is effectively a no op.

Fixes #2655.
2018-09-18 21:53:02 +10:00
Ian Fan 7882ac66ef swaybar: rewrite i3bar protocol handling
This now correctly handles an incoming json infinite array by shifting
most of the heavy listing to the json-c parser, as well as sending
multiple statuses at once. It also removes the struct
i3bar_protocol_state and moves its members into the status_line struct,
allowing the same buffer to be used for both protocols.
2018-09-18 11:36:33 +01:00
Ian Fan 8cbce77e1d swaybar: rewrite protocol determination
This now uses the getline function to receive the header, replacing
read_line_buffer, which has been deleted since it is otherwise unused.
Furthermore, once the protocol has been determined, the current status
is handled immediately to be shown (though this has not been added for
the i3bar protocol since it has not yet been rewritten to handle this).
2018-09-18 11:36:33 +01:00
Ian Fan 70245c2cd5 swaybar: rewrite text protocol handling
This now uses getline to correctly handle multiple or long statuses. It
also removes the struct text_protocol_state and moves its members into
the status_line struct.
2018-09-18 11:36:33 +01:00
Ian Fan babd9618b9 swaybar: only create i3bar block hotspot if click events are enabled 2018-09-18 11:36:33 +01:00
Ian Fan 87c93d6ad9 swaybar: send trailing comma with click event json 2018-09-18 11:36:33 +01:00
Ian Fan 9932c6a1f1 swaybar: fix empty function prototypes 2018-09-18 11:36:33 +01:00
Ian Fan 952453480f swaybar: invalidate file descriptors upon closing 2018-09-18 11:36:33 +01:00
Ian Fan 4cb28de89f swaybar: remove block links upon exit 2018-09-18 11:36:33 +01:00
Brian Ashworth 15dadaaa44
Merge pull request #2652 from emersion/swaybar-output-names
swaybar: use output names instead of output indexes
2018-09-17 13:38:56 -04:00
emersion 012df55be5 swaybar: use output names instead of output indexes 2018-09-17 16:04:09 +02:00
emersion 5abf832202
Merge pull request #2649 from wmww/fix-move-crash
Fix crash moving out of tab container
2018-09-17 10:52:14 +02:00
William Wold f48999dd24 Fix crash moving out of tab container 2018-09-17 01:20:45 -07:00
Drew DeVault 456b91600d
Merge pull request #2637 from RyanDwyer/fix-tabbed-workspace-shenanigans
Make seat_get_active_child ignore floating children
2018-09-16 10:22:01 -04:00
Drew DeVault 5192f74be1
Merge pull request #2641 from marienz/inhibit-crash
Fix crash when an idle-inhibiting client exits
2018-09-16 10:19:14 -04:00
Marien Zwart ffd1308bbc Fix crash when destroying an idle-inhibiting client
When destroying an idle-inhibiting client, idle_inhibit_v1_check_active can get
called from transaction_progress_queue on a view with a null container.
view_is_visible does not handle a view in this state.
2018-09-16 23:20:58 +10:00
Ryan Dwyer f6e218a643 Rename seat_get_active_child to seat_get_active_tiling_child
Also renames container to con in one function to prevent ugly line
wrapping.
2018-09-16 22:01:54 +10:00
Ryan Dwyer 48bc15e758 Make seat_get_active_child ignore floating children
seat_get_active_child is used to get the active tiling child in a few
places, such as outputs getting their active workspace and
tabbed/stacked containers getting their visible child. When a workspace
uses a tabbed or stacked layout and contains a focused floating view,
calling seat_get_active_child on the workspace would incorrectly return
the floating view. This changes it so it will return the tiling child.

This fixes the following bug:

* Create layout T[view view] then float one of the views
* Attempt to click the tiling view to give it focus - it wouldn't work
because seat_get_active_child would return the floating view
2018-09-16 21:57:19 +10:00
emersion 31c6b5814f
Merge pull request #2638 from RyanDwyer/fix-tab-unmap-crash
Fix crash when unmapping last child of a tabbed workspace
2018-09-16 10:44:39 +02:00
Ryan Dwyer 09733e233f Fix crash when unmapping last child of a tabbed workspace
* Create layout T[view view]
* Move the cursor into the title bar area
* Close both views

Sway would crash because container_at_tabbed would attempt to divide by
zero when there are no children.

The children check isn't needed for the stacked function because it
doesn't divide anything by the number of children.

Fixes #2636.
2018-09-16 14:18:13 +10:00
Drew DeVault 9f985f1f1c
Merge pull request #2634 from ianyfan/ipc
ipc: add focus information to root node
2018-09-15 11:15:09 -04:00
Ian Fan 34dbbb1314 ipc: handle NULL cases for node_get_output 2018-09-15 09:42:49 +01:00
Ian Fan 1c292fd43a ipc: add focus information to root node 2018-09-15 09:42:49 +01:00
Drew DeVault b47f4f5fd4
Merge pull request #2630 from emersion/wlroots-1243
Update for swaywm/wlroots#1243
2018-09-14 21:12:56 -04:00
Drew DeVault 64d567be9b
Merge branch 'master' into wlroots-1243 2018-09-14 21:03:59 -04:00
Drew DeVault 3b92d5bb6d Additional fix for xdg-output 2018-09-14 21:03:35 -04:00
Drew DeVault b4d60da856
Merge branch 'master' into wlroots-1243 2018-09-14 20:56:50 -04:00
Drew DeVault 73aab86b6d Postfix xdg-output headers
"Doesn't need an update" my ass...
2018-09-14 20:55:05 -04:00
Drew DeVault 5d104ae537
Merge pull request #2633 from ianyfan/view-recon-fix
Remove redundant container creation in view initialisation
2018-09-14 20:45:56 -04:00
Ian Fan 25ba80057d Remove redundant container creation in view initialization 2018-09-15 01:24:10 +01:00
emersion b842b4f32e
Merge pull request #2631 from ianyfan/swaybar
bar: remove i3bar_block_free in favour of i3bar_block_unref
2018-09-14 22:19:40 +02:00
Ian Fan e32e86b65d bar: remove i3bar_block_free in favour of i3bar_block_unref 2018-09-14 21:06:54 +01:00
Drew DeVault f5ecc89c68
Merge pull request #2629 from RedSoxFan/fix-654
Allow spaces in background file path
2018-09-14 15:57:53 -04:00