aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-07 14:08:39 +0000
committermarha <marha@users.sourceforge.net>2011-03-07 14:08:39 +0000
commitc7dc52700eea5353a1ec23331ebb81d671442c8c (patch)
tree8f2946b83b0eaf29280e6b937823ca7d19c7ab0d
parent407615d5836ff968b655eb4b9a5f186de3d4e7f9 (diff)
downloadvcxsrv-c7dc52700eea5353a1ec23331ebb81d671442c8c.tar.gz
vcxsrv-c7dc52700eea5353a1ec23331ebb81d671442c8c.tar.bz2
vcxsrv-c7dc52700eea5353a1ec23331ebb81d671442c8c.zip
Starting a local program works now
-rw-r--r--xorg-server/hw/xwin/xlaunch/config.h2
-rw-r--r--xorg-server/hw/xwin/xlaunch/main.cc26
2 files changed, 14 insertions, 14 deletions
diff --git a/xorg-server/hw/xwin/xlaunch/config.h b/xorg-server/hw/xwin/xlaunch/config.h
index e59c3e155..9c4fc0b1a 100644
--- a/xorg-server/hw/xwin/xlaunch/config.h
+++ b/xorg-server/hw/xwin/xlaunch/config.h
@@ -72,7 +72,7 @@ struct CConfig
CConfig() : window(MultiWindow), client(NoClient), clientstart(NoXClient), display("0"),
#endif
local(false), protocol(""),
- protocol_path(""), program("xeyes"), progs(PROG_NUMBER), compress(false), host(""), user("ago"),
+ protocol_path(""), program("xcalc"), progs(PROG_NUMBER), compress(false), host(""), user("ago"),
password(""), password_save(false), password_start(false), broadcast(false),
indirect(false), xdmcp_host(""), xhosts(HOST_NUMBER), clipboard(true), clipboardprimary(true), no_access_control(false),
font_server(), extra_params(), extra_ssh(), wgl(true) {};
diff --git a/xorg-server/hw/xwin/xlaunch/main.cc b/xorg-server/hw/xwin/xlaunch/main.cc
index 5eedc75e8..8b0f00579 100644
--- a/xorg-server/hw/xwin/xlaunch/main.cc
+++ b/xorg-server/hw/xwin/xlaunch/main.cc
@@ -34,9 +34,8 @@
#include <X11/Xlib.h>
-#ifdef _MSC_VER
-#define snprintf _snprintf
-#endif
+#include <stdlib.h>
+
/// @brief Send WM_ENDSESSION to all program windows.
/// This will shutdown the started xserver
BOOL CALLBACK KillWindowsProc(HWND hwnd, LPARAM lParam)
@@ -327,11 +326,9 @@ class CMyWizard : public CWizard
if (cbwnd == NULL)
return;
SendMessage(cbwnd, CB_RESETCONTENT, 0, 0);
- SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "xterm");
- SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "startkde");
- SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "gnome-session");
- SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) ".xinitrc");
- SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "wmaker");
+ SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "xcalc");
+ SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "xclock");
+ SendMessage(cbwnd, CB_ADDSTRING, 0, (LPARAM) "xwininfo");
SendMessage(cbwnd, CB_SETCURSEL, 0, 0);
}
/// @brief Fill protocol box with default values.
@@ -529,7 +526,7 @@ class CMyWizard : public CWizard
// Construct display strings
std::string display_id = ":" + config.display;
- std::string display = "localhost" + display_id + ":0";
+ std::string display = "DISPLAY=127.0.0.1" + display_id + ".0";
// Build Xsrv commandline
buffer = "vcxsrv " + display_id + " ";
@@ -584,14 +581,17 @@ class CMyWizard : public CWizard
if (!config.user.empty())
host = config.user + "@" + config.host;
if (config.protocol == "Putty")
- snprintf(cmdline,512,"plink -X %s %s",
+ _snprintf(cmdline,512,"plink -X %s %s",
host.c_str(),config.program.c_str());
else
- snprintf(cmdline,512,"ssh -Y %s %s",
+ _snprintf(cmdline,512,"ssh -Y %s %s",
host.c_str(),config.program.c_str());
client += cmdline;
- } else
+ }
+ else
+ {
client += config.program.c_str();
+ }
}
// Prepare program startup
@@ -620,7 +620,7 @@ class CMyWizard : public CWizard
if (!client.empty())
{
// Set DISPLAY variable
- SetEnvironmentVariable("DISPLAY",display.c_str());
+ _putenv(display.c_str());
// Wait for server to startup
dpy = WaitForServer(pi.hProcess);