This commit is contained in:
Vadim Lopatin 2017-08-14 10:05:55 +03:00
parent 5b96e81d1e
commit e58f2a1abe
3 changed files with 23 additions and 14 deletions

View File

@ -713,6 +713,11 @@ alias currentDir = std.file.getcwd;
return path[0 .. lastSlash + 1]; return path[0 .. lastSlash + 1];
} }
/// Returns current executable path and file name
@property string exeFilename() {
return thisExePath();
}
/** /**
Returns application data directory Returns application data directory

View File

@ -1505,8 +1505,10 @@ version (Windows) {
return result; return result;
} }
/// split command line arg list; prepend with executable file name
string[] splitCmdLine(string line) { string[] splitCmdLine(string line) {
string[] res; string[] res;
res ~= exeFilename();
int start = 0; int start = 0;
bool insideQuotes = false; bool insideQuotes = false;
for (int i = 0; i <= line.length; i++) { for (int i = 0; i <= line.length; i++) {

View File

@ -276,11 +276,11 @@ class Win32Window : Window {
if (flags & WindowFlag.Fullscreen) { if (flags & WindowFlag.Fullscreen) {
// fullscreen // fullscreen
x = screenRc.left; x = screenRc.left;
y = screenRc.top; y = screenRc.top;
_dx = screenRc.width; _dx = screenRc.width;
_dy = screenRc.height; _dy = screenRc.height;
ws = WS_POPUP; ws = WS_POPUP;
} }
@ -366,16 +366,16 @@ class Win32Window : Window {
if (_hwnd) { if (_hwnd) {
hMonitor = MonitorFromWindow(_hwnd, MONITOR_DEFAULTTONEAREST); hMonitor = MonitorFromWindow(_hwnd, MONITOR_DEFAULTTONEAREST);
} else { } else {
hMonitor = MonitorFromPoint(POINT(0,0), MONITOR_DEFAULTTOPRIMARY); hMonitor = MonitorFromPoint(POINT(0,0), MONITOR_DEFAULTTOPRIMARY);
} }
GetMonitorInfo(hMonitor, GetMonitorInfo(hMonitor,
&monitor_info); &monitor_info);
Rect res; Rect res;
res.left = monitor_info.rcMonitor.left; res.left = monitor_info.rcMonitor.left;
res.top = monitor_info.rcMonitor.top; res.top = monitor_info.rcMonitor.top;
res.right = monitor_info.rcMonitor.right; res.right = monitor_info.rcMonitor.right;
res.bottom = monitor_info.rcMonitor.bottom; res.bottom = monitor_info.rcMonitor.bottom;
return res; return res;
} }
~this() { ~this() {
@ -1087,7 +1087,7 @@ class Win32Platform : Platform {
for (uint i = 0; i + 1 < _windowList.length; i++) { for (uint i = 0; i + 1 < _windowList.length; i++) {
if (_windowList[i] is w) { if (_windowList[i] is w) {
for (uint j = i + 1; j < _windowList.length; j++) { for (uint j = i + 1; j < _windowList.length; j++) {
if (_windowList[j].flags & WindowFlag.Modal && _windowList[j]._windowState != WindowState.hidden) if (_windowList[j].flags & WindowFlag.Modal && _windowList[j].windowState != WindowState.hidden)
return true; return true;
} }
return false; return false;
@ -1205,8 +1205,10 @@ int DLANGUIWinMain(void* hInstance, void* hPrevInstance,
return result; return result;
} }
/// split command line arg list; prepend with executable file name
string[] splitCmdLine(string line) { string[] splitCmdLine(string line) {
string[] res; string[] res;
res ~= exeFilename();
int start = 0; int start = 0;
bool insideQuotes = false; bool insideQuotes = false;
for (int i = 0; i <= line.length; i++) { for (int i = 0; i <= line.length; i++) {