Commit Graph

4925 Commits

Author SHA1 Message Date
Marien Zwart
7d8413d962 Reset signal mask after fork
wlroots uses wl_event_loop_add_signal to handle SIGUSR1 from Xwayland.
wl_event_loop_add_signal works by masking the signal and receiving it from a
signalfd. The signal mask is preserved across fork and exec, so subprocesses
spawned by Sway start with SIGUSR1 masked. Most subprocesses do not expect this
and never unmask the signal, resulting in missing functionality or unexpected
behavior for processes that use SIGUSR1 (such as i3status).

Fix this by unmasking all signals between fork and exec.
2018-08-02 21:31:34 +10:00
Ryan Dwyer
d64c8df7ce Allow moving containers when workspace itself is focused 2018-08-02 20:59:44 +10:00
Ryan Dwyer
8314019f66 Fix race condition crashes when unmapping views
This fixes two issues which were both introduced in #2396.

First issue:
The PR changes the location of the buffer save to transaction_apply, but
puts it inside the should_configure block. For unmapping (destroying)
views, should_configure returns false so it wasn't saving the buffer. If
a frame was rendered between the unmap and the transaction applying then
it would result in a crash.

Second issue:
If a destroying view is involved in two transactions, we must not
release the buffer between the transactions because there is no live
buffer to grab any more.
2018-08-02 20:54:03 +10:00
Michel Ganguin
d6095588a1 Link xcb dependency to meson options "enable_xwayland" (#2393)
* Link xcb dependency to meson options "enable_xwayland"

* Link xcb dependency to meson options "enable_xwayland"
2018-08-02 08:36:47 +01:00
emersion
fe39129b96
Merge pull request #2396 from RyanDwyer/fix-resize-wiggle
Correctly track saved surfaces during multiple transactions
2018-08-02 08:20:39 +01:00
emersion
47bf4ed0cb
Merge branch 'master' into fix-resize-wiggle 2018-08-02 08:11:10 +01:00
Brian Ashworth
26c5ef18ba swaynag: don't drop \n for first line 2018-08-01 22:55:20 -04:00
Brian Ashworth
41d858b439 swaynag: add blank lines after headings in scdocs 2018-08-01 22:47:54 -04:00
Brian Ashworth
1e7fbe493e swaynag: swaybar like default colors 2018-08-01 22:47:54 -04:00
Brian Ashworth
4f5cf330c8 swaynag: address some more of sircmpwn's comments
Fixes segfauls for any case where swaynag->outputs was not inititalized
including -h/--help, -v/--version, and invalid arguments.

Sets sane defaults for colors not given. Any color not given will
fallback to the default color values for type error.

Adds support for a hidpi cursor
2018-08-01 22:47:54 -04:00
Brian Ashworth
0ef3988438 swaynag: fix hidpi 2018-08-01 22:47:54 -04:00
Brian Ashworth
e01acb6097 swaynag: allow more config options 2018-08-01 22:47:54 -04:00
Brian Ashworth
ca40298af4 swaynag: add math to meson.build 2018-08-01 22:47:54 -04:00
Brian Ashworth
894d57f192 swaynag: fix output selection 2018-08-01 22:47:54 -04:00
Brian Ashworth
a6145914c6 swaynag: refactor {sway_,}nagbar to swaynag 2018-08-01 22:47:54 -04:00
Brian Ashworth
6124d0f9a2 swaynag: split config into own file and fix optind 2018-08-01 22:47:54 -04:00
Drew DeVault
58f3fa74ae Disable pango markup for extended message 2018-08-01 22:47:54 -04:00
Drew DeVault
37709917b1 Set output to NULL if not specified
This opens nagbar on the active output.
2018-08-01 22:47:54 -04:00
Brian Ashworth
8463a2896a swaynag: implement config file support 2018-08-01 22:47:54 -04:00
Brian Ashworth
a4f7bf23b2 Address first round review for swaynag 2018-08-01 22:47:54 -04:00
Brian Ashworth
72db10c2f1 Support a detailed message in swaynagbar 2018-08-01 22:47:54 -04:00
Brian Ashworth
88bc4b528e Implements swaynagbar 2018-08-01 22:47:54 -04:00
Brian Ashworth
abf33468c1 Arrange output in arrange_layers and commit dirty 2018-08-01 22:47:54 -04:00
Drew DeVault
9564c73c0d
Merge pull request #2391 from RyanDwyer/fix-popups-v2
Fix popups (v2)
2018-08-01 22:02:12 -04:00
Ryan Dwyer
4cc0855f21
Merge pull request #2264 from ianyfan/ipc
IPC Events (1.0)
2018-08-02 08:17:25 +10:00
Ian Fan
46cfa8ff56 ipc: remove extraneous values
Removes IPC_EVENT_MODIFIER and IPC_EVENT_INPUT, which were sway-specific and unused
2018-08-01 16:57:15 +01:00
Ian Fan
03eaf444a4 ipc: prevent emitting a workspace::focus event when moving a container to a different workspace or output
When a container is moved from, say, workspace 1 to workspace 2, workspace 2 is focused in order to arrange the windows before focus is moved back to workspace 1, which caused a workspace:focus event from workspace 2 to workspace 1 to be emitted. This commit inhibits that event.
2018-08-01 16:57:15 +01:00
Ian Fan
b2ac234569 ipc: fix workspace::focus event behaviour 2018-08-01 16:57:15 +01:00
Ian Fan
3edaf2ce2a ipc: add tick event 2018-08-01 16:57:15 +01:00
Ian Fan
33433c6434 Add missing swaymsg completions 2018-08-01 16:57:15 +01:00
Ian Fan
75aba00460 ipc: always include old property in workspace events 2018-08-01 16:57:15 +01:00
Ian Fan
d898e035ba ipc: add workspace::reload event 2018-08-01 16:57:15 +01:00
Ian Fan
6865b8aae9 ipc: add binding event 2018-08-01 16:57:15 +01:00
Ian Fan
e0e638281e ipc: add window::move events 2018-08-01 16:57:15 +01:00
Ian Fan
4bf253855f ipc: fix workspace::move calls argument order 2018-08-01 16:57:15 +01:00
Ian Fan
07101a5707 ipc: only emit window::create event for views 2018-08-01 16:57:15 +01:00
Ian Fan
317217f2c8 ipc: add window::mark event 2018-08-01 16:57:15 +01:00
Ian Fan
dd6debf367 ipc: add barconfig_update event on config reload 2018-08-01 16:57:14 +01:00
Ian Fan
686c084cec ipc: add workspace::empty event 2018-08-01 16:57:14 +01:00
Ian Fan
4f8f363dda ipc: add window::title event 2018-08-01 16:57:14 +01:00
Ian Fan
dd1d6255f0 ipc: add window::focus event 2018-08-01 16:57:14 +01:00
Ian Fan
f0310933c8 ipc: add window::close event 2018-08-01 16:57:14 +01:00
Ian Fan
87ccf18964 ipc: add workspace::init event 2018-08-01 16:57:14 +01:00
Ian Fan
e8b179e313 ipc: add shutdown event 2018-08-01 16:57:14 +01:00
Drew DeVault
f078f7fdfa
Merge pull request #2397 from chr0me-sh/hide-cursor-if-no-pointer
XCursor is not configured if no pointer device is available
2018-08-01 11:45:36 -04:00
chr0me
77d74dd34f XCursor is not configured if no pointer device is available 2018-08-01 23:27:36 +08:00
Ryan Dwyer
d10ccc1eb1 Correctly track saved surfaces during multiple transactions
Fixes #2364.

Suppose a view is 600px wide, and we tell it to resize to 601px during a
resize operation. We create a transaction, save the 600px buffer and
send the configure. This buffer is saved into the associated
instruction, and is rendered while we wait for the view to commit a
601px buffer.

Before the view commits the 601px buffer, suppose we tell it to resize
to 602px. The new transaction will also save the buffer, but it's still
the 600px buffer because we haven't received a new one yet.

Then suppose the view commits its original 601px buffer. This completes
the first transaction, so we apply the 601px width to the container.
There's still the second (now only) transaction remaining, so we render
the saved buffer from that. But this is still the 600px buffer, and we
believe it's 601px. Whoops.

The problem here is we can't stack buffers like this. So this commit
removes the saved buffer from the instructions, places it in the view
instead, and re-saves the latest buffer every time the view completes a
transaction and still has further pending transactions.

As saved buffers are now specific to views rather than instructions, the
functions for saving and removing the saved buffer have been moved to
view.c.

The calls to save and restore the buffer have been relocated to more
appropriate functions too, favouring transaction_commit and
transaction_apply rather than transaction_add_container and
transaction_destroy.
2018-08-01 16:24:15 +10:00
Ryan Dwyer
f91fd78b99
Merge pull request #2395 from RedSoxFan/create-mouse-binding-list
Create list for mouse bindings when creating new mode
2018-08-01 14:21:18 +10:00
Brian Ashworth
00a00aacef Create list for mouse binds when creating new mode 2018-07-31 23:49:42 -04:00
Ryan Dwyer
7a59508da4 Close popups when changing focus
Also reverts the send frame done changes from the previous commit.
2018-07-31 19:58:34 +10:00