Commit graph

455 commits

Author SHA1 Message Date
tokyo4j
44146487b2 osd: update the default window switcher layout
The default window switcher layout is updated from:

  <windowSwitcher>
    <fields>
      <field content="type" width="25%" />
      <field content="trimmed_identifier" width="25%" />
      <field content="title" width="50%" />
    </fields>
  </windowSwitcher>

to:

  <windowSwitcher>
    <fields>
      <field content="icon" width="5%" />
      <field content="desktop_entry_name" width="30%" />
      <field content="title" width="65%" />
    </fields>
  </windowSwitcher>

Only desktop entry name and title are shown when libsfdo is not linked.
2025-04-02 20:49:38 +01:00
tokyo4j
6a04c5f0dd osd: add osd.window-switcher.item.icon.size
This allows users to make the icon in window switcher bigger (or smaller)
than the font size, which enables more Openbox-like appearance.

Example configuration:
  osd.window-switcher.item.icon.size: 50

This commit also makes the icon smaller than the font size if the width
allocated with <windowSwitcher><fields><field width=""> is smaller than
that.
2025-04-01 21:14:20 +01:00
Tomi Ollila
2404297f2d docs: labwc-actions.5.scd style updates
- some newlines to dedent and separate content
- comma (,) before respectively
- reflowd some lines to fit in 80 columns
2025-03-31 21:26:56 +01:00
Jens Peters
d6edb8b273 action: Add HideCursor action 2025-03-24 21:23:55 +00:00
tokyo4j
4ef881bb3e osd: support app icons in window switcher
Example configuration:

  <windowSwitcher>
    <fields>
      <field content="icon" width="5%" />
      <field content="title" width="95%" />
    </fields>
  </windowSwitcher>
2025-03-17 01:22:24 +09:00
Johan Malm
9ca0b111f4 config: increase default <snapping><range> to 10
...to make it easier to snap windows on the edge between two monitors.

Fixes: #2602
2025-03-08 22:36:53 +09:00
Tomi Ollila
63da13a62b docs: labwc-config.5.scd: dedent windowSwitcher content lists
fits better on 80-column terminal and is more consistent in style
2025-02-11 15:35:06 +01:00
Tomi Ollila
92e4c5a606 docs: trailing space, 1 tab to spaces, labwc-theme.5.scd to fit 80 cols 2025-02-08 17:37:43 +01:00
Andrew J. Hesford
b2623ce1e3 docs/rc.xml.all: correct description of resize.cornerRange 2025-02-04 18:55:31 -05:00
Andrew J. Hesford
6b9cc5dd64 ssd: make sizes of invisible SSD extents configurable 2025-02-04 18:55:31 -05:00
tokyo4j
950337b895 ssd: fix resizing on border corners and add <resize><cornerRange>
Eliminate corner extents and instead use cursor position to map SSD
borders and extents to corner contexts, with a size configurable by the
<resize><cornerRange> parameter. This simplifies extent handling,
eliminates bugs in the detection of corner context, and allows users to
expand corner targets if they wish.

Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
2025-02-04 11:13:32 -05:00
Consolatis
ed4553fc7e src/menu: add global config for menu.showIcons 2025-02-02 15:05:37 +00:00
Consolatis
1fa4070025 src/menu: add support for scalable menu icons 2025-02-02 15:05:37 +00:00
Consolatis
060b59f7ed src/config: let icon theme name default to theme 2025-02-02 15:05:37 +00:00
Consolatis
1e2c709d6b docs/labwc-menu: we only support a single menu.xml file 2025-02-02 15:05:37 +00:00
tokyo4j
26064fb8f6 Add <theme><fallbackAppIcon>
This commit adds <theme><fallbackAppIcon> that configures the icon name
to be used when lookups for an application icon is failed. Its default
value is set as 'labwc' which shows our labwc logo.
2025-01-26 11:46:32 +01:00
Dima Krasner
36d6e9ef75 docs: fix incorrect default for window.label.text.justify 2025-01-24 12:57:06 +01:00
tinyboxvk
1a6dd845a2 Fix typos
Signed-off-by: tinyboxvk <13696594+tinyboxvk@users.noreply.github.com>
2025-01-09 06:59:57 +00:00
Johan Malm
8d9bd2d747 theme: use 'labwc' directory
as well as 'openbox-3', for example: /usr/share/themes/foo/labwc/themerc

Give 'labwc' higher precedence than 'openbox-3' if both exist.

For several reasons not all themes designed for labwc render well on
Openbox:

1. Labwc support some features like SVG/PNG icons and #rrggbbaa color
   definitions which Openbox does not.

2. Openbox generally defaults to black/white colors and will not render
   themes accurate without certain options specified in themerc. For
   example, in Openbox the following will just render as black:

       window.active.title.bg.color: #589bda

   ...because Openbox defaults the texture to "Gradient Vertical" and
   therefore either needs:

      window.active.title.bg.colorTo: #3c7cb7

   ...or remove 'Gradient' from the bg definition and just use something
   like:

      window.active.title.bg: Flat Border

Whilst none of this is a problem when using labwc, it causes problems for
setups with both Openbox and labwc because themes designed for labwc only
will now show up in obconf, lxappearance, etc causing confusion for users.
2025-01-06 20:15:26 +00:00
Johan Malm
956b271f9b menu: support pipemenu with the toplevel <menu> element
For example:

    <?xml version="1.0"?>
    <openbox_menu>
      <menu id="root-menu" label="" execute="obmenu-generator"/>
    </openbox_menu>

Fixes: #2238

Co-Authored-By: @Consolatis
2025-01-03 04:41:25 +01:00
tokyo4j
a93eb84335 Add default Alt-Shift-Tab keybind for PreviousWindow 2025-01-03 10:51:26 +09:00
tokyo4j
713b1d8a13 osd: make window switcher more Openbox-like in terms of key precessing
Before this commit, keystrokes were interpreted based on following
hard-coded rules while the window switcher is active:

  1. Up/Left arrow keys cycle the window forward.
  2. Down/Right arrow keys cycle the window backward.
  3. Other keystrokes cycle the window in the initial direction specified
     by NextWindow/PreviousWindow actions. But while Shift key is pressed,
     the direction is inverted.

...and keybind actions were never executed.

However, this lead to a counter-intuitive behavior for new, especially
pre-Openbox users. For example, in the following keybinds, after the user
activates the window switcher with Super+n, Super+p cycles the window
_forward_:

  <keybind key="W-n">
    <action name="NextWindow" />
  </keybind>
  <keybind key="W-p">
    <action name="PreviousWindow" />
  </keybind>

This is because the key 'n' is recognized just as a normal key in the
third hard-coded rule.

So this commit changes the rules to be more Openbox-like:

  1. Up/Left arrow keys cycles the window forward.
  2. Down/Right arrow keys cycles the window backward.
  3. Other keystrokes are matched against keybinds and execute their
     actions. If they include NextWindow/PreviousWindow action, it cycles
     the selected window forward/backward even while the window switcher
     is active.
2025-01-03 10:51:26 +09:00
John Lindgren
dc826fef81 rcxml: add core.autoEnableOutputs option
Currently, labwc automatically enables outputs at startup and when new
outputs are connected. Make this behavior optional (but still enabled by
default).

With autoEnableOutputs disabled, tools such as kanshi can be used to
give finer-grained control of which outputs are enabled and when.
2024-12-31 16:32:42 +00:00
Johan Malm
a5973c3b48 keyboard: do not set numlock by default
Only force on|off if users specifically requests it in the config file.

Related-to: #2463
2024-12-31 16:23:47 +00:00
Johan Malm
304a94e716 desktop-entry: demote libsfdo error-logging
...to WLR_INFO to avoid logging issues with .desktop files as errors, for
example:

    [sfdo-desktop] 1:1: Name is unset
    [sfdo-desktop] Failed to load /usr/share/applications/lxqt-panel.desktop
    [sfdo-desktop] 1:1: Exec is unset while DBusActivatable is unset or false
    [sfdo-desktop] Failed to load /usr/share/applications/qemu.desktop

Also make libsfdo debug/info logging depend on environment variable
LABWC_DEBUG_LIBSFDO being set to avoid disproportionately verbose logging
by default for one particular sub-system.

Add an 'ENVIRONMENT VARIABLES' section to labwc(1) to describe the above
as well as other hitherto undocumented env vars with prefix LABWC_DEBUG_.
2024-12-30 23:39:02 +01:00
Johan Malm
bb982dc0af keyboard: set numlock to off by default
...to avoid surprises on Acer Aspire One laptops where the numeric
keyboard does not physically exist but "overlaps" the qwerty keyboard.

Reported-by: staryvyr on IRC

Note: We do not like changing defaults, but feel that there is a good
reason for this one.
2024-12-29 21:34:41 +00:00
tokyo4j
5bcc03db05 Revert "keyboard: add window rule to send release-events (#2377)"
This reverts commit 2f8afb2376.
2024-12-29 16:27:34 +09:00
Orfeas
1550eb9c26 action: add WarpCursor action 2024-12-26 10:27:02 +00:00
Johan Malm
8863672b1f labwc-config(5): describe how keys are processed
...when matching against keybinds.

Copied from:

63dc609085/src/input/keyboard.c (L215-L238)
2024-12-16 20:56:45 +00:00
Johan Malm
08de4f3d6b labwc-actions(5): add missing position option to ShowMenu 2024-12-15 01:07:24 +01:00
Orfeas
f4c270c92f query: extend "monitor" query & add missing docs 2024-12-14 20:28:16 +00:00
Johan Malm
2dd31b0a3a docs/environment: remove example MOZ_ENABLE_WAYLAND=1
...because it has not been relevant since before firefox v121 and even
firefox-esr on Debian bullseye is now at v128.

Suggested-by: cry0xen
2024-12-12 20:13:10 +00:00
Andrew J. Hesford
df6081b52c config: only default to xwayland persistence on old wlroots versions
This is a compile-time check, so it will be too conservative if somebody
updates wlroots after building labwc, but that is still better than the
alternatives.
2024-12-12 02:20:33 +01:00
Johan Malm
2d312cd28b config: temporarily set xwaylandPersistence to 'yes' by default (#2414)
...to avoid a bug that is present in wlroots <0.18.2 and which has the
potential to crash the compositor when performing a drag-and-drop action
at the same time as the XWayland server is shutting down.

This will be reverted when wlroots-0.18.2 can be linked with.

Related-to: #2371
2024-12-08 21:18:38 +00:00
Johan Malm
2348a5a87b labwc-config(5): add <xwaylandPersistence> to "core" section example 2024-12-08 21:18:38 +00:00
Johan Malm
8bad1d906c labwc-config(5): reflow some paragraphs to stay within 80 columns 2024-12-08 20:03:11 +01:00
Johan Malm
0b357a3bd4 labwc-config(5): add XML examples at start of some sections 2024-12-08 20:03:11 +01:00
Johan Malm
8e3d5784a3 docs: simplify description of shell wildcard patterns
...to align with glob(7) language

Reported-by: @vyivel
2024-12-01 20:17:04 +01:00
Johan Malm
2f8afb2376
keyboard: add window rule to send release-events (#2377)
...of modifiers which are part of keybinds. This supports clients (for
example blender) that want to see modifier-release-events even if they are
part of a keybinds.

Most clients (including those using Qt and GTK) are setup to not see these
modifier release events and actually misbehave if they do.  For example
Firefox shows the menu bar if alt is pressed and then released, whereas if
only pressed (because the release is absorbed) nothing happens. So, if
Firefox saw bound modifier-release-events it would show the menu bar every
time the window-switcher is used with alt-tab.

    <windowRules>
      <windowRule identifier="blender" wantAbsorbedModifierReleaseEvents="yes"/>
    </windowRules>

Issue #1507
2024-11-26 20:02:36 +00:00
tokyo4j
da418f9720 menu: support borders
This commit adds following theme configurations:

  menu.border.width: 1
  menu.border.color: #aaaaaa
2024-11-25 19:41:07 +00:00
tokyo4j
fb6bf3fdde theme: set default values of window.*.border.color to #aaaaaa
This makes the colors of titlebar and window borders different, but will
let menu.border.color (which will be supported soon) inherit
window.active.border.color just like Openbox does, without making the menu
borders around a selected menu item invisible.
2024-11-25 19:41:07 +00:00
tokyo4j
296b28d008 docs: describe some default values 2024-11-23 11:16:34 +00:00
tokyo4j
794452ca29 docs: align format for describing default values 2024-11-23 11:16:34 +00:00
Jens Peters
7b5c76d573
osd: add desktop entry name option
Looks desktop entry name up from libsfdo.
2024-11-19 18:36:54 +01:00
tokyo4j
22eefa32a2 placement: set default placement policy to cascade 2024-11-14 09:21:01 +01:00
tokyo4j
720ae1fc87 theme: reorder theme entries in documentation and codebase 2024-11-12 17:25:39 +00:00
Johan Malm
a88c721979
environment: ignore env var assignments > 1 KiB (#2325)
...to guard against recursive constructs like FOO=$FOO:bar which would
grow on each reconfigure.

Add log message as well as a warning against this in the man page.
2024-11-10 20:40:51 +00:00
tokyo4j
49587d48d6 docs: add documentation for window.button.height 2024-11-03 20:14:33 +09:00
Andrew J. Hesford
14aad38a2c query: fix three-state-parameter parsing, simplify match logic
Fixes: #2288.
2024-11-01 12:52:10 -04:00
Orfeas
96da82c085 query: support additional conditions for matching clients
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>

Closes: #2245.
2024-10-30 14:30:26 -04:00