From: Pierre Ossman Date: Tue, 28 May 2019 06:42:16 +0000 (+0200) Subject: Open X11 display properly X-Git-Tag: v1.10.90~27^2~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b5867e99dc820caca191c1cfc6490356ae810429;p=tigervnc.git Open X11 display properly We need to make sure everything happens in the correct order during startup for the X11 display to open correctly. Primarily it means we need to parse the arguments and open the display before anything might make any X11 calls, as we may have a -display argument. --- diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx index 06c7fbf8..7b1ac92e 100644 --- a/vncviewer/vncviewer.cxx +++ b/vncviewer/vncviewer.cxx @@ -539,8 +539,6 @@ int main(int argc, char** argv) signal(SIGINT, CleanupSignalHandler); signal(SIGTERM, CleanupSignalHandler); - init_fltk(); - Configuration::enableViewerParams(); /* Load the default parameter settings */ @@ -578,11 +576,6 @@ int main(int argc, char** argv) i++; } - // Check if the server name in reality is a configuration file - potentiallyLoadConfigurationFile(vncServerName); - - mkvnchomedir(); - #if !defined(WIN32) && !defined(__APPLE__) if (strcmp(display, "") != 0) { Fl::display(display); @@ -591,6 +584,13 @@ int main(int argc, char** argv) XkbSetDetectableAutoRepeat(fl_display, True, NULL); #endif + init_fltk(); + + // Check if the server name in reality is a configuration file + potentiallyLoadConfigurationFile(vncServerName); + + mkvnchomedir(); + CSecurity::upg = &dlg; #ifdef HAVE_GNUTLS CSecurityTLS::msg = &dlg;