specify linux cm target size at beginning
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
51cfa6f666
commit
248f18f0d8
@ -4,6 +4,7 @@
|
|||||||
#define RUSTDESK_LIB_PATH "librustdesk.so"
|
#define RUSTDESK_LIB_PATH "librustdesk.so"
|
||||||
// #define RUSTDESK_LIB_PATH "/usr/lib/rustdesk/librustdesk.so"
|
// #define RUSTDESK_LIB_PATH "/usr/lib/rustdesk/librustdesk.so"
|
||||||
typedef bool (*RustDeskCoreMain)();
|
typedef bool (*RustDeskCoreMain)();
|
||||||
|
bool gIsConnectionManager = false;
|
||||||
|
|
||||||
bool flutter_rustdesk_core_main() {
|
bool flutter_rustdesk_core_main() {
|
||||||
void* librustdesk = dlopen(RUSTDESK_LIB_PATH, RTLD_LAZY);
|
void* librustdesk = dlopen(RUSTDESK_LIB_PATH, RTLD_LAZY);
|
||||||
@ -24,6 +25,11 @@ int main(int argc, char** argv) {
|
|||||||
if (!flutter_rustdesk_core_main()) {
|
if (!flutter_rustdesk_core_main()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < argc; i++) {
|
||||||
|
if (strcmp(argv[i], "--cm") == 0) {
|
||||||
|
gIsConnectionManager = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
g_autoptr(MyApplication) app = my_application_new();
|
g_autoptr(MyApplication) app = my_application_new();
|
||||||
return g_application_run(G_APPLICATION(app), argc, argv);
|
return g_application_run(G_APPLICATION(app), argc, argv);
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,8 @@ struct _MyApplication {
|
|||||||
|
|
||||||
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
|
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
|
||||||
|
|
||||||
|
extern bool gIsConnectionManager;
|
||||||
|
|
||||||
// Implements GApplication::activate.
|
// Implements GApplication::activate.
|
||||||
static void my_application_activate(GApplication* application) {
|
static void my_application_activate(GApplication* application) {
|
||||||
MyApplication* self = MY_APPLICATION(application);
|
MyApplication* self = MY_APPLICATION(application);
|
||||||
@ -51,7 +53,12 @@ static void my_application_activate(GApplication* application) {
|
|||||||
|
|
||||||
// auto bdw = bitsdojo_window_from(window); // <--- add this line
|
// auto bdw = bitsdojo_window_from(window); // <--- add this line
|
||||||
// bdw->setCustomFrame(true); // <-- add this line
|
// bdw->setCustomFrame(true); // <-- add this line
|
||||||
gtk_window_set_default_size(window, 800, 600); // <-- comment this line
|
int width = 800, height = 600;
|
||||||
|
if (gIsConnectionManager) {
|
||||||
|
width = 300;
|
||||||
|
height = 400;
|
||||||
|
}
|
||||||
|
gtk_window_set_default_size(window, width, height); // <-- comment this line
|
||||||
gtk_widget_show(GTK_WIDGET(window));
|
gtk_widget_show(GTK_WIDGET(window));
|
||||||
gtk_widget_set_opacity(GTK_WIDGET(window), 0);
|
gtk_widget_set_opacity(GTK_WIDGET(window), 0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user