Commit graph

79 commits

Author SHA1 Message Date
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
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
tokyo4j
d29464bac7 docs: fix documentation of "atCursor" for dynamic titlebar layout 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
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
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
Orfeas
dda47a5e14 action: make "FocusOutput" behave like "MoveToOutput" 2024-08-24 14:59:42 -04:00
Jens Peters
cd961b1ac1 action: add Enable/DisableTabletMouseEmulation
Useful for window rules.
2024-08-20 21:45:59 +01: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
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
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
b1b48537a1 Add action UnMaximize
Suggested-by: @Vladimir-csp

Fixes: #1825
2024-05-27 21:02:31 +01:00
Tobias Bengfort
41a3b68846 decorations: add SetDecorations action 2024-05-19 19:03:42 +01:00
Johan Malm
bab1be834d Deprecate MoveToCursor
Use <action name="AutoPlace" policy="cursor"/> instead.

Related-to: #1785
Suggested-by: @tokyo4j
2024-05-19 19:57:20 +02:00
Andrew J. Hesford
89589f17c4 action: allow configurable policy in AutoPlace action
Closes: #1784.
2024-05-19 17:32:52 +01:00
Tobias Bengfort
7bc3cae91a query: add window type filter for if-actions 2024-05-18 20:04:08 +01:00
Simon Long
8ba066a1a5
Add screen magnifier
This adds a screen magnifier which can be controlled with the
`ZoomIn` / `ZoomOut` and `ToggleMagnify` actions.

It scales up part of the rendered framebuffer so the magnification
may end up looking blurry depending on the magnification scale.

PR #1774
2024-05-16 00:07:23 +02:00
Tomi Ollila
2e2cf54c00 docs: Fixed some typos, 80 column lines (where possible) 2024-04-26 22:15:39 +01:00
Consolatis
1f39f17be1 docs: add missing documention for the ForEach none branch 2024-04-14 13:27:18 +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
Andrew J. Hesford
cdac800692 action: allow client-menu to open at mouse cursor 2024-03-13 10:51:50 -04: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
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
Jens Peters
945eea8f27 docs: describe MoveToOutput/FitToOutput action 2024-01-22 22:27:08 +00:00
Consolatis
e05bedb140 feat: add Shade/Unshade/ToggleShade actions
This builds on the work of @Consolatis in #1018.

Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
2024-01-15 21:37:36 +00:00
Tomi Ollila
42afdf9193 Fixed some typos, whitespace, periods, 80-column lines
- typos: LINGUAS manually, rest with help of aspell(1)
- whitespace: some trailing spaces/tabs, one utf-8 NBSP (#xC2 #xA0)
- made most text in docs/ fit in max 80-column wide lines
- consistent trailing periods in sentences in labwc-actions.5.scd and
  labwc-config.5.scd; labwc-theme.5.scd had different consistency,
  changed it follow these other files with sentence-ending periods
- and ", respectively" (comma often used to separate)
2024-01-13 19:05:50 +00:00
Ph42oN
bce0c6ce56
Add tearing support (#1390)
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
2024-01-08 20:58:58 +00:00
Tomi Ollila
785a34e8ad Fixed some typos 2024-01-04 19:32:51 +00:00
Andrew J. Hesford
e3cd189769 feat: add "AutoPlace" action
The AutoPlace action will apply placement_find_best() to an active view,
moving it to a position on its output that will minimize overlap with
other views.
2023-12-28 22:09:44 +00:00
kyak
111b955b53
Implement key binds to control virtual outputs (#1287)
Add actions `VirtualOutputAdd` and `VirtualOutputRemove`
2023-12-09 09:01:11 +00:00
Johan Malm
9c1c96f993 Add ResizeTo action
Fixes: #1261
2023-12-01 21:23:42 +00:00
Brandon Nason
bad8f334ea Add omnipresent flag for views 2023-11-28 21:41:30 +00:00
Johan Malm
29a228674b Add unfocus action
...to enable unfocusing currently focused window on desktop click.

Works with:

    <mouse>
      <default />
      <context name="Root">
        <mousebind button="Left" action="Press">
          <action name="Unfocus" />
        </mousebind>
      </context>
    </mouse>

Fixes: #1230
2023-11-07 21:16:33 +00:00
John Lindgren
0430f6f818 view: implement separate horizontal/vertical maximize
This is a useful (if lesser-known) feature of at least a few popular X11
window managers, for example Openbox and XFWM4. Typically right-click on
the maximize button toggles horizontal maximize, while middle-click
toggles vertical maximize.

Support in labwc uses the same configuration syntax as Openbox, where the
Maximize/ToggleMaximize actions have an optional "direction" argument:
horizontal, vertical, or both (default). The default mouse bindings match
the XFWM4 defaults (not sure what Openbox has by default).

Most of the external protocols still assume "maximized" is a Boolean,
which is no longer true internally. For the sake of the outside world,
a view is only "maximized" if maximized in both directions.

Internally, I've taken the following approach:

- SSD code decorates the view as "maximized" (i.e. hiding borders) only
  if maximized in both directions.

- Layout code (interactive move/resize, tiling, etc.) generally treats
  the view as "maximized" (with the restrictions that entails) if
  maximized in either direction. For example, moving a vertically-
  maximized view first restores the natural geometry (this differs from
  Openbox, which instead allows the view to move only horizontally.)

v2: use enum view_axis for view->maximized
v3:
  - update docs
  - allow resizing if partly maximized
  - add TODOs & corrections noted by Consolatis
2023-10-28 22:46:49 +02:00
Axel Burri
ced4ae46ec doc: Add GrowToEdge, ShrinkToEdge actions 2023-10-19 19:09:42 +01:00
Axel Burri
81af658c1f doc: Adapt MoveToEdge action 2023-10-19 19:09:42 +01:00
Arnaudv6
8920e546db Add MoveToCursor action 2023-10-15 20:36:37 +01:00
Consus
e864419194 workspaces: allow referencing the current workspace
This value allows a user to reference the currently visible workspace.
2023-10-01 14:17:29 +01:00
Consus
22e3be40e5 action: add If and ForEach actions
Add If and ForEach actions as described in OpenBox specification.

Limitations:

- If and ForEach cannot contain nested If and ForEach.
2023-10-01 14:17:29 +01:00
Johan Malm
881d788bee action: do not expand env vars in Exec action
...<command> argument (but still resolve tilde).

This makes it easier to write sh -c '' constructs without turning labwc
into a shell parser in order to expand environment variables, whilst
respecting single quotes and escaped characters as well as ignoring
subshells syntax like $(foo) and backticks.

Also, fix bug where buffer length+alloc get out-of-sync
2023-09-23 14:52:59 +01:00
Consolatis
e39744f1d3 Add keepBorder <theme> option and enable it by default
With the new keepBorder option enabled, the
ToggleDecorations action now has 3 states:

- the first time only disables the titlebar
- the second time disables the whole SSD
- the third time enables the whole SSD again

When the keepBorder action is disabled, the old 2-state
behavior is restored, e.g. the ToggleDecorations action
only toggles between on and off.

Fixes #813
2023-08-10 16:09:20 +02:00
stefonarch
0eab7e082c Added missing closing tags 2023-07-16 11:26:23 +01:00
Consolatis
235a8ad9bc ToggleKeybinds per window 2023-07-06 06:02:28 +01:00
Ph42oN
ea623daaee action: add ResizeRelative 2023-06-27 20:59:33 +02:00
Ph42oN
e40159470b add MoveRelative to man page and use view->pending 2023-06-27 20:59:33 +02:00
Johan Malm
f6c3a3d7c3 action: add MoveTo 2023-06-26 06:04:07 +01:00
Tomi Ollila
f817a9e56a docs: fix some typos
Between, output, rounded and focused.

Added one inconsistently missing trailing period.

Inserted newline before last word in one line in
labwc-actions.5.scd in order to keep that line from
passing 80-column boundary.
2023-05-27 14:12:22 +01:00