Commit graph

2390 commits

Author SHA1 Message Date
Brian Ashworth bc7d332109 Reset outputs on reload 2018-07-20 22:17:20 -04:00
Ryan Dwyer 37b33f92e8 Fix urgent timer logic and remove unnecessary header includes 2018-07-21 10:28:07 +10:00
Ryan Dwyer c2ed3d8bd6 Implement force_display_urgency_hint
The directive sets the timeout before an urgent view becomes normal
again after switching to it from another workspace.

Also:

* When an xwayland surface removes the urgent hint while the timer is
active, we now ignore the request. This happens as soon as the view
receives focus, so it was effectively making the timer pointless.
* The timeout is now only applied when switching to it from another
workspace.
2018-07-21 10:28:07 +10:00
Brian Ashworth 9605ab45f1 Fix output wildcard handling 2018-07-20 12:32:29 -04:00
Ryan Dwyer 8789ceea87 Fix pointer events for overlapping floating views
Fixes #2315.
2018-07-20 09:41:36 +10:00
Drew DeVault 3483f1ea1a
Merge branch 'master' into update-wlroots-1148 2018-07-19 14:09:19 -07:00
emersion 4154234eee Update for swaywm/wlroots#1148 2018-07-19 21:54:46 +01:00
Drew DeVault da9c86c608
Merge pull request #2310 from RyanDwyer/assign-output
Implement assign to output
2018-07-19 10:10:38 -07:00
emersion d8badceb54
Merge pull request #2304 from RedSoxFan/fix-2298
Fix deferred command handling
2018-07-19 16:14:25 +01:00
Ryan Dwyer 54b00d351e Implement assign to output
Eg. assign [class="Firefox"] output foo
2018-07-19 22:36:38 +10:00
emersion eecb393401
Merge branch 'master' into xwayland-set-hints 2018-07-19 12:22:47 +01:00
emersion cb4309b7cd
Merge pull request #2305 from RyanDwyer/focus-output
Implement focus output command
2018-07-19 12:10:56 +01:00
emersion 3dab83d6eb
Merge pull request #2308 from RyanDwyer/fix-double-transaction
Fix crash and render issues involving cursor_send_pointer_motion
2018-07-19 12:10:37 +01:00
Ryan Dwyer 63d6233fcb Allow xwayland views to become urgent when on a non-visible workspace
This removes the urgency stuff from the commit handler and puts it in a
new set_hints handler instead. This allows the xwayland surface to
become urgent without having to commit (which doesn't happen if it's on
an non-visible workspace).
2018-07-19 21:08:51 +10:00
Ryan Dwyer 32806d16ee Use parse_movement_direction 2018-07-19 20:17:48 +10:00
Ryan Dwyer 8533c35a9f Fix crash and render issues involving cursor_send_pointer_motion
Fixes #2303, as well as a crash.

To replicate the crash:

* Have multiple outputs
* In config: for_window [<criteria>] workspace foo
* Also in config: workspace foo output <left-output-name>
* Focus the right output, and ensure workspace foo doesn't exist
* Launch the app that triggers the criteria

When the view maps, it calls workspace_switch which calls
send_set_focus which calls cursor_send_pointer_motion which calls
transaction_commit_dirty. This call to transaction_commit_dirty is not
meant to happen at this time because the tree isn't guaranteed to be in
a consistent state, but I'm not sure how exactly this leads to the crash
or render issues.

In this case the transaction is already committed by the view
implementation's handle_map function. So the solution is to remove it
from cursor_send_pointer_motion and add it to the other functions in
cursor.c which call cursor_send_pointer_motion.
2018-07-19 19:49:50 +10:00
Ryan Dwyer dad3a8deee Fix crash when moving workspace to output 2018-07-19 16:52:02 +10:00
Ryan Dwyer 08736255a3 Defer the focus commands 2018-07-19 16:41:02 +10:00
Ryan Dwyer a173b79c54 Implement focus output command 2018-07-19 16:33:27 +10:00
Brian Ashworth ec65286606 Fix deferred command handling 2018-07-19 01:39:58 -04:00
emersion 747725b8bb Don't unfocus when an override redirect window is mapped 2018-07-18 20:00:48 +01:00
emersion fb4eca5d56 Handle xwayland override_redirect flag change
This fixes syncplay menus.
2018-07-18 19:10:08 +01:00
Drew DeVault ca695482ec
Merge pull request #2292 from emersion/update-cursor-on-focus
Update cursor on focus change
2018-07-17 19:53:12 -07:00
Ryan Dwyer 8ce7e3b44e
Merge branch 'master' into destroy-output-destroy-empty-workspaces 2018-07-18 09:32:03 +10:00
emersion 03d49490cc Update cursor on focus change
This allows to send wl_pointer.enter when switching between views
in a split/tabbed layout for instance. This (1) updates the cursor
image accordingly (2) makes it unnecessary to move the mouse before
scrolling. It's harmless to always call cursor_send_pointer_motion
because in case the focused surface hasn't changed this is a no-op.

The `last_focus != NULL` condition is required otherwise
cursor_send_pointer_motion will crash when sway starts up (the
sway_output doesn't yet have a workspace).
2018-07-17 23:04:55 +01:00
frsfnrrg 3931cb85b2 Fix memory leak in sway/desktop/idle_inhibit_v1.c 2018-07-17 11:35:24 -04:00
frsfnrrg 37471ac649 Fix memory leak in handle_layer_shell_surface 2018-07-17 11:35:24 -04:00
frsfnrrg 600676688a Free individual criteria in free_config
Also free cmd_list when cleaning up a struct criteria.
2018-07-17 11:35:00 -04:00
frsfnrrg b3014f7b16 Fix uninitialized pointer in view_unmap
Otherwise, sway crashes due to uninitialized pointer
dereference when AddressSanitizer is active.
2018-07-17 10:42:48 -04:00
Brian Ashworth 10fc7a5b49
Merge branch 'master' into default-floating-border 2018-07-16 22:12:29 -04:00
Drew DeVault db3a363734 Revert "config: free include path on successful load"
This reverts commit 92450883d7.
2018-07-16 21:02:13 -04:00
Ryan Dwyer 9cbff272cb Remove superfluous IPC urgent events
When an xwayland view is mapped, the IPC urgent event was being sent on
every surface commit.

I had intentionally ommitted the check because I figured an urgent
surface could update its urgent timestamp by sending urgent a second
time. But that's not how it works in xwayland's case, and it makes for
more complicated code.
2018-07-17 10:27:03 +10:00
Ryan Dwyer 75c699db62 Implement default_floating_border command and adjust CSD behaviour 2018-07-17 10:14:33 +10:00
Drew DeVault d6bd314dff
Merge pull request #2276 from RyanDwyer/urgency
Implement urgency base functionality
2018-07-16 15:39:08 -07:00
Ryan Dwyer e2f28c023c Focus view before running criteria when mapping 2018-07-16 22:27:11 +10:00
Ryan Dwyer fc2484095a Implement no_focus command 2018-07-16 22:18:12 +10:00
Ryan Dwyer af5f736277 Render containers as urgent if they have an urgent child 2018-07-16 18:22:27 +10:00
Ryan Dwyer 9ca5cb7faf Fix tab split focus bug
Fixes a bug where if you have a tab containing a split, then switch from
a non-split tab to the split tab, focus is not changed properly.
2018-07-16 18:09:35 +10:00
Ryan Dwyer be28c18ad5 Mark containers as urgent in IPC if they have urgent views 2018-07-16 14:30:31 +10:00
Ryan Dwyer 5f0a4bb6a4 Update workspace urgent state when views close or move workspaces 2018-07-16 13:15:35 +10:00
Ryan Dwyer 560627437b Make container_for_each_descendant_dfs descend into floating views 2018-07-16 12:45:20 +10:00
Ryan Dwyer 64e3bc3ab0 Fix crash in ipc_json_describe_view
I didn't expect a function called ipc_json_describe_view to be passed a
container which wasn't a view :\
2018-07-16 11:55:53 +10:00
Ryan Dwyer a211daf9e6 Add documentation for urgent command 2018-07-16 10:15:18 +10:00
Ryan Dwyer e3f90f00fe Implement xwayland urgency hint 2018-07-16 08:42:34 +10:00
Ryan Dwyer f86087d78f Fix urgency IPC events 2018-07-16 08:19:25 +10:00
Ryan Dwyer 315d5311b2 Implement urgency base functionality
Introduces a command to manually set urgency, as well as rendering of
urgent views, sending the IPC event, removing urgency after focused for
one second, and matching urgent views via criteria.
2018-07-16 08:19:25 +10:00
Ian Fan 9559e3e2af config output: free command string if unused 2018-07-15 21:51:00 +01:00
Ian Fan 92450883d7 config: free include path on successful load 2018-07-15 21:48:39 +01:00
Ian Fan ba8981e44b bar: free old position when changing 2018-07-15 21:47:22 +01:00
Ian Fan 011d43746f Add error handling for getting config file size 2018-07-15 15:36:51 +01:00