changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/gui/wm/pkg.lisp

changeset 221: da8521b4883e
parent: 97ad564cd68d
child: 00d1c8afcdbb
author: Richard Westhaver <ellis@rwest.io>
date: Sat, 02 Mar 2024 23:27:14 -0500
permissions: -rw-r--r--
description: sbcl-sys, lib/box (lxc) and save-lisp-and-live
1 ;;; lib/gui/wm.lisp --- Window Management Systems
2 
3 ;;; Commentary:
4 
5 ;; The two Window Systems worth mentiong are X11 and Wayland. We are
6 ;; interested in both, for different reasons.
7 
8 ;; X11 is for general-purpose, personal computing. It's the standard
9 ;; everyone relies on and whenever we're running GUIs we're assuming
10 ;; it's under X.
11 
12 ;; Wayland is for domain-specific user applications. It's a modular
13 ;; protocol which follows a different design and philosophy than
14 ;; X11. It is not feature complete, but it has a high level of
15 ;; community support. In the right conditions, Wayland apps can be
16 ;; smaller and faster than the equivalent X11-based implementation
17 ;; [uncited]. e.g. kiosks.
18 
19 ;; No matter what, we have no intention of running X11 and Wayland in
20 ;; parallel/embedded using things like XWayland. RTFM - it should be
21 ;; clear which window management system an app is built for. If not,
22 ;; it's a bug (squash it!).
23 
24 ;;; Code:
25 (in-package :gui/wm)
26 
27 (defpackage :gui/wm/wl
28  (:use :cl :std :gui/core :wayflan)
29  (:nicknames :wl)
30  (:export))
31 
32 (defpackage :gui/wm/x11
33  (:nicknames :x11)
34  (:use :cl :std :gui/core :xlib)
35  (:export))
36 
37 (defconstant *default-wm* :x11)
38 
39 (defun wm-package (&optional wm)
40  "Return the WM package, either ':x11' for X11 or ':wl' for
41 Wayland. When no WM is provided, we interrogate the host to find out
42 which WM is currently running, and as a last resort falls back to
43 *DEFAULT-WM*."
44  (case wm
45  ((or :x11 :wl) (find-package wm))
46  ((nil) (find-package *default-wm*))
47  (t (error "invalid wm type"))))