From b5867e99dc820caca191c1cfc6490356ae810429 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 28 May 2019 08:42:16 +0200 Subject: [PATCH] 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. --- vncviewer/vncviewer.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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; -- 2.39.5