Commit graph

4354 commits

Author SHA1 Message Date
Ryan Dwyer
5ba2ae9c6a Implement request_move and request_resize for xwayland views
I discovered we have to send a click event when ending the move or
resize operation to make xwayland's requests work correctly.
2018-07-22 23:10:19 +10:00
Ryan Dwyer
3faceadffe Fix focus bug with floating containers 2018-07-22 23:10:19 +10:00
Ryan Dwyer
cf5f5eaf8c Deny move/resize events for tiled xdg shell views 2018-07-22 23:10:19 +10:00
Ryan Dwyer
011d1ebfa4 Consider view's min/max sizes when resizing 2018-07-22 23:10:19 +10:00
Ryan Dwyer
9df660ee31 Store last button and use it when views request to move or resize 2018-07-22 23:10:19 +10:00
Ryan Dwyer
6767d8a593 Prevent re-uploading the same cursor image multiple times 2018-07-22 23:10:19 +10:00
Ryan Dwyer
0c87bff5d1 Replace static handle_end_operation with seat_end_mouse_operation 2018-07-22 23:10:19 +10:00
Ryan Dwyer
86f5531511 Remove unnecessary includes 2018-07-22 23:10:19 +10:00
Ryan Dwyer
ff445cc855 Implement xdg shell request_move and request_resize events
Also does a few other related things:

* Now uses enum wlr_edges instead of our own enum resize_edge
* Now uses wlr_xcursor_get_resize_name and removes our own
find_resize_edge_name
* Renames drag to move for consistency
2018-07-22 23:10:19 +10:00
Ryan Dwyer
1b3b75a094 Use wlr_keyboard_get_modifiers 2018-07-22 23:10:19 +10:00
Ryan Dwyer
dd337127d8 Use separate function for choosing edge cursor 2018-07-22 23:10:19 +10:00
Ryan Dwyer
31f91bd483 Improve resize performance by partially flushing the transaction queue
When interactively resizing some views (eg. Nautilus), new transactions
are added to the queue faster than the client can process them.
Previously, we would wait for the entire queue to be ready before
applying any of them, but in this case the transactions would time out,
giving the client choppy performance.

This changes the queue handling so it applies the transactions up to the
first waiting transaction, without waiting for the entire queue to be
ready.
2018-07-22 23:10:19 +10:00
Ryan Dwyer
350e9ea929 Fix clicking xwayland menus 2018-07-22 23:10:19 +10:00
Ryan Dwyer
c299b6b5cd Use max multiplier when resizing while preserving ratio 2018-07-22 23:10:19 +10:00
Ryan Dwyer
f9491c9584 Fix damage issue when moving and resizing 2018-07-22 23:10:19 +10:00
Ryan Dwyer
2c6616050a Make mod + resize do it from the top left corner 2018-07-22 23:10:19 +10:00
Ryan Dwyer
3aadf944ae Use WLR_MODIFIER_SHIFT 2018-07-22 23:10:19 +10:00
Ryan Dwyer
9fbe13b9be Implement floating_modifier and mouse operations for floating views
This implements the following:

* `floating_modifier` configuration directive
* Drag a floating window by its title bar
* Hold mod + drag a floating window from anywhere
* Resize a floating view by dragging the border
* Resize a floating view by holding mod and right clicking anywhere on
the view
* Resize a floating view and keep aspect ratio by holding shift while
resizing using either method
* Mouse cursor turns into resize when hovering floating border or corner
2018-07-22 23:10:19 +10:00
Ryan Dwyer
27f65b94ae
Merge pull request #2320 from RedSoxFan/reset-outputs-on-reload
Reset outputs on reload
2018-07-21 21:35:40 +10:00
Brian Ashworth
bc7d332109 Reset outputs on reload 2018-07-20 22:17:20 -04:00
Brian Ashworth
51730a0597
Merge pull request #2317 from RyanDwyer/force-display-urgency-hint
Implement force_display_urgency_hint
2018-07-20 21:46:56 -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
emersion
a2b2146f7f
Merge pull request #2318 from RedSoxFan/fix-output-wildcard
Fix output wildcard handling
2018-07-20 19:53:53 +01:00
Brian Ashworth
9605ab45f1 Fix output wildcard handling 2018-07-20 12:32:29 -04:00
Drew DeVault
b642d47c7f
Merge pull request #2313 from minus7/swaybar-hotspot-input-fix
swaybar: Fix scroll handling on workspace buttons
2018-07-20 11:45:47 -04:00
Brian Ashworth
0a0b676f64
Merge pull request #2316 from RyanDwyer/fix-floating-pointer-events
Fix pointer events for overlapping floating views
2018-07-19 19:52:58 -04:00
Ryan Dwyer
8789ceea87 Fix pointer events for overlapping floating views
Fixes #2315.
2018-07-20 09:41:36 +10:00
Drew DeVault
d28c4c0094
Merge pull request #2314 from emersion/update-wlroots-1148
Update for swaywm/wlroots#1148
2018-07-19 14:18:13 -07: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
minus
bfcfabee2b swaybar: Fix scroll handling on workspace buttons
As well as ignoring scroll events on status elements when click_events
is enabled.
Previously, using the scroll wheel on a workspace button would switch to
that workspace instead of scrolling through them. Clicks and scrolling
on status elements would always be processed by swaybar, too. So in case
you were using scrolling as volume control on a status item, swaybar
would additionally scroll through your workspaces.
2018-07-19 21:15:01 +02: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
3a13455b4e
Merge pull request #2309 from RyanDwyer/xwayland-set-hints
Allow xwayland views to become urgent when on a non-visible workspace
2018-07-19 13:29:58 +01: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
emersion
dfb45ded1c
Merge pull request #2306 from RyanDwyer/move-workspace-crash
Fix crash when moving workspace to output
2018-07-19 08:24:34 +01: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
Drew DeVault
4931d0ddc5
Merge pull request #2300 from emersion/override-redirect-updates
Handle xwayland override_redirect flag change
2018-07-18 12:42:09 -07: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