Commit graph

336 commits

Author SHA1 Message Date
Tomi Ollila
96d5d80be2 docs: refer labwc-actions(5), not labwc-action(5) 2024-04-29 22:59:42 +02:00
Tomi Ollila
2e2cf54c00 docs: Fixed some typos, 80 column lines (where possible) 2024-04-26 22:15:39 +01:00
David Turner
ce0d2c2966
ssd: add window drop-shadows (#1648)
Add optional drop-shadows to windows using server-side decoration.
Shadows can be enabled/disabled rc.xml and their appearance configured
in themerc.  The default is no shadows to preserve current behaviour.

The shadows are drawn in fixed corner and edge buffers shared between
all windows, the edges are scaled to size depending on the size of each
window.  Two sets of buffers are used to give the different appearances
for active and inactive windows.  I use separate corner/edge buffers for
a few reasons:

- It avoids needing to store a separate large shadow buffer per window
- It avoids needing to redraw the shadows when the window is being
  resized
- Compositing the shadows onto the desktop should be faster as there are
  overall fewer pixels to blend, and scaling up the edge buffers only
  requires reading a tiny buffer which is then replicated.
2024-04-22 19:27:53 +01:00
tokyo4j
b0ba585ff8 overlay: allow to draw both/either of filled/outlined rectangle
Filled/outlined rectangles shown as snapping overlay are now enabled/disabled
independently with `snapping.overlay.[region|edge].bg.enabled` and
`snapping.overlay.[region|edge].border.enabled`.

To keep the default behavior, `*.bg.enabled` is yes and `*.border.enabled` is
no for hardware-based renderers, while `*.bg.enabled` is no and
`*.border.enabled` is yes for software-based (pixman) renderer.

Users can now use a filled rectangle as an overlay even with pixman renderer.
However, this may severely impact performance when used with translucent
`snapping.overlay.[region|edge].bg.color`.

This commit includes a refactor to use substruct `theme_snapping_overlay`
inside `theme` in order to pass it to `create_overlay_rect()` in a cleaner way.

Breaking changes is:
- `snapping.overlay.[region|edge].fill` is now removed.
2024-04-22 19:22:23 +01:00
tokyo4j
34290ef629 overlay: s/preview/overlay/
Replace "preview" in rc.xml and themerc with "overlay" since "preview" sounds
like it shows the window content.

Breaking changes are:
- `snapping.preview.*` in themerc is now replaced with `snapping.overlay`.
- `<snapping><preview>` in rc.xml is now replaced with `<snapping><overlay>`.
2024-04-22 19:22:23 +01:00
Consolatis
d67345564e window-rules: add ignoreConfigureRequest
This allows to ignore X11 client side configure requests
like positioning and resizing and can be used to fight
some X11 applications that persist to have their windows
spawn at specific places and sizes.

Fixes: #1446
2024-04-21 20:31:55 +01:00
Tobias Bengfort
858e1c65cf window-rules: implement type filter
Co-Authored-By: Grigory Kirillov <txgk@bk.ru>
2024-04-20 15:29:41 +02:00
Andrew J. Hesford
b4f3ffc27e session: sort directory entries in environment.d 2024-04-16 13:21:55 +02:00
tokyo4j
8096df19ba osd: add theme settings for window-switcher preview
Adds theme settings like:
osd.window-switcher.preview.border.width: 2
osd.window-switcher.preview.border.color: #ffffff,#00a2ff,#ffffff
2024-04-16 09:58:34 +02:00
tokyo4j
3b13f4cdcd overlay: add theme settings for colors and border width
adds theme settings like:
snapping.overlay.[region|edge].bg.color: #8080b380
snapping.overlay.[region|edge].border.color: #ffffff,#000000,#ffffff
snapping.overlay.[region|edge].border.width: 1
2024-04-15 12:33:40 +02:00
tokyo4j
50fd65416f overlay: add theme setting snapping.preview.[region|edge].fill
This settings allows user to choose whether to draw a filled rectangle
or an outlined rectangle as the preview for window snapping.
2024-04-15 12:33:40 +02:00
tokyo4j
62091ccc58 doc: enhance documentation on fallback values for OSD style 2024-04-14 14:44:43 +01:00
tokyo4j
3c4c0a6643 themerc: fix default value of osd.bg.color 2024-04-14 14:44:43 +01:00
tokyo4j
dfcaee4c99 doc: enhance documentation on border.color 2024-04-14 14:44:43 +01:00
Consolatis
1f39f17be1 docs: add missing documention for the ForEach none branch 2024-04-14 13:27:18 +02:00
Johan Malm
c841a25acf Add -S|--session <command> option
...to start <command> on startup and to terminate the compositor when
<command> exits.

This is useful for session management as it allows the session client (for
example `lxqt-session`) to terminate labwc - be exiting itself.

Under X, xinit starts the server and keeps it alive for as long as
lxqt-session runs. Thus either the session client starts the Window
Manager, or the Window Manager can be launched independently first.  On
Wayland, the Compositor is both Display Server and Window Manager, so the
described session management mechanisms do not work because the Compositor
needs to be running before the session can function.

As some session clients support both X11 and Wayland, this command line
option avoids re-writes and fragmentation.

Co-authored-by: @Consolatis
2024-04-14 13:05:25 +02:00
droc12345
d672765ea7
osd: add window-switcher custom field (#1670)
Add custom field with subset of printf style formatting
to replace the original field formats.

Example:

    <windowSwitcher preview="no" outlines="no" allWorkspaces="yes">
      <fields>
        <field content="custom" format="foobar %b %3s %-10o %-20W %-10i%t" width="100%" />
      </fields>
    </windowSwitcher>

Mono space font recommended. May need OSD width adjusted

Co-authored-by: @Consolatis (based on work done by them)
2024-04-10 23:39:31 +01:00
Consolatis
2c2341530b src/theme.c: support inline alpha encoding like #aabbccff
.. and mark the current `#rrggbb aaa` encoding as deprecated.
2024-04-08 21:05:05 +01:00
Droc
eb5e855b69 osd: support percent values for window switcher width
Add ability to set width with percentage of monitor instead of just pixels.
With this the OSD sizes itself properly on both my 4k and 2k monitors.

example: 50% or 75% instead of 600, max 100%
2024-04-08 15:44:53 +02:00
Tomi Ollila
6e7f1b430f docs: 80 column lines (where possible), drop trailing whitespace
with one typofix
2024-04-07 21:54:42 +02:00
Hiroaki Yamamoto
5cc0757390
overlay: add snap-to-edge overlay (PR #1652)
...and unify region overlay and snap-to-edge overlay into overlay.c.

Snap-to-edge overlay is delayed for 500ms to prevent flickering when
the view is dragged from an output to another (demo in discussion labwc#1613).

This also fixes a bug that region overlay is not shown when a modifier
key is re-pressed.
2024-04-05 04:35:31 +02:00
Jens Peters
21cad7d1a7 docs: Refer to calibration matrix 2024-03-26 19:28:53 +00:00
Johan Malm
f3b68b8fb5 menu: support pipe menus
See labwc-menu(5) for usage.

Co-authored-by: @Consolatis
2024-03-24 21:44:16 +00:00
Johan Malm
e79bbd3022
labwc-config(5): clarify applicability of element/attribute (#1655)
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
2024-03-24 21:32:27 +00:00
SnowNF
0e7c726be5 docs: fix format in calibrationMatrix section 2024-03-20 22:52:19 +00:00
SnowNF
6c8060ce14 docs: fix scdoc build 2024-03-20 22:52:19 +00:00
SnowNF
e311ff6466 docs: add calibrationMatrix section for libinput 2024-03-20 22:52:19 +00:00
SnowNF
bd4d92bad8 libinput: add support for touchscreen set matrix
My android pad emit a strange touch input from libinput, need to rotate it in 270 degree clockwise to fix.
2024-03-20 22:52:19 +00:00
droc12345
b0c2ac1a6d
osd: add window-switcher field content types (#1623)
...`workspace`, `state`, `type_short` and `output`.

Example usage:

    <windowSwitcher allWorkspaces="yes">
      <fields>
        <field content="workspace" width="5%" />
        <field content="state" width="3%" />
        <field content="type_short" width="3%" />
        <field content="output" width="9%" />
        <field content="identifier" width="30%" />
        <field content="title" width="50%" />
      </fields>
    </windowSwitcher>
2024-03-16 15:28:37 +00:00
Andrew J. Hesford
cdac800692 action: allow client-menu to open at mouse cursor 2024-03-13 10:51:50 -04:00
Andrew J. Hesford
9e0846ea14 docs/labwc-config.5: fix "environment directory" typo 2024-03-12 07:36:06 -04:00
droc12345
4ecac26548
workspaces: add ability to set prefix when using number argument 2024-03-11 23:19:03 +01:00
Andrew J. Hesford
e837445114 session: process environment.d and allow empty variables
1. All '*.env' files in an 'environment.d' directory alongside each
   potential 'environment' file will be parsed and added to the
   environment.

2. For the purposes of configuration merging, an environment definition
   exists at one level if either the 'environment' file is defined or
   its corresponding 'environment.d' contains any valid '*.env' file.

3. Variable declarations of the form "VARIABLE=", with no following
   value, will be written to the environment as empty strings.
2024-03-11 20:01:14 +00:00
Standreas
52cb643189
docs/labwc-config.5.scd: fix typo 2024-03-11 08:17:52 +01:00
Hiroaki Yamamoto
be37f9a564
Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
Consolatis
60aab98e8d Add optional headless fallback output
This allows configuring a headless fallback output that
is automatically created whenever there is no other output
around. It is destroyed when a new output is discovered.

It can be enabled by setting the environment variable
LABWC_FALLBACK_OUTPUT to the desired output name.

The feature benefits applications like wayvnc the most
as there is always an output available to connect to.

Co-Authored-By: Simon Long <simon@raspberrypi.com>
2024-03-08 13:54:13 +01:00
Consolatis
983ca66d07 src/action.c: fix MoveToOutput action by renaming 'name' argument
We were using the argument name 'name' before
which is already used by the action itself:
`<action name="MoveToOutput" name="HDMI-A-1" />`

Change the argument name to "output" which also
matches the `FocusOutput` action.

Fixes: #1589
Reported-by: @bnason (thanks!)
2024-03-06 18:34:56 +00:00
Andrew J. Hesford
bcf2d7e091 docs/labwc.1: fix LABWC_PWD -> LABWC_PID typo 2024-03-05 17:51:10 -05:00
Johan Malm
247d2b581c osd: optionally show windows on all workspaces
Also share common config option (rc.window_switcher.criteria) in osd.c and
desktop.c to make sure the window lists are always consistent.

Configure with `<windowSwitcher allWorkspaces="yes|no">`
2024-03-05 22:16:55 +01:00
Andrew J. Hesford
0af7bc886a docs/labwc.1: restructure, document session management 2024-03-04 01:57:32 +01:00
Andrew J. Hesford
f90b7dca2a session: run shutdown script, clean up activation env before exit 2024-03-02 21:30:03 -05:00
Johan Malm
3c3bcc2765 view: add MoveToOutput wrap attribute
Support `wrap` in view_get_adjacent_output(). This means that when seeking
an adjacent output in a particular direction from an output that is
already furthest in that direction within the layout, rather than
returning NULL, wrap around from the leftmost to the rightmost, or topmost
to the bottommost and vice versa.

Example usage:

    <action name="MoveToOutput" direction="right" wrap="yes" />

Wrap is disabled by default to keep the user interface consistent.
2024-03-02 21:23:01 +00:00
Birger Schacht
1ea7e8b494 fix: typo in labwc-config.5.scd
specifc -> specific
2024-03-02 08:44:09 +01:00
Consolatis
43e29f1f8d docs/rc.xml: remove gap from the example config
Some distro packages install the example config at /etc/xdg/labwc/rc.xml
and thus users of those packages were having a gap 10 setting by default.

Lets remove the gap from the example config to match our intended default.
2024-02-28 20:51:17 +00:00
Jens Peters
7110b7cf3e docs: add sendEventsMode to libinput snippet 2024-02-25 20:35:03 +01:00
Sachin Bhat
6fb06c54c2 config: support libinput sendEventsMode
This allows to enable / disable libinput devices.

Co-Authored-By: @Consolatis
2024-02-24 21:36:53 +01:00
Marvin Dostal
8be9c38460
Add click method libinput option (#1416)
<libinput>
  <device>
    <clickMethod>none|buttonAreas|clickfinger</clickMethod>
  </device>
</libinput>
2024-02-21 17:19:48 +00:00
Rick Calixte
14f5733584 meson.build: install badges for labwc and migrate to data/
A .desktop file was previously added for the labwc session, this adds a
badge for it where it is supported. The .desktop files and the badges
are also moved to `data/`.

Ref: #36, 9fa783e, labwc/labwc-artwork#7
2024-02-03 22:05:28 +00:00
Andrew J. Hesford
3162bbb3c2 xdg: add snapping.notifyClient option to control tiling events 2024-01-30 07:30:07 -05:00
Johan Malm
21d816edb2 environment: add Thunderbird to MOZ_ENABLE_WAYLAND description 2024-01-24 23:41:40 +01:00