修复虚拟窗口可能为透明背景的BUG

This commit is contained in:
fangxiang 2022-03-25 16:24:28 +08:00
parent 9b3b785ac6
commit d1ef26e2ae
5 changed files with 28 additions and 15 deletions

View File

@ -554,7 +554,8 @@ export default class ClientConnection {
x: number, x: number,
y: number, y: number,
width: number, width: number,
height: number height: number,
limit: boolean = true
) { ) {
this.ws?.send( this.ws?.send(
JSON.stringify( JSON.stringify(
@ -563,7 +564,8 @@ export default class ClientConnection {
x, x,
y, y,
width, width,
height height,
limit
) )
) )
); );

View File

@ -30,12 +30,12 @@
<q-card-section style="max-height: 50vh; width: 35vw" class="scroll"> <q-card-section style="max-height: 50vh; width: 35vw" class="scroll">
<q-list> <q-list>
<q-item> <q-item v-if="false">
<q-item-section> <q-item-section>
{{ $t("product name") }}: {{ $t("TV splicing box") }} {{ $t("product name") }}: {{ $t("TV splicing box") }}
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item> <q-item v-if="false">
<q-item-section> <q-item-section>
{{ $t("copyright") }}: {{ $t("guangdong chuangxian jishu") }} LTD. {{ $t("copyright") }}: {{ $t("guangdong chuangxian jishu") }} LTD.
</q-item-section> </q-item-section>

View File

@ -3,6 +3,8 @@ import { SignalSourceEntity } from "./SignalSourceEntity";
import { StringKeyValueEntity } from "./StringKeyValueEntity"; import { StringKeyValueEntity } from "./StringKeyValueEntity";
import { Protocol } from "./WSProtocol"; import { Protocol } from "./WSProtocol";
import window_color_list from "../store/window_color_list.js";
export class MultimediaWindowEntity extends BaseEntity { export class MultimediaWindowEntity extends BaseEntity {
x: number = 0; x: number = 0;
y: number = 0; y: number = 0;
@ -45,5 +47,7 @@ export class WindowOpenNotifyEntity extends MultimediaWindowEntity {
/** 轮询时的属性,不轮询时无效 */ /** 轮询时的属性,不轮询时无效 */
polling_window_type: string = "EWindowType::Normal"; polling_window_type: string = "EWindowType::Normal";
client_color: string = ""; client_color: string = window_color_list.length
? window_color_list[Math.round(Math.random() * window_color_list.length)]
: "blue";
} }

View File

@ -628,12 +628,15 @@ export namespace Protocol {
y: number = 0; y: number = 0;
width: number = 0; width: number = 0;
height: number = 0; height: number = 0;
limit: boolean = true;
constructor( constructor(
window_id: number, window_id: number,
x: number, x: number,
y: number, y: number,
width: number, width: number,
height: number height: number,
limit: boolean = true
) { ) {
super(); super();
this.command = Commands.kSetWindowGeometry; this.command = Commands.kSetWindowGeometry;
@ -642,6 +645,7 @@ export namespace Protocol {
this.y = y ?? 0; this.y = y ?? 0;
this.width = width ?? 0; this.width = width ?? 0;
this.height = height ?? 0; this.height = height ?? 0;
this.limit = limit ?? 0;
} }
} }

View File

@ -338,10 +338,12 @@ export default store(function (/* { ssrContext } */) {
} }
for (const window of state.windows) { for (const window of state.windows) {
if (window) { if (window) {
window.client_color = window_color_list.splice( try {
Math.round(Math.random() * window_color_list.length), window.client_color = window_color_list.splice(
1 Math.round(Math.random() * window_color_list.length),
)[0]; 1
)[0];
} catch {}
} }
} }
} }
@ -352,11 +354,12 @@ export default store(function (/* { ssrContext } */) {
}, },
pushWindow(state: StateInterface, playload?: WindowOpenNotifyEntity) { pushWindow(state: StateInterface, playload?: WindowOpenNotifyEntity) {
if (playload) { if (playload) {
playload.client_color = window_color_list.splice( try {
Math.round(Math.random() * window_color_list.length), playload.client_color = window_color_list.splice(
1 Math.round(Math.random() * window_color_list.length),
)[0]; 1
)[0];
} catch {}
state.windows.push(playload); state.windows.push(playload);
state.windows_sort.push(playload.uuid); state.windows_sort.push(playload.uuid);
} }