A Wayland window-stacking compositor https://labwc.github.io
Find a file
John Lindgren a837fefc80 Adjust views to account for output layout changes
labwc currently doesn't handle output layout changes very well:

 - Windows can end up "lost" completely offscreen
 - Maximized/fullscreen windows can end up spanning multiple outputs

Currently, new_output_notify() and output_destroy_notify() contain logic
to update the cursor and force a repaint when outputs are added or
removed.  This logic in fact needs to run on any output layout change,
so consolidate it into a new function, output_update_for_layout_change().

Then add a second new function, view_adjust_for_layout_change(), which
adjusts window placement to account for the new layout.

The behavior is roughly as follows:

 - Normal windows that end up offscreen are centered on the closest
   output (making use of the existing view_center() logic)
 - Maximized windows are re-maximized on the closest output.  Logic is
   also added to the unmaximize step to check that the original
   unmaximized position is still on-screen.
 - Fullscreen windows are re-fullscreened on the same output if
   possible; otherwise they are un-fullscreened.

Minimized windows don't require any special handling.  Their placement
is adjusted just the same, but invisible to the user until they are
later unminimized.

There is some positioning glitch still with un-fullscreening a window
whose output has been disconnected/disabled; it can end up in an
unexpected position (but at least has the correct size and decoration).
I don't think this is due to a bug in my change per se, but perhaps the
change has exposed a bug elsewhere.

Fixes: #177
2022-01-01 16:20:13 +00:00
.github/workflows ci: add actions/checkout@v2 to main.yml 2021-09-22 20:14:11 +01:00
docs labwc-environment(5): add XCURSOR_{THEME,SIZE} 2021-12-29 14:25:13 +00:00
include Adjust views to account for output layout changes 2022-01-01 16:20:13 +00:00
protocols add pointer constraints 2021-10-17 22:32:25 +01:00
src Adjust views to account for output layout changes 2022-01-01 16:20:13 +00:00
subprojects build: use wlroots 0.15.0 2021-12-26 22:42:51 +00:00
.editorconfig Add .editorconfig 2021-09-24 20:57:11 +01:00
.gitignore desktop: rename desktop_cycle_view() 2020-10-31 14:46:33 +00:00
CONTRIBUTING.md CONTRIBUTING.md: wrap commit messages at 74 characters 2021-12-26 23:14:21 +00:00
LICENSE Initial commit 2019-05-11 21:21:58 +01:00
meson.build build: bump version to 0.4.0 2021-12-31 21:05:49 +00:00
meson_options.txt Add man-pages option like swaywm/sway@ba16f16e4d 2021-03-04 06:35:15 +00:00
NEWS.md Update NEWS.md 2021-12-29 14:32:18 +00:00
README.md Proofread README.md 2021-12-24 20:08:14 +00:00

labwc

1. What is this?

labwc stands for Lab Wayland Compositor, where lab can mean any of the following:

  • sense of experimentation and treading new ground
  • inspired by BunsenLabs and ArchLabs
  • your favorite pet

It is a wlroots-based stacking compositor aiming to be lightweight and independent, with a focus on simply stacking windows well and rendering some window decorations. It relies on clients for wallpaper, panels, screenshots, and so on to create a full desktop environment.

Labwc tries to stay in keeping with wlroots and sway in terms of general approach and coding style.

In order to avoid reinventing configuration and theme syntax, the openbox-3.4 specification is used. This does not mean that labwc is an openbox clone but rather that configuration files will look and feel familiar.

video link date content
Video (0:18) 16-Oct-2021 SnapToEdge feature
Video (1:10) 05-Aug-2021 window gymnastics, theming and waybar
Video (3:42) 25-Feb-2021 setting background and themes; xwayland/xdg-shell windows

So far, labwc supports the following:

  • Config files (rc.xml, autostart, environment)
  • Theme files and xbm icons
  • Damage tracking to reduce CPU usage
  • A basic root-menu (configured with menu.xml)
  • HiDPI
  • wlr-output-management protocol
  • layer-shell protocol
  • foreign-toplevel protocol (e.g. to integrate with panels and bars)
  • Optionally xwayland

2. Build

meson build/
ninja -C build/

Dependencies include:

  • meson, ninja, gcc/clang
  • wlroots (master)
  • wayland (>=1.19)
  • wayland-protocols
  • libinput (>=1.14)
  • libxml2
  • cairo, pango, glib-2.0
  • xkbcommon
  • xwayland, xcb (optional)

Disable xwayland with meson -Dxwayland=disabled build/

For further details see wiki/Build.

3. Install

See wiki/Install.

4. Configure

Labwc uses the files listed below for configuration and theming.

file user over-ride location man page
rc.xml ~/.config/labwc/ labwc-config(5), labwc-actions(5)
menu.xml ~/.config/labwc/ labwc-menu(5)
autostart ~/.config/labwc/ labwc(1)
environment ~/.config/labwc/ labwc-environment(5)
themerc ~/.local/share/themes/<theme-name>/openbox-3/ labwc-theme(5)

The example rc.xml has been kept simple. For all options and default values, see rc.xml.all

Configuration and theme files are reloaded on receiving SIGHUP (e.g. killall -SIGHUP labwc)

For keyboard settings, see environment and xkeyboard-config(7)

For themes, search the internet for "openbox themes" and place them in ~/.local/share/themes/. Some good starting points include:

5. Run

./build/labwc [-s <command>]

Click on the background to launch a menu.

If you have not created an rc.xml config file, default bindings will be:

combination action
alt-tab activate next window
alt-escape exit
super-return alacritty
alt-F3 bemenu
alt-F4 close window
super-a toggle maximize
alt-mouse-left move window
alt-mouse-right resize window
alt-arrow move window to edge
super-arrow resize window to fill half the output
XF86_AudioLowerVolume amixer sset Master 5%-
XF86_AudioRaiseVolume amixer sset Master 5%+
XF86_AudioMute amixer sset Master toggle
XF86_MonBrightnessUp brightnessctl set +10%
XF86_MonBrightnessDown brightnessctl set 10%-

6. Integrate

Suggested apps to use with labwc:

7. Roadmap

A lot of emphasis is put on code simplicity when considering features.

The main development effort is focused on producing a solid foundation for a stacking compositor rather than adding configuration and theming options.

See acceptance criteria for details.

High-level summary of items which are not intended to be implemented:

  • Icons (except window buttons)
  • Animations
  • Gradients for decoration and menus
  • Any theme option not required to reasonably render common themes (it's amazing how few options are actually required).