Compare commits
2 Commits
b198c673ae
...
a497e4267f
| Author | SHA1 | Date | |
|---|---|---|---|
| a497e4267f | |||
| 7252c985b8 |
@@ -1,6 +1,6 @@
|
||||
From 075f6a11926e247ba64efd25a3acf7a3d3be0bbc Mon Sep 17 00:00:00 2001
|
||||
From c9dd87198ce5262e6ddf6bf3b0c18eb84784d35e Mon Sep 17 00:00:00 2001
|
||||
From: Oskari Alaranta <oskari.alaranta@bananymous.com>
|
||||
Date: Wed, 15 Apr 2026 16:51:16 +0300
|
||||
Date: Wed, 15 Apr 2026 17:52:54 +0300
|
||||
Subject: [PATCH] linux-window-server-sdl2
|
||||
|
||||
---
|
||||
@@ -13,8 +13,8 @@ Subject: [PATCH] linux-window-server-sdl2
|
||||
userspace/programs/WindowServer/Window.cpp | 29 +-
|
||||
.../programs/WindowServer/WindowServer.cpp | 47 ++-
|
||||
.../programs/WindowServer/WindowServer.h | 1 +
|
||||
userspace/programs/WindowServer/main.cpp | 362 ++++++++++++------
|
||||
10 files changed, 338 insertions(+), 173 deletions(-)
|
||||
userspace/programs/WindowServer/main.cpp | 357 ++++++++++++------
|
||||
10 files changed, 340 insertions(+), 166 deletions(-)
|
||||
|
||||
diff --git a/userspace/libraries/LibGUI/Widget/Widget.cpp b/userspace/libraries/LibGUI/Widget/Widget.cpp
|
||||
index d6489d87..c532fb04 100644
|
||||
@@ -376,7 +376,7 @@ index 94fbc774..bcd7a6b9 100644
|
||||
private:
|
||||
void on_mouse_move_impl(int32_t new_x, int32_t new_y);
|
||||
diff --git a/userspace/programs/WindowServer/main.cpp b/userspace/programs/WindowServer/main.cpp
|
||||
index 41bd7e8c..cb066bd3 100644
|
||||
index 46f2ba6d..520c8e7d 100644
|
||||
--- a/userspace/programs/WindowServer/main.cpp
|
||||
+++ b/userspace/programs/WindowServer/main.cpp
|
||||
@@ -10,7 +10,6 @@
|
||||
@@ -425,7 +425,7 @@ index 41bd7e8c..cb066bd3 100644
|
||||
signal(sig, exit);
|
||||
for (int sig : non_terminating_signals)
|
||||
signal(sig, SIG_DFL);
|
||||
@@ -208,55 +202,10 @@ int main()
|
||||
@@ -208,51 +202,15 @@ int main()
|
||||
signal(sig, SIG_IGN);
|
||||
|
||||
MUST(LibInput::KeyboardLayout::initialize());
|
||||
@@ -469,20 +469,18 @@ index 41bd7e8c..cb066bd3 100644
|
||||
dprintln("Window server started");
|
||||
|
||||
- if (access("/usr/bin/xbanan", X_OK) == 0)
|
||||
- {
|
||||
- if (fork() == 0)
|
||||
- {
|
||||
+ if (access("./build/xbanan/xbanan", X_OK) == 0)
|
||||
{
|
||||
if (fork() == 0)
|
||||
{
|
||||
- dup2(STDDBG_FILENO, STDOUT_FILENO);
|
||||
- dup2(STDDBG_FILENO, STDERR_FILENO);
|
||||
- execl("/usr/bin/xbanan", "xbanan", NULL);
|
||||
- exit(1);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
auto config = parse_config();
|
||||
|
||||
WindowServer window_server(framebuffer, config.corner_radius);
|
||||
@@ -276,26 +225,23 @@ int main()
|
||||
+ execl("./build/xbanan/xbanan", "xbanan", NULL);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
@@ -276,26 +234,23 @@ int main()
|
||||
uint64_t last_sync_us = get_current_us() - sync_interval_us;
|
||||
while (!window_server.is_stopped())
|
||||
{
|
||||
@@ -520,7 +518,7 @@ index 41bd7e8c..cb066bd3 100644
|
||||
if (epoll_events == -1 && errno != EINTR)
|
||||
{
|
||||
dwarnln("epoll_pwait2: {}", strerror(errno));
|
||||
@@ -333,48 +279,6 @@ int main()
|
||||
@@ -333,48 +288,6 @@ int main()
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -569,7 +567,7 @@ index 41bd7e8c..cb066bd3 100644
|
||||
const int client_fd = events[i].data.fd;
|
||||
if (events[i].events & (EPOLLHUP | EPOLLERR))
|
||||
{
|
||||
@@ -500,3 +404,237 @@ int main()
|
||||
@@ -500,3 +413,237 @@ int main()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
24
LICENSE
Normal file
24
LICENSE
Normal file
@@ -0,0 +1,24 @@
|
||||
BSD 2-Clause License
|
||||
|
||||
Copyright (c) 2026, Oskari Alaranta
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
29
README.md
Normal file
29
README.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# xbanan
|
||||
|
||||
An X11 compatibility layer for [banan-os's](https://git.bananymous.com/Bananymous/banan-os) native GUI windowing system.
|
||||
|
||||
## Running on linux
|
||||
|
||||
### Building
|
||||
```sh
|
||||
git clone --recursive https://git.bananymous.com/Bananymous/xbanan.git
|
||||
cd xbanan
|
||||
|
||||
cd banan-os
|
||||
git apply ../0001-linux-window-server-sdl2.patch
|
||||
cd ..
|
||||
|
||||
cmake -B build -S . -G Ninja
|
||||
cmake --build build
|
||||
```
|
||||
|
||||
### Running
|
||||
|
||||
To start the WindowServer, run the following command in project root
|
||||
```sh
|
||||
./build/banan-os/userspace/programs/WindowServer/WindowServer
|
||||
```
|
||||
To run X11 apps specify `DISPLAY=:69` environment variable. For example
|
||||
```sh
|
||||
DISPLAY=:69 xeyes
|
||||
```
|
||||
Reference in New Issue
Block a user