mirror of
https://github.com/penpot/penpot.git
synced 2025-05-08 07:25:54 +02:00
🐛 Fix deactivation of show distances when alt-tab is used
Alt key with a shape selected activates show-distances mode. If you press Alt+tab, in many window managers the window is switched, and thus the alt keydown event is sent to other app and does not reach Penpot. So, we need to deactivate the mode also on window blur.
This commit is contained in:
parent
568338ad68
commit
25f7c14f97
3 changed files with 4 additions and 6 deletions
|
@ -149,7 +149,7 @@
|
|||
(mf/use-effect
|
||||
(mf/deps focus-out)
|
||||
(fn []
|
||||
(let [keys [(events/listen globals/document EventType.FOCUSOUT focus-out)]]
|
||||
(let [keys [(events/listen globals/window EventType.BLUR focus-out)]]
|
||||
#(doseq [key keys]
|
||||
(events/unlistenByKey key)))))
|
||||
|
||||
|
|
|
@ -239,7 +239,7 @@
|
|||
|
||||
first-selected-shape (first selected-shapes)
|
||||
selecting-first-level-frame? (and one-selected-shape?
|
||||
(cph/root-frame? first-selected-shape))
|
||||
(cph/root-frame? first-selected-shape))
|
||||
|
||||
offset-x (if selecting-first-level-frame?
|
||||
(:x first-selected-shape)
|
||||
|
@ -591,5 +591,4 @@
|
|||
[:& grid-layout/editor
|
||||
{:zoom zoom
|
||||
:objects base-objects
|
||||
:shape (get base-objects edition)}])
|
||||
]]]))
|
||||
:shape (get base-objects edition)}])]]]))
|
||||
|
|
|
@ -173,8 +173,7 @@
|
|||
(->> move-stream
|
||||
(rx/tap #(reset! last-point-ref %))
|
||||
;; When transforming shapes we stop querying the worker
|
||||
(rx/merge-map query-point)
|
||||
))))]
|
||||
(rx/merge-map query-point)))))]
|
||||
|
||||
;; Refresh the refs on a value change
|
||||
(mf/use-effect
|
||||
|
|
Loading…
Add table
Reference in a new issue