# Evaluation binaries for new XPCE+SDL based GUI

**URL:** <https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104>\
**Category:** Announce\
**Created:** [July 17, 2025, 1:58pm UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104 "2025-07-17T13:58:58Z")\
**Posts on this page:** 16\
**Page:** 2

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [July 22, 2025, 10:21am UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/21 "2025-07-22T10:21:33Z")

</div>

I updated the evaluation binaries at [Index of /download/SDL](https://www.swi-prolog.org/download/SDL/)

Updated:

- Many updates to the dark theme. Dark theme is selected by default if DL claims this to be the system theme. There should be a nice way to overrule. As is, you can overule on the commandline using `-Dtheme=<theme>`. If the theme does not exist it uses the default (light) theme.
- Console: added triple-click for line selection and select all (Ctrl-Shift-A or Cmd-A (Apple)
- Change the XPCE “GIL” to be more like the Python one: rather than being a full (recursive) lock, the XPCE lock is now released if XPCE does a callback to Prolog. This implies that multiple Prolog threads can make progress communicating to the graphics. Notably, this allows running multiple instances of the debugger from different consoles and it allows GUI debugging XPCE itself. It should generally avoid many deadlocks.

Please test and provide feedback. Next planned steps:

- Release 9.3.26 based on this
  - Planned **binary** releases
    - MacOS Bundle (as in the preview download)
    - Windows .exe installer (in the preview download)
    - Flatpak through flathub
    - **discontinue** the snap package. Flatpak is simpler to manage, is more widely supported (AFAIK) and serves the same purpose.
    - PPA for Ubuntu 25.04 only as older versions to not support SDL3. PPAs for older versions without GUI (if feasible).
    - Update Macports to build this version

  - **Source** release
    - Tar-ball will contain the new xpce. Everything need to support the old will still be in the Prolog part and packages.
    - You can stull build the old version by using the GIT source and checkout xpce on a branch `X11`.

Further plans (probably next version)

- Remove starting an xterm console from the core. Xterm is old and the xpce based consoles do much better multi-console interaction.
- Simpifly `threadutil.pl` utilities for multiple consoles.
- Remove sources for building native `swipl-win.exe` from core
- Remove Qt `swipl-win` package
- Remove GNU readline package

As a consequence the GUI version support on notably Linux/\*BSD and similar systems will be a bit handicapped for several years. Users of such systems can choose between the flatpak, building SDL and SDL\_image from source and next the whole system from source or take the GIT source and use the `X11` branch of xpce. The latter route probably deteriorates quickly.

Please comment if you see any problems in this.

**edit** It seems something went wrong with the Windows version. Hold on.

---

<div class="post-metadata">

**Author:** ![swi](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@swi](https://swi-prolog.discourse.group/u/swi)\
**Post date:** [July 22, 2025, 11:14am UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/22 "2025-07-22T11:14:50Z")

</div>

I am running on archlinux, with sdl3 and sdl-image installed (arch has packages for them). But the build doesn’t seem to use them (swipl-win just runs in the terminal).

sdl3 provides among others:

```prolog
$ yay -Ql sdl3
...
sdl3 /usr/include/SDL3/SDL.h
...
sdl3 /usr/lib/libSDL3.so
sdl3 /usr/lib/libSDL3.so.0
sdl3 /usr/lib/libSDL3.so.0.2.16
sdl3 /usr/lib/libSDL3_test.a
sdl3 /usr/lib/pkgconfig/
sdl3 /usr/lib/pkgconfig/sdl3.pc

```

and sdl3\_image:

```prolog
$ yay -Ql sdl3_image
...
sdl3_image /usr/include/SDL3_image/SDL_image.h
...
sdl3_image /usr/lib/libSDL3_image.so
sdl3_image /usr/lib/libSDL3_image.so.0
sdl3_image /usr/lib/libSDL3_image.so.0.2.4
sdl3_image /usr/lib/pkgconfig/
sdl3_image /usr/lib/pkgconfig/sdl3-image.pc

```

I am building with:

```prolog
cmake .. -G Ninja -DEPILOG=ON && ninja      

```

---

<div class="post-metadata">

**Author:** ![swi](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@swi](https://swi-prolog.discourse.group/u/swi)\
**Post date:** [July 22, 2025, 11:15am UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/23 "2025-07-22T11:15:00Z")

</div>

I couldn’t edit the previous post, but in cmake I get:

```prolog
CMake Warning:
  Manually-specified variables were not used by the project:

    EPILOG

```

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [July 22, 2025, 11:17am UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/24 "2025-07-22T11:17:39Z")

</div>

> [@swi](#):
>
> But the build doesn’t seem to use them (swipl-win just runs in the terminal).

Could it be that you did not switch packages/xpce to the branch `sdl`? Or checkout `swipl-devel.git` to the branch `sdl`. This branch is the same as `master`, except for the submodule commit for xpce.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [July 22, 2025, 11:23am UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/25 "2025-07-22T11:23:12Z")

</div>

> [@jan](#):
>
> **edit** It seems something went wrong with the Windows version. Hold on.

Fixed. Pushed new versions for all platforms as it was mostly luck that only Windows was affected. Also added a resource `display.theme` to xpce to overrule SDLs theme detection. So, to select a theme regardless of what SDL claims, do

- Open Setting/GUI preferences

- Add **one of the two lines** below. The first is to force the dark theme and the second to force the (default) light theme.

You can also create a new theme file and set this to the basename of this file.

---

<div class="post-metadata">

**Author:** ![Boris](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/boris/32/7486_2.png) [@Boris](https://swi-prolog.discourse.group/u/Boris)\
**Post date:** [July 22, 2025, 1:46pm UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/26 "2025-07-22T13:46:30Z")

</div>

Hi, this compiled from source without any problems on an up-to-date Apple M3 with MacOS 15.5.

I am using Homebrew, for the dependencies:

```prolog
$ brew install sdl3 sdl3_image cairo pango libedit pkgconf

```

**Note the extra dependency `pkgconf`!**

And then:

```prolog
$ git fetch
$ git checkout sdl
$ git submodule update --init

```

… and then added the option `-DEPILOG=ON` to the arguments of cmake.

I can start the GUI terminal using

```prolog
$ swipl -g epilog
Warning: [Thread main] theme `light' does not exist
?-

```

Not sure about the warning…

One comment, without any configuring on my end, the fonts are quite big. I was able to make fonts similar to the rest of my desktop using

```prolog
font.scale: 0.8

```

in the GUI settings file.

All in all, looks really great and “just works”! Thank you!

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [July 22, 2025, 1:57pm UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/27 "2025-07-22T13:57:25Z")

</div>

> [@Boris](#):
>
> `$ brew install sdl3 sdl3_image cairo pango libedit pkgconf`

Thanks. Updated the wiki. pkgconf is probably also required on Macports, but was probably already installed.

> [@Boris](#):
>
> ```prolog
> Warning: [Thread main] theme `light' does not exist
> ?-
> 
> ```
> 
> Not sure about the warning…

That is benign. I think I should add an empty `light` theme file.

Note that you can also start `swipl-win`. Then you do not get the main thread toplevel, only SWI-Prolog’s console.

> [@Boris](#):
>
> `font.scale: 0.8`

SDL refuses to tell the DPI or physical screen size, claiming there is no portable reliable way to get this. I have to set the scale to 1.2 to get what I want. At least, the default should be readable as SDL works with logical pixels that are two physical pixels on hi-res displays.

> [@Boris](#):
>
> All in all, looks really great and “just works”! Thank you!

Thanks. At least on Linux and the Mac it seems a real step forwards. It is a bit sluggish on my Windows VM, but that was also the case for the old version. I hope it works nice on bare metal Windows …

---

<div class="post-metadata">

**Author:** ![swi](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@swi](https://swi-prolog.discourse.group/u/swi)\
**Post date:** [July 23, 2025, 7:28am UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/28 "2025-07-23T07:28:26Z")

</div>

for some strange reason I had to do a

```prolog
git clone --depth=1 --branch=sdl https://github.com/SWI-Prolog/swipl-devel sdl

```

followed by

```prolog
git submodule update --init                

```

in a completetely clean directory. It works now.

---

<div class="post-metadata">

**Author:** ![Boris](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/boris/32/7486_2.png) [@Boris](https://swi-prolog.discourse.group/u/Boris)\
**Post date:** [July 23, 2025, 9:47am UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/29 "2025-07-23T09:47:17Z")

</div>

> [@jan](#):
>
> Note that you can also start `swipl-win`. Then you do not get the main thread toplevel, only SWI-Prolog’s console.

Yes, thank you.

It seems `swipl-win` is not correctly installed. This is my complete build script:

```prolog
( cd build \
        && cmake -Wno-dev \
                -DCMAKE_INSTALL_PREFIX="$HOME" \
                -DUSE_GMP=OFF \
                -DSWIPL_PACKAGES_JAVA=OFF \
                -DEPILOG=ON \
            -G Ninja .. \
        && ninja \
        && ctest -j 16 \
        && ninja install )

```

Now I have swipl-win in my bin but it points to a missing file:

```prolog
$ ls -l bin/swipl-win
lrwxr-xr-x 1 booris staff 39 Jul 23 12:10 bin/swipl-win -> ../lib/swipl/bin/arm64-darwin/swipl-win
$ ls lib/swipl/bin/arm64-darwin/swipl-win
ls: cannot access 'lib/swipl/bin/arm64-darwin/swipl-win': No such file or directory
$ ls lib/swipl/bin/arm64-darwin
swipl swipl-ld

```

I can of course find it in `/build/src/swipl-win`.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [July 23, 2025, 11:32am UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/30 "2025-07-23T11:32:00Z")

</div>

> [@Boris](#):
>
> ```prolog
> $ ls lib/swipl/bin/arm64-darwin/swipl-win
> ls: cannot access 'lib/swipl/bin/arm64-darwin/swipl-win': No such file or directory
> 
> ```

Thanks. I think I found it. There will be an update shortly when I completed making sense of the many config/install/… commits ☹

---

<div class="post-metadata">

**Author:** ![kwon-young](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/kwon-young/32/4841_2.png) [@kwon-young](https://swi-prolog.discourse.group/u/kwon-young)\
**Post date:** [July 24, 2025, 9:37am UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/31 "2025-07-24T09:37:07Z")

</div>

> [@jan](#):
>
> I pushed several patches to make the profiler behave at least mostly fine under the dark theme.

I have just tested the profiler and it is more legible now.  
I noticed that the theme remains white if I launch xpce from a cmd top level ?

Unfortunately, I got one freeze with the debugger but can’t manage to reproduce the issue.  
I also find the touchpad scrolling incredibly sensitive, but I suppose it is the same issue with lack of dpi information ?

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [July 24, 2025, 9:56am UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/32 "2025-07-24T09:56:52Z")

</div>

> [@kwon-young](#):
>
> I noticed that the theme remains white if I launch xpce from a cmd top level ?

Yes. That is probably wrong. It goes dark if you first launch a console, e.g.

```
swipl
?- epilog.

```

If XPCE’s theme is set to dark we should probably load this always …

> [@kwon-young](#):
>
> Unfortunately, I got one freeze with the debugger but can’t manage to reproduce the issue.

If you manage to get something reproducible, please report …

> [@kwon-young](#):
>
> I also find the touchpad scrolling incredibly sensitive, but I suppose it is the same issue with lack of dpi information ?

I don’t think so. There are several translation steps between the SDL event and what happens in xpce. I don’t know how to interpret these. The simplest first step is probably to make one of them a class variable, so users can adjust.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [July 24, 2025, 12:42pm UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/33 "2025-07-24T12:42:23Z")

</div>

> [@jan](#):
>
> > [@kwon-young](#):
> >
> > I also find the touchpad scrolling incredibly sensitive, but I suppose it is the same issue with lack of dpi information ?
> 
> I don’t think so.

Ok. SDL gives mouse wheel events from the touchpad. We merely use the direction, ignoring the amount and translate that into a rotation event. The scrollbar then translates this by default in a 20% page up/down. If shift is depressed it is translated into 1 line up/down and if control is depressed in 1 page up/down.

This works pretty much ok on my M1 Macbook (touchpad) and desktop (mouse).

I pushed a patch that allows for

```
?- debugpce(wheel).

```

That prints the parameters we get from SDL. From my mouse I get dy=+/-1 on every “click”.

---

<div class="post-metadata">

**Author:** ![Boris](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/boris/32/7486_2.png) [@Boris](https://swi-prolog.discourse.group/u/Boris)\
**Post date:** [July 24, 2025, 5:25pm UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/34 "2025-07-24T17:25:01Z")

</div>

While on the topic, the scroll direction is opposite to the rest of the window environment on MacOS. I have set the “natural” scroll direction for both scrollpad and mouse in the OS configuration.

Is there an option to either reverse the direction or respect the OS choice?

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [July 24, 2025, 5:28pm UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/35 "2025-07-24T17:28:36Z")

</div>

> [@Boris](#):
>
> Is there an option to either reverse the direction or respect the OS choice?

Good question. The code says this, which I assumed would deal with this. Apparently not ☹

```prolog
      if ( event->wheel.direction == SDL_MOUSEWHEEL_FLIPPED )
      { dx = -dx;
        dy = -dy;
      }

```

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [July 24, 2025, 5:54pm UTC](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104/36 "2025-07-24T17:54:34Z")

</div>

> [@jan](#):
>
> Good question. The code says this, which I assumed would deal with this. Apparently not ☹

It appears that it says the direction is flipped, but also changes the reported direction. Pushed a fix that makes this work as expected, at least on MacOS.

Please keep reporting such issues. It greatly improves usability to get these things right.

[Previous page](https://swi-prolog.discourse.group/t/evaluation-binaries-for-new-xpce-sdl-based-gui/9104.md?page=1)
