mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 13:59:19 +02:00
replace spaces in monitor name
This commit is contained in:
@@ -586,11 +586,13 @@ eu07_application::init_glfw() {
|
|||||||
|
|
||||||
WriteLog("available monitors:");
|
WriteLog("available monitors:");
|
||||||
for (size_t i = 0; i < monitor_count; i++) {
|
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;
|
int x, y;
|
||||||
glfwGetMonitorPos(monitors[i], &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);
|
WriteLog(desc);
|
||||||
|
|
||||||
if (desc == Global.fullscreen_monitor)
|
if (desc == Global.fullscreen_monitor)
|
||||||
|
|||||||
@@ -26,11 +26,13 @@ texture_window::texture_window(texture_handle src, std::string surfacename)
|
|||||||
GLFWmonitor **monitors = glfwGetMonitors(&monitor_count);
|
GLFWmonitor **monitors = glfwGetMonitors(&monitor_count);
|
||||||
|
|
||||||
for (size_t i = 0; i < monitor_count; i++) {
|
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;
|
int x, y;
|
||||||
glfwGetMonitorPos(monitors[i], &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);
|
auto iter = Global.python_monitormap.find(surfacename);
|
||||||
if (iter != Global.python_monitormap.end()
|
if (iter != Global.python_monitormap.end()
|
||||||
|
|||||||
Reference in New Issue
Block a user