aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2024-02-13 11:45:36 +0900
committerTakashi Yano <takashi.yano@nifty.ne.jp>2024-02-13 23:27:44 +0900
commit8aad3a7edeb27b163db551403eecc94c959c857a (patch)
tree30600cc5ab95d352ffc5185d6ddfa4b9d824d3ac /winsup/cygwin
parentac92c4c9f564eda3158c1c0742c0939e6152f769 (diff)
downloadnewlib-8aad3a7edeb27b163db551403eecc94c959c857a.zip
newlib-8aad3a7edeb27b163db551403eecc94c959c857a.tar.gz
newlib-8aad3a7edeb27b163db551403eecc94c959c857a.tar.bz2
Cygwin: console: Fix a problem that minor ID is incorrect in ConEmu.
Previously, minor device number of console was not assigned correctly in ConEmu environment. This is because console window of ConEmu is not enumerated by EnumWindows(). This patch fixes the issue. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/autoload.cc2
-rw-r--r--winsup/cygwin/devices.cc7
-rw-r--r--winsup/cygwin/devices.in7
-rw-r--r--winsup/cygwin/fhandler/console.cc14
4 files changed, 30 insertions, 0 deletions
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc
index 7e610bd..65e906e 100644
--- a/winsup/cygwin/autoload.cc
+++ b/winsup/cygwin/autoload.cc
@@ -548,7 +548,9 @@ LoadDLLfunc (DefWindowProcW, user32)
LoadDLLfunc (DestroyWindow, user32)
LoadDLLfunc (DispatchMessageW, user32)
LoadDLLfunc (EmptyClipboard, user32)
+LoadDLLfunc (EnumChildWindows, user32)
LoadDLLfunc (EnumWindows, user32)
+LoadDLLfunc (GetClassNameA, user32)
LoadDLLfunc (GetClipboardData, user32)
LoadDLLfunc (GetDC, user32)
LoadDLLfunc (GetForegroundWindow, user32)
diff --git a/winsup/cygwin/devices.cc b/winsup/cygwin/devices.cc
index 167b0e4..ca1fdf3 100644
--- a/winsup/cygwin/devices.cc
+++ b/winsup/cygwin/devices.cc
@@ -81,6 +81,13 @@ enum_cons_dev (HWND hw, LPARAM lp)
UnmapViewOfFile ((void *) cs);
CloseHandle (h);
}
+ else
+ { /* Only for ConEmu */
+ char class_hw[32];
+ if (19 == GetClassName (hw, class_hw, sizeof (class_hw))
+ && 0 == strcmp (class_hw, "VirtualConsoleClass"))
+ EnumChildWindows (hw, enum_cons_dev, lp);
+ }
return TRUE;
}
diff --git a/winsup/cygwin/devices.in b/winsup/cygwin/devices.in
index 48d3843..842f09c 100644
--- a/winsup/cygwin/devices.in
+++ b/winsup/cygwin/devices.in
@@ -77,6 +77,13 @@ enum_cons_dev (HWND hw, LPARAM lp)
UnmapViewOfFile ((void *) cs);
CloseHandle (h);
}
+ else
+ { /* Only for ConEmu */
+ char class_hw[32];
+ if (19 == GetClassName (hw, class_hw, sizeof (class_hw))
+ && 0 == strcmp (class_hw, "VirtualConsoleClass"))
+ EnumChildWindows (hw, enum_cons_dev, lp);
+ }
return TRUE;
}
diff --git a/winsup/cygwin/fhandler/console.cc b/winsup/cygwin/fhandler/console.cc
index b0907eb..70824e6 100644
--- a/winsup/cygwin/fhandler/console.cc
+++ b/winsup/cygwin/fhandler/console.cc
@@ -250,6 +250,13 @@ enum_windows (HWND hw, LPARAM lp)
UnmapViewOfFile ((void *) cs);
CloseHandle (h);
}
+ else
+ { /* Only for ConEmu */
+ char class_hw[32];
+ if (19 == GetClassName (hw, class_hw, sizeof (class_hw))
+ && 0 == strcmp (class_hw, "VirtualConsoleClass"))
+ EnumChildWindows (hw, enum_windows, lp);
+ }
return TRUE;
}
@@ -656,6 +663,13 @@ scan_console (HWND hw, LPARAM lp)
UnmapViewOfFile ((void *) cs);
CloseHandle (h);
}
+ else
+ { /* Only for ConEmu */
+ char class_hw[32];
+ if (19 == GetClassName (hw, class_hw, sizeof (class_hw))
+ && 0 == strcmp (class_hw, "VirtualConsoleClass"))
+ EnumChildWindows (hw, scan_console, lp);
+ }
return TRUE;
}