changelog shortlog graph tags branches changeset files revisions annotate raw help

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

changeset 216: 97ad564cd68d
child: da8521b4883e
author: Richard Westhaver <ellis@rwest.io>
date: Tue, 27 Feb 2024 21:46:10 -0500
permissions: -rw-r--r--
description: gui stuff, music
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  (:nicknames :wl)
29  (:export))
30 
31 (defpackage :gui/wm/x11
32  (:nicknames :x11)
33  (:use :xlib)
34  (:export))
35 
36 (defconstant *default-wm* :x11)
37 
38 (defun wm-package (&optional wm)
39  "Return the WM package, either ':x11' for X11 or ':wl' for
40 Wayland. When no WM is provided, we interrogate the host to find out
41 which WM is currently running, and as a last resort falls back to
42 *DEFAULT-WM*."
43  (case wm
44  ((or :x11 :wl) (find-package wm))
45  ((nil) (find-package *default-wm*))
46  (t (error "invalid wm type"))))