修复pc模式下最大化、恢复窗口,全屏、取消全屏窗口时虚拟窗口坐标不对得BUG

This commit is contained in:
fangxiang 2022-07-13 20:01:16 +08:00
parent 9ad8dd45ed
commit 15b7d0c143
1 changed files with 19 additions and 2 deletions

View File

@ -12,7 +12,7 @@
<div <div
id="windows" id="windows"
style="position: absolute" style="position: absolute"
v-if="$store.state.power_state" v-if="$store.state.power_state && show_windows_flag"
> >
<vue3-resize-drag <vue3-resize-drag
:w="item.width * ($refs.wall?.clientWidth ?? 0)" :w="item.width * ($refs.wall?.clientWidth ?? 0)"
@ -179,7 +179,7 @@
<script lang="ts"> <script lang="ts">
import GlobalData from "src/common/GlobalData"; 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"); const elementResizeDetectorMaker = require("element-resize-detector");
import { Protocol } from "src/entities/WSProtocol"; import { Protocol } from "src/entities/WSProtocol";
import Window from "src/components/Window.vue"; import Window from "src/components/Window.vue";
@ -238,6 +238,22 @@ export default defineComponent({
const file_manage_dialog: Ref<any> = ref(null); const file_manage_dialog: Ref<any> = ref(null);
const window_rect_edit_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_x = ref(0);
const last_context_menu_pos_y = ref(0); const last_context_menu_pos_y = ref(0);
@ -700,6 +716,7 @@ export default defineComponent({
wall_cols, wall_cols,
item_witdh, item_witdh,
item_height, item_height,
show_windows_flag,
plan_running, plan_running,
edit_volume_dialog, edit_volume_dialog,
polling_setting_dialog, polling_setting_dialog,