修复pc模式下最大化、恢复窗口,全屏、取消全屏窗口时虚拟窗口坐标不对得BUG
This commit is contained in:
parent
9ad8dd45ed
commit
15b7d0c143
|
@ -12,7 +12,7 @@
|
|||
<div
|
||||
id="windows"
|
||||
style="position: absolute"
|
||||
v-if="$store.state.power_state"
|
||||
v-if="$store.state.power_state && show_windows_flag"
|
||||
>
|
||||
<vue3-resize-drag
|
||||
:w="item.width * ($refs.wall?.clientWidth ?? 0)"
|
||||
|
@ -179,7 +179,7 @@
|
|||
|
||||
<script lang="ts">
|
||||
import GlobalData from "src/common/GlobalData";
|
||||
import { defineComponent, ref, Ref, computed, onMounted } from "vue";
|
||||
import { defineComponent, ref, Ref, computed, onMounted, nextTick } from "vue";
|
||||
const elementResizeDetectorMaker = require("element-resize-detector");
|
||||
import { Protocol } from "src/entities/WSProtocol";
|
||||
import Window from "src/components/Window.vue";
|
||||
|
@ -238,6 +238,22 @@ export default defineComponent({
|
|||
const file_manage_dialog: Ref<any> = ref(null);
|
||||
const window_rect_edit_dialog: Ref<any> = ref(null);
|
||||
|
||||
const show_windows_flag = ref(true); // 用于刷新 window 坐标
|
||||
const refresh_windows_pos = () => {
|
||||
// 浏览器窗口大小调整时, 重新显示隐藏虚拟窗口来刷新虚拟窗口坐标
|
||||
show_windows_flag.value = false;
|
||||
setTimeout(() => {
|
||||
nextTick(() => {
|
||||
show_windows_flag.value = true;
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
|
||||
EventBus.getInstance().on(
|
||||
EventNamesDefine.WindowResize,
|
||||
refresh_windows_pos
|
||||
);
|
||||
|
||||
const last_context_menu_pos_x = ref(0);
|
||||
const last_context_menu_pos_y = ref(0);
|
||||
|
||||
|
@ -700,6 +716,7 @@ export default defineComponent({
|
|||
wall_cols,
|
||||
item_witdh,
|
||||
item_height,
|
||||
show_windows_flag,
|
||||
plan_running,
|
||||
edit_volume_dialog,
|
||||
polling_setting_dialog,
|
||||
|
|
Loading…
Reference in New Issue