mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
overlay: add snap-to-edge overlay
...and unifies region overlay and snap-to-edge overlay into overlay.c. Snap-to-edge overlay is delayed for 150ms to prevent flickering when the view is dragged from an output to another (demo in discussion #1613). This also fixes a bug that region overlay is not shown when a modifier key is re-pressed.
This commit is contained in:
parent
d68376f2ac
commit
0b2d58ffc5
11 changed files with 260 additions and 150 deletions
|
|
@ -82,9 +82,9 @@ keyboard_modifiers_notify(struct wl_listener *listener, void *data)
|
|||
seat->region_prevent_snap = false;
|
||||
}
|
||||
|
||||
if (server->osd_state.cycle_view || server->grabbed_view
|
||||
if (server->osd_state.cycle_view
|
||||
|| seat->workspace_osd_shown_by_modifier) {
|
||||
if (!keyboard_any_modifiers_pressed(wlr_keyboard)) {
|
||||
if (!keyboard_any_modifiers_pressed(wlr_keyboard)) {
|
||||
if (server->osd_state.cycle_view) {
|
||||
if (key_state_nr_bound_keys()) {
|
||||
should_cancel_cycling_on_next_key_release = true;
|
||||
|
|
@ -95,11 +95,12 @@ keyboard_modifiers_notify(struct wl_listener *listener, void *data)
|
|||
if (seat->workspace_osd_shown_by_modifier) {
|
||||
workspaces_osd_hide(seat);
|
||||
}
|
||||
if (server->grabbed_view) {
|
||||
regions_hide_overlay(seat);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Pressing/releasing modifier key may show/hide region overlay */
|
||||
if (server->grabbed_view) {
|
||||
overlay_show(seat, server->grabbed_view);
|
||||
}
|
||||
|
||||
if (!input_method_keyboard_grab_forward_modifiers(keyboard)) {
|
||||
wlr_seat_keyboard_notify_modifiers(seat->seat,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue