Merge pull request #176 from clang-retro/claude/project-thread-deqtlz

Haiku: build with R1/beta5 headers, COM ports in /dev/ports, clicks on a modal dialog's owner
This commit is contained in:
Neo authored and GitHub committed 2026-11-28 13:17:04 -08:00
commit 57b1e8a47a
5 files changed
+40

No files matched your search

+9
View File
@@ -17,6 +17,9 @@ which uses the Be API (`BApplication`, `BWindow`, `BView`, `BBitmap`).
ARCH=x86 unix-sdk/haiku/build-sysroot.sh haiku-sysroot32 # 32-bit x86
```
A sysroot from D-Modem's `platforms/haiku/haiku_sysroot.py` (the
packages of Haiku R1/beta5) also builds the x86_64 library.
## Build the library
```sh
@@ -71,6 +74,12 @@ How it works:
- The clipboard is `be_clipboard`, with `text/plain`.
- The fonts come from `/boot/system/data/fonts` and the font folders of
the user. The user interface font is Noto Sans.
- A click on a disabled window (the owner of a modal dialog) does not go
to that window. The click brings the dialog to the front, as on
Windows.
- `COM1` is the first serial port in `/dev/ports` (by name), `COM2` is
the second port, and so on. The path of a port (`/dev/ports/usb0`)
also opens it.
Set `WINPORT_BACKEND=headless` to keep the windows in memory, as on
Linux.
+13
View File
@@ -179,6 +179,19 @@ void Handle(const haiku::Event& e) {
msg = up[e.button];
g_buttons &= ~flag[e.button];
}
// A disabled window (the owner of a modal dialog) takes no mouse
// input. A click on it brings its last active popup to the front,
// as on Windows.
if ((n->w->style & WS_DISABLED) && !GetCapture()) {
if (e.kind != Event::kMouseDown) break;
HWND h = GetLastActivePopup(n->w->hwnd);
for (Native* p : g_natives)
if (p->w->hwnd == h && h != n->w->hwnd && IsWindowEnabled(h)) {
SetForegroundWindow(h);
haiku::Show(p->win, true, true);
}
break;
}
MouseInput(n->w, msg, e.x, e.y, Keys(e.mods));
break;
}
+11
View File
@@ -527,6 +527,17 @@ std::string CommDevice(const std::string& name) {
std::sort(devs.begin(), devs.end());
if ((size_t)num <= devs.size()) return "/dev/" + devs[num - 1];
return "-";
#elif defined(__HAIKU__)
// The serial ports in /dev/ports (pc_serial0, usb0 and on), by name.
std::vector<std::string> devs;
if (DIR* d = opendir("/dev/ports")) {
while (dirent* e = readdir(d))
if (e->d_name[0] != '.') devs.push_back(e->d_name);
closedir(d);
}
std::sort(devs.begin(), devs.end());
if ((size_t)num <= devs.size()) return "/dev/ports/" + devs[num - 1];
return "-";
#else
return "/dev/ttyS" + std::to_string(num - 1);
#endif
+5
View File
@@ -16,6 +16,11 @@
#include <dirent.h>
#include <dlfcn.h>
// The headers of Haiku R1/beta5 have no RTLD_NOLOAD. There a dlopen of a library
// that is loaded gives its handle, and of one that is not loads it.
#ifndef RTLD_NOLOAD
#define RTLD_NOLOAD 0
#endif
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
+2
View File
@@ -47,7 +47,9 @@ const ErrnoMap kErrors[] = {
{EPROTOTYPE, WSAEPROTOTYPE},
{ENOPROTOOPT, WSAENOPROTOOPT},
{EPROTONOSUPPORT, WSAEPROTONOSUPPORT},
#ifdef ESOCKTNOSUPPORT // not in the headers of Haiku R1/beta5
{ESOCKTNOSUPPORT, WSAESOCKTNOSUPPORT},
#endif
{EOPNOTSUPP, WSAEOPNOTSUPP},
{EPFNOSUPPORT, WSAEPFNOSUPPORT},
{EAFNOSUPPORT, WSAEAFNOSUPPORT},