16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 19:09:20 +02:00

replace spaces in monitor name

This commit is contained in:
milek7
2019-03-05 19:43:53 +01:00
parent 1bb700c1ec
commit 2d66192c9a
2 changed files with 8 additions and 4 deletions

View File

@@ -586,11 +586,13 @@ eu07_application::init_glfw() {
WriteLog("available monitors:");
for (size_t i = 0; i < monitor_count; i++) {
const char *name = glfwGetMonitorName(monitors[i]);
std::string name(glfwGetMonitorName(monitors[i]));
std::replace(std::begin(name), std::end(name), ' ', '_');
int x, y;
glfwGetMonitorPos(monitors[i], &x, &y);
std::string desc = std::string(name) + ":" + std::to_string(x) + "," + std::to_string(y);
std::string desc = name + ":" + std::to_string(x) + "," + std::to_string(y);
WriteLog(desc);
if (desc == Global.fullscreen_monitor)

View File

@@ -26,11 +26,13 @@ texture_window::texture_window(texture_handle src, std::string surfacename)
GLFWmonitor **monitors = glfwGetMonitors(&monitor_count);
for (size_t i = 0; i < monitor_count; i++) {
const char *name = glfwGetMonitorName(monitors[i]);
std::string name(glfwGetMonitorName(monitors[i]));
std::replace(std::begin(name), std::end(name), ' ', '_');
int x, y;
glfwGetMonitorPos(monitors[i], &x, &y);
std::string desc = std::string(name) + ":" + std::to_string(x) + "," + std::to_string(y);
std::string desc = name + ":" + std::to_string(x) + "," + std::to_string(y);
auto iter = Global.python_monitormap.find(surfacename);
if (iter != Global.python_monitormap.end()