From dccb054debe5f59b6327f69e055e0df77554889d Mon Sep 17 00:00:00 2001 From: Zoltan Zarkov Date: Sat, 5 Feb 2022 19:30:03 -0600 Subject: [PATCH] Set full screen and disable server scan in WebAssembly client --- client/gui-qt/fc_client.cpp | 4 ++++ client/gui-qt/page_network.cpp | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/client/gui-qt/fc_client.cpp b/client/gui-qt/fc_client.cpp index 9632ddf5a8..da3b8f22a3 100644 --- a/client/gui-qt/fc_client.cpp +++ b/client/gui-qt/fc_client.cpp @@ -61,6 +61,10 @@ extern "C" void real_science_report_dialog_update(void *); */ fc_client::fc_client() : QMainWindow(), current_file(QLatin1String("")) { +#ifdef __EMSCRIPTEN__ + setWindowFlags(Qt::FramelessWindowHint); + setWindowState(Qt::WindowFullScreen); +#endif QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); status_bar_queue.clear(); for (int i = 0; i <= PAGE_GAME; i++) { diff --git a/client/gui-qt/page_network.cpp b/client/gui-qt/page_network.cpp index 9d2dd736f8..3ce80d3bbb 100644 --- a/client/gui-qt/page_network.cpp +++ b/client/gui-qt/page_network.cpp @@ -284,6 +284,7 @@ void server_scan_error(struct server_scan *scan, const char *message) */ void page_network::destroy_server_scans() { +#ifndef __EMSCRIPTEN__ if (meta_scan) { server_scan_finish(meta_scan); meta_scan = NULL; @@ -305,6 +306,7 @@ void page_network::destroy_server_scans() lan_scan_timer->disconnect(); FC_FREE(lan_scan_timer); } +#endif } /** @@ -312,6 +314,7 @@ void page_network::destroy_server_scans() */ void page_network::update_network_lists() { +#ifndef __EMSCRIPTEN__ destroy_server_scans(); lan_scan_timer = new QTimer(this); @@ -331,6 +334,7 @@ void page_network::update_network_lists() &page_network::slot_meta_scan); meta_scan_timer->start(800); } +#endif } /** @@ -338,6 +342,7 @@ void page_network::update_network_lists() */ bool page_network::check_server_scan(server_scan *scan_data) { +#ifndef __EMSCRIPTEN__ struct server_scan *scan = scan_data; enum server_scan_status stat; @@ -357,6 +362,9 @@ bool page_network::check_server_scan(server_scan *scan_data) } return !(stat == SCAN_STATUS_ERROR || stat == SCAN_STATUS_DONE); +#else + return true; +#endif } /** @@ -502,6 +510,7 @@ void page_network::slot_selection_changed(const QItemSelection &selected, ui.lan_widget->clearSelection(); } +#ifndef __EMSCRIPTEN__ srvrs = server_scan_get_list(meta_scan); if (srvrs) { pserver = server_list_get(srvrs, index.row()); @@ -535,4 +544,5 @@ void page_network::slot_selection_changed(const QItemSelection &selected, ui.info_widget->setItem(k, col, item); } } +#endif }