mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-03 03:19:27 +08:00
This commit is contained in:
parent
b6feaa695f
commit
334c94ceb3
@ -311,3 +311,10 @@ function Progress()
|
|||||||
|
|
||||||
this.value = "";
|
this.value = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isReasonableSize(r) {
|
||||||
|
var x = r[0];
|
||||||
|
var y = r[1];
|
||||||
|
return !(x < -3200 || x > 3200 || y < -3200 || y > 3200);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -708,10 +708,10 @@ function self.closing() {
|
|||||||
|
|
||||||
function self.ready() {
|
function self.ready() {
|
||||||
var r = handler.get_size();
|
var r = handler.get_size();
|
||||||
if (r[2] == 0) {
|
if (isReasonableSize(r) && r[2] > 0) {
|
||||||
centerize(800, 600);
|
|
||||||
} else {
|
|
||||||
view.move(r[0], r[1], r[2], r[3]);
|
view.move(r[0], r[1], r[2], r[3]);
|
||||||
|
} else {
|
||||||
|
centerize(800, 600);
|
||||||
}
|
}
|
||||||
if (!handler.get_remote_id()) {
|
if (!handler.get_remote_id()) {
|
||||||
view.focus = $(#remote_id);
|
view.focus = $(#remote_id);
|
||||||
|
@ -396,7 +396,7 @@ function self.ready() {
|
|||||||
var h = 640;
|
var h = 640;
|
||||||
if (is_file_transfer || is_port_forward) {
|
if (is_file_transfer || is_port_forward) {
|
||||||
var r = handler.get_size();
|
var r = handler.get_size();
|
||||||
if (r[0] > 0) {
|
if (isReasonableSize(r) && r[2] > 0) {
|
||||||
view.move(r[0], r[1], r[2], r[3]);
|
view.move(r[0], r[1], r[2], r[3]);
|
||||||
} else {
|
} else {
|
||||||
centerize(w, h);
|
centerize(w, h);
|
||||||
@ -418,7 +418,7 @@ handler.adaptSize = function() {
|
|||||||
var (fx, fy, fw, fh) = view.screenBox(#frame, #rectw);
|
var (fx, fy, fw, fh) = view.screenBox(#frame, #rectw);
|
||||||
if (is_osx) workarea_offset = sy;
|
if (is_osx) workarea_offset = sy;
|
||||||
var r = handler.get_size();
|
var r = handler.get_size();
|
||||||
if (r[2] > 0) {
|
if (isReasonableSize(r) && r[2] > 0) {
|
||||||
if (r[2] >= fw && r[3] >= fh && !is_linux) {
|
if (r[2] >= fw && r[3] >= fh && !is_linux) {
|
||||||
view.windowState = View.WINDOW_FULL_SCREEN;
|
view.windowState = View.WINDOW_FULL_SCREEN;
|
||||||
stdout.println("Initialize to full screen");
|
stdout.println("Initialize to full screen");
|
||||||
|
Loading…
Reference in New Issue
Block a user