diff --git a/src/components/Window.vue b/src/components/Window.vue index 45d5e39..f3ba5f8 100644 --- a/src/components/Window.vue +++ b/src/components/Window.vue @@ -282,6 +282,7 @@ export default defineComponent({ let focused = ref(false); let can_move = ref(true); let can_resize = ref(true); + let move_flag = false; const onUnSelectAllWindows = () => { selected.value = false; @@ -331,6 +332,7 @@ export default defineComponent({ mouse_down_flag = false; mouse_last_pos_x = 0; mouse_last_pos_y = 0; + move_flag = false; }; const flags = new _Flags(); @@ -373,6 +375,7 @@ export default defineComponent({ mouse_last_pos_x = evt.x; mouse_last_pos_y = evt.y; + move_flag = true; } }, @@ -411,21 +414,26 @@ export default defineComponent({ mouse_last_pos_x = evt.x; mouse_last_pos_y = evt.y; + move_flag = true; } }, cleanMouseDownFlag, onMouseLeave(evt: MouseEvent) { if (selected.value && mouse_down_flag) { + if (move_flag) { + emit("commit_geometry", props.window); + } cleanMouseDownFlag(); - emit("commit_geometry", props.window); } }, onMouseUp(evt: MouseEvent) { if (selected.value && mouse_down_flag) { + if (move_flag) { + emit("commit_geometry", props.window); + } cleanMouseDownFlag(); - emit("commit_geometry", props.window); } if (!focused) {