Commit graph

401 commits

Author SHA1 Message Date
Johan Malm
e16e78e7a4 theme: add window.titlebar.padding.{width,height}
...to replace padding.{width,height} to minimize breaking changes with the
visual appearance of the titlebar.

With the diverging labwc specification for the titlebar (listed below)
we have to choose between (a) not supporting the padding.{width,height}
option which exist in many extant Openbox themes to keep titlebar height
(almost) the same; or (b) making the allocated button areas much smaller
and not keeping the default hover going all the way to the edges. All in
all it just seems a lot simpler and cleaner to break this link to the
openbox spec.

Examples of previous change driving the requirement for this change:

- SVG and PNG support which often results in large icons with hover
  effects.
- Theme option window.button.{height,width}
- Larger default areas for icons (26x26)

In way of an example, Numix theme sets a padding.height of 6 which would
have resulted in a titlebar 12px taller without this change.
2024-10-08 20:04:05 +01:00
Johan Malm
383fb20bf4 theme: change padding.height default to 0
...because now that window.button.height determines the height of button
hover effect the visible appearance of the titlebar will change unless
we reduce the padding to zero.

Backward compatibility notice: If a users theme sets padding.height to a
value greater than zero, the titlebar will be taller compared with
openbox. This can be fixed by either reducing window.button.height or
overriding padding.height
2024-10-08 20:04:05 +01:00
Johan Malm
2884f77b30 theme: remove titlebar.height option
This theme setting does not exist in Openbox spec and has just been an
additional 'knob' to tweak the height which is otherwise derived from the
sizes of the objects within it plus padding.
2024-10-08 20:04:05 +01:00
Rick Calixte
5b774e6e99
Add labwc to XDG_CURRENT_DESKTOP to support a portals.conf (#1716)
The previous `UseIn` key was deprecated in xdg-desktop-portal 1.17/1.18.
It has been superceded by the portals.conf structure so that each
desktop can configure the precise desired structure for portals. In
addition, support was added to the Desktop Entry Specifications to
support a `DesktopNames` key that login managers will use to set
XDG_CURRENT_DESKTOP.

* [portals.conf
  Documentation](https://github.com/flatpak/xdg-desktop-portal/blob/main/doc/portals.conf.rst.in)
* [Example
  sway-portals.conf](https://salsa.debian.org/swaywm-team/sway/-/blob/debian/sid/debian/sway-portals.conf)
* [Desktop Entry
  Specifications](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html)

Ref: flatpak/xdg-desktop-portal#955
2024-10-01 21:33:45 +01:00
tokyo4j
915d638f8a doc: update default value of <theme><titlebar><layout> 2024-10-01 15:11:43 +09:00
tokyo4j
a745f91169 ssd: support window icons
The default `titleLayout` is updated to `icon:iconify,max,close` which
replaces the window menu button with the window icon.

When the icon file is not found or could not be loaded, the window menu
icon as before is shown.

The icon theme can be selected with `<theme><icon>`.

This commit adds libsfdo as an optional dependency. `-Dicon=disabled` can
be passsed to `meson setup` command in order to disable window icon, in
which case the window icon is always replaced with a window menu button.
2024-09-25 18:04:09 +09:00
Jens Peters
b9414d8b8d action: implicitely unmaximize when unsnapping
Co-authored-by: tokyo4j <hrak1529@gmail.com>
2024-09-25 17:59:10 +09:00
Jens Peters
694c5a7469 action: add UnSnap action
Same untiling behavior as ToggleSnapToEdge/Region,
but unconditionally.

Co-authored-by: tokyo4j <hrak1529@gmail.com>
2024-09-25 17:59:10 +09:00
Jens Peters
cb2e2c1016 action: add ToggleSnapToEdge/Region actions
Behaves identical like SnapToEdge and SnapToRegion, but
untiles the window when already being tiled to the given
region or direction.

Co-authored-by: tokyo4j <hrak1529@gmail.com>
2024-09-25 17:59:10 +09:00
Johan Malm
cc26ac29b9
theme: finish titleLayout implementation (#2150)
Change Openbox style WLIMC syntax to `menu:iconify,max,close` as was
agreed when PR #2088 was merged.

    <titlebar>
      <layout>menu:iconify,max,close</layout>
      <showTitle>yes|on</showTitle>
    </titlebar>

Ref:
- https://github.com/labwc/labwc/pull/2088#issuecomment-2295730704
2024-09-23 19:17:12 +01:00
tokyo4j
d29464bac7 docs: fix documentation of "atCursor" for dynamic titlebar layout 2024-09-21 14:15:16 +01:00
tokyo4j
14f4d8c361 docs/rc.xml.all: add missing atCursor="no" 2024-09-21 14:15:16 +01:00
Droc
4a1375c701 client send to menu
Shows all workspaces that current view can be sent to.
Works best when added to Client menu.

<menu id="client-send-to-menu" label="Send to..." />

Menu uses ">" and "<"  to highlight the current workspace
2024-09-19 06:36:27 +01:00
Droc
4f11dad45b client list combined menu examples 2024-09-19 06:33:17 +01:00
Droc
71b2b5a4bc menu: support client-list-combined-menu
...showing windows across all workspaces.

<action name="ShowMenu" menu="client-list-combined-menu"/>
2024-09-17 22:13:23 +01:00
Jens Peters
9395348c55 theme: add circle button hover effect (#2127) 2024-09-10 22:14:30 +01:00
Jens Peters
824b0fa4e3 theme: add button padding and spacing (#2127)
While at it, separate corner width from button
width. Both are independed and having them
separately improves readability.
2024-09-10 22:14:30 +01:00
Droc
8850368ab9 Add position arguments for menus
...utilizing x,y coordinates where values can be a number, a negative
number, a percentage or "center".

- (0,0) is top left corner
- (-0,-0) is bottom right corner
- % is percentage of width and/or height
- 'center' centers the menu vertically and/or horizontally

    <action name="ShowMenu">
      <menu>root-menu</menu>
      <position>
        <x>0</x>
        <y>0</y>
      </position>
    </action>

Note: both x and y values must be supplied for positioning to work.
2024-09-05 22:28:50 +02:00
tokyo4j
1f1bdad087 interactive: allow moving horizontally/vertically maximized window
Applies drag resistance unidirectionally for horizontally/vertically
maximized windows, allowing them to be dragged without being untiled
immediately. When the distance of cursor movement orthogonal to the
maximized direction exceeds <resistance><unMaximizeThreshold>.

While dragging a horizontally/vertically maximized window, edge/region
snapping is disabled to prevent unintentional snapping and overlays.

This commit also includes some refactoring to simplify the logic.
2024-08-26 20:30:22 +02:00
01micko
72f59c32a2 docs: add description for new theme buttons 'shade' and 'desk' 2024-08-25 07:25:30 +02:00
Andrew J. Hesford
1bcaf8255f action: rename "omnipresent" button options for Openbox compatibility
- Mouse context "Omnipresent" -> "AllDesktops"
- Theme elements "window.*.button.omnipresent" -> "window.*.button.desk"
- Update documentation accordingly
2024-08-25 07:22:23 +02:00
Orfeas
dda47a5e14 action: make "FocusOutput" behave like "MoveToOutput" 2024-08-24 14:59:42 -04:00
Standreas
f2b6661db4 Fix typo in rc.xml.all 2024-08-24 10:16:42 -04:00
Andrew J. Hesford
b7bccc8026 ssd: add optional omnipresent button 2024-08-24 05:42:38 +02:00
Andrew J. Hesford
186a07be9b ssd: add optional shade button 2024-08-24 05:42:38 +02:00
tokyo4j
b667107d1a input: move <scrollFactor> to <libinput> section
This allows per-device configuration of scroll factor (e.g. setting
different scroll factors for mice and touchpads).
2024-08-23 16:20:56 +09:00
Johan Malm
228a74ca48
Merge pull request #2088 from xi/titlelayout
theme: implement titleLayout
2024-08-21 19:20:34 +01:00
droc12345
8fda9968e6
menu: add title theme options (#2097)
Add theme options `menu.title.text.color` and `menu.title.text.justify`.

Add font place MenuHeader: `<font place="MenuHeader">`

Add `Oblique` font style

```
<theme>
  <font>
    <slant>Oblique</slant>
  </font>
</theme>
```
2024-08-21 18:27:07 +01:00
Tobias Bengfort
9a252249c9 ssd: add titleLayout setting 2024-08-20 23:04:10 +02:00
Jens Peters
cd961b1ac1 action: add Enable/DisableTabletMouseEmulation
Useful for window rules.
2024-08-20 21:45:59 +01:00
Johan Malm
0552c6b7f0 menu: support titles
...defined by `<separator label="">`.

Also add the theme option `menu.title.bg.color: #589bda`

The following will be added in separate commits
- menu.title.bg.border.color: #7cb6ec
- menu.title.text.color: #ffffff
- menu.title.text.justify: center
2024-08-20 18:01:22 +01:00
Jens Peters
f20b2c7632 input: apply tablet rotation before area transformation
This makes the behavior consistent with auto-rotation
as a result of output mapping.
2024-08-08 20:27:06 +01:00
Jens Peters
df12572f29 docs: clarify tablet rotation for mapped outputs 2024-08-08 20:27:06 +01:00
tokyo4j
670cc0f511 Rename <snapping><dragResistance> to <resistance><unSnapThreshold>
As we already have <resistance><{screen,window}EdgeStrength>,
<resistance> will be a better place for this setting.
2024-08-08 09:49:53 +09:00
Jens Peters
433a4509af
tearing: add fullscreen options (#1941)
Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
2024-08-06 21:23:10 +01:00
Johan Malm
19f0b769de labwc-config(5): minor refactor to fix pandoc rendering 2024-08-06 21:01:36 +02:00
Tobias Bengfort
116382fd89 keybind: implement allowWhenLocked
fixes #2034

see bc258a3be2/sway/sway.5.scd (L409)
2024-08-06 19:15:06 +02:00
Tobias Bengfort
6dd0d69889 docs: integrate onRelease into keybind 2024-08-06 19:15:06 +02:00
tokyo4j
c202d77c2d Add resistance when dragging tiled windows
Adds a config option <snapping><dragResistance> with default value 20.
This prevents tiled/maximized windows from being unintentionally untiled.
2024-08-02 23:40:26 +02:00
Christopher Snowhill
d033a2fbf6 output: allow tearing with atomic mode setting
Additionally, track errors and abandon the tearing allowance when it
cannot be set for two-seconds' worth of consecutive frames.
2024-07-20 08:09:00 -04:00
Andrew J. Hesford
14d9bbab90
xwayland: support xinitrc scripts to configure server on launch (#1963) 2024-07-20 09:40:11 +01:00
Consus
e4afa10fe4
theme: allow to set window button size (#1965)
This commit introduces new option "window.button.width". Despite the name
it currently affects both width and height.
2024-07-20 09:33:57 +01:00
tokyo4j
46ec513630 view: implement cascade placement policy
Adds following settings:
<placement>
  <policy>cascade</policy>
  <cascadeOffset x="40" y="30" />
</placement>

"Cascade" policy places a new window at the center of the screen like
"center" policy, but possibly shifts its position to bottom-right so the
new window doesn't cover existing windows.

The algorithm is copied from KWin's implementation:
df9f8f8346/src/placement.cpp (L589)

Also added some helper functions to manipulate `wlr_box`.
2024-07-20 08:59:46 +01:00
Jens Peters
e26ec472b2 docs: add tablet tool section 2024-07-19 22:45:41 +01:00
Birger Schacht
3be20dc6c7 docs: fix typo in labwc-config.5.scd 2024-07-13 09:46:29 -04:00
Andrew J. Hesford
9153c22dab xwayland: allow persistence
Closes: #1958.
2024-07-04 05:19:19 +02:00
droc12345
f2755a4e2e
action: remember initial direction of PreviousView
...when cycling windows. Also make the toggling of direction when shift
is pressed relative to the initial direction. For example if W-j is
bound to PreviousWindow, subsequent key presses will continue to
cycle backwards unless shift if pressed.

Add documentation for using shift/arrow keys in Next/Previous
2024-06-26 22:03:56 +01:00
Jens Peters
b63c6a0fc2 action: add ToggleTabletMouseEmulation
Useful for switching between application-defined and
mapped tablet  pad buttons. Also for quickly troubleshooting
tablet behavior.
2024-06-18 22:13:28 +01:00
Johan Malm
1dadb12807 menu: capitalize Roll Up/Down
...because it seems like better English and is more consistent with other
menu entries.

Same for 'Move Left' and 'Move Right'
2024-06-15 21:31:00 +01:00
tokyo4j
bb1d0b4352 Implement <resize><drawContents>
<resize><drawContents>[yes|no] configures whether to let the clients
redraw its window content content while resizing.

When <resize><drawContents> is set to no, a multi-rect is shown to
indicate the geometry of the resized window.
2024-06-15 21:17:01 +01:00