Commit graph

1629 commits

Author SHA1 Message Date
Johan Malm
a6f0fc9c62 window-rules: add skipTaskbar and skipWindowSwitcher 2023-05-22 20:37:49 +01:00
Johan Malm
15cd093f2e action: add ToggleAlwaysOnBottom 2023-05-22 20:37:49 +01:00
Johan Malm
78aec7945c xdg-popup: render above always-on-top 2023-05-22 20:37:49 +01:00
Tomi Ollila
f2c3f83041 action: support {Go,Send}ToDesktop 'wrap' option
Make wrap 'true' by default for both GoToDesktop and SendToDesktop,
in order to default to the current behaviour, and to stay consistent
with Openbox behaviour.
2023-05-21 22:32:07 +02:00
Consolatis
44645d06c2 src/output.c: destroy workspace OSD on output destroy 2023-05-17 13:56:11 +02:00
Consolatis
f2aa030aac src/workspaces.c: do not render OSD on disabled outputs
Fixes #914
2023-05-17 13:56:11 +02:00
Consolatis
ab8ab3dd86 src/action.c: validate action type when assigning arguments
Before this patch it was possible to assign an argument with an
existing name to an action that didn't support the given argument.
An example of this is using `direction` for `GoToDesktop`.

This patch now only creates action arguments that are actually
defined for the given action type and logs an error for
unsupported arguments.

The commit also makes sure to always supply the argument name.
This will reduce required checks in other parts of the codebase
in future commits.

Partly fixes: #894
2023-05-15 22:32:33 +02:00
Tomi Ollila
7ad5200f2e includes: identifier consistency in include guards
Made all header files to have LABWC_ prefix in include guard identifers.

Converted from __LABWC_ in 35 include/ files.
Converted from __LAB_ in 5 include/ files.
Added LABWC prefix to 3 include/ files.
Added include guards to 3 include/ files.

The double underscores were removed since according to C standard
those "are always reserved for any use".
2023-05-13 22:29:21 +01:00
Consolatis
dbad5fc483 src/config/rcxml.c: move region validation into the validate() hook 2023-05-12 19:30:59 +02:00
Johan Malm
2df13933ca labwc-config(5): describe element/attribute-agnostic XML parsing 2023-05-10 22:12:02 +01:00
Johan Malm
d37e705548 window-rules: support title criteria
Example config:

    <windowRules>
      <windowRule identifier="foot" title="max">
        <action name="Maximize"/>
      </windowRule>
    </windowRules>

Observe that:

- `foot -T foo` starts maximized
- `xterm -T foo` starts normal
2023-05-10 21:21:34 +01:00
Johan Malm
63db731cf4 build: bump version to 0.6.3 2023-05-08 07:29:12 +01:00
Johan Malm
92a79073bc NEWS.md: add notes on 0.6.3 2023-05-08 07:24:46 +01:00
John Lindgren
5b962d5437 xwayland: Add mapped argument to xwayland_view_create()
This is a trivial cleanup to make xwayland_view_create() symmetrical with
xwayland_unmanaged_create(), and avoid the need to access view->impl from
xwayland-unmanaged.c.

The return value of xwayland_view_create() is no longer user, so return void.

No functional change.
2023-05-06 12:12:13 -04:00
Consolatis
9a9e20d2b0 followMouse: add followMouseRequiresMovement
This implements the same config option as `underMouse` in Openbox.

Fixes #862
2023-05-06 14:13:20 +01:00
Johan Malm
bdd3849138 match.c: fix g_utf8_casefold() memory leak
Reported-by: @jlindgren90
2023-05-06 12:08:31 +01:00
Johan Malm
d609c9e3f9 Support window-rules
Two types of window rules are supported, actions and properties. They are
defined as shown below.

    <windowRules>

      <!-- Action -->
      <windowRule identifier="some-application">
        <action name="Maximize"/>
      </windowRule>

      <!-- Property -->
      <windowRule identifier="foo*" serverDecoration="yes|no"/>

    </windowRules>

Rules are applied if windows match the criteria defined by the
'identifier' attribute which relates to app_id for native Wayland windows
and WM_CLASS for XWayland clients.

Matching against patterns with '*' (wildcard) and '?' (joker) is
supported.

Add 'serverDecoration' property.
2023-05-04 22:09:55 +01:00
Johan Malm
d0aafb684f action: add Maximize 2023-05-04 22:09:55 +01:00
Johan Malm
71f5ac8323 Add common/match.c with match_glob() from theme.c
...and make it fully case-insensitive in preparation for window-rules.
2023-05-04 22:09:55 +01:00
Consolatis
e1725e17b2 src/output.c: fix adaptive sync
Fixes #642

Reported-by: @heroin-moose
Tested-by: @heroin-moose
2023-04-30 15:12:10 +01:00
Johan Malm
ac1899ada5 parse-bool.c: add helpers to set bool/int iff valid boolean 2023-04-28 20:48:39 +01:00
Consolatis
ed8999456a Ignore SIGPIPE
Prevent wayland clients that request the X11 clipboard but closing
their read fd prematurely to crash labwc because of the unhandled
SIGPIPE signal. It is caused by wlroots trying to write the X11
clipboard data to the closed fd of the wayland client.

See https://github.com/labwc/labwc/issues/890#issuecomment-1524962995
for a reproducer involving xclip and wl-paste | head -c 1.

Fixes #890
Reported-by: @FuzzyQuills
2023-04-27 18:21:24 +01:00
Consus
957dd43af2 output: Make the session lock layer the topmost
Make sure that only the session lock layer is visible to a user. Fixes
the issue with mako notifications being rendered above the swaylock
window.
2023-04-27 18:17:44 +02:00
Johan Malm
86cb62ed12 action: gracefully handle argument without key
Fixes: issue #894
2023-04-26 15:11:31 +01:00
Johan Malm
fa50149525 common/parse-bool.c: make parse_bool() generic
...to avoid multiple versions of a boolean-parser.

- Optionally take a default value
- Return -1 on error
- Rename get-bool.c to parse-bool.c
2023-04-26 15:11:31 +01:00
Johan Malm
473f0aacbd action: add get_arg_value_{str,bool} to simplify multi-arg handling 2023-04-26 15:11:31 +01:00
Johan Malm
440f7bd760 action: make action_arg_add_bool() static 2023-04-26 15:11:31 +01:00
Marcin Puc
839179aafd Add Polish translation 2023-04-24 21:37:39 +01:00
Johan Malm
09c1cdd2dc osd: set field width to ellipsize 2023-04-24 04:25:52 +02:00
Johan Malm
693c5bd937 config: move cycle_* bools to window_switcher struct 2023-04-21 16:05:48 +01:00
Johan Malm
0f37c04df0 config: support window switcher field definitions
<windowSwitcher>
  <fields>
    <field content="type" width="25%" />
    <field content="app_id" width="25%" />
    <field content="title" width="50%" />
  </fields>
</windowSwitcher>

Relates to issues #852 #855 #879
2023-04-21 16:05:48 +01:00
Johan Malm
36849eb7ef config: make <windowSwitcher> a toplevel element
...rather than a child of <core>
2023-04-21 16:05:48 +01:00
Johan Malm
5744bba849 xwayland: validate PID before activating unmanaged surface
Check that an unmanaged surface trying to grab focus is actually a child
of the topmost mapped view.
2023-04-21 15:59:36 +01:00
Johan Malm
64d62a91b6 xwayland: handle unmanaged activate requests 2023-04-19 14:30:54 +01:00
Johan Malm
26e6828e67 xwayland: handle unmanaged override-redirect requests
Fixes: issue #874
2023-04-19 14:30:54 +01:00
Johan Malm
9d08a452a3 xwayland: split out xwayland_view constructor
...and make it public in preparation for supporting override-redirect
requests from unmanaged xwayland surfaces.
2023-04-19 14:30:54 +01:00
Flrian
130da3c803 po: clean up language files
Changed entries in "Language" field to language code
Added language names to "Language Team"
Removed example email address
Fixed author names in Copyright section
2023-04-17 17:12:14 +01:00
umksan
5bf594af3d Update es.po
Small grammatical error
2023-04-16 17:13:03 +01:00
May Mantari
6aeed55622 Add Indonesia translation 2023-04-15 22:27:39 +01:00
Sunderland93
bf7d4b661b Add Russian translation 2023-04-15 21:54:58 +01:00
Jean-Luc Mackail
4fc88dca44 src/cursor.c: handle pointer constraint position hint
Now cursor hints are respected once cursor movement occurs
after unlocking the pointer.

Fixes Overwatch 2 failing to center the mouse pointer when
opening the communication wheel in-game.

Fixes #872
2023-04-13 06:01:42 +02:00
Johan Malm
d4288415c9 Support ext-session-lock protocol 2023-04-02 23:09:38 +01:00
Johan Malm
6b83385ff7 README.md: simplify configuration section 2023-04-01 22:41:04 +01:00
John Lindgren
d7dd366bad view: Add view_move_to_front/back().
This avoids calling view->impl functions from cursor.c and desktop.c.

v2: Add an explicit recursion guard in cursor_update_focus().
2023-04-01 22:50:01 +02:00
Johan Malm
12f3314595 server: add wlr_backend_autocreate() trouble-shooting message 2023-04-01 21:31:24 +01:00
Consolatis
e44d565672 src/cursor.c: make sure the cursor is visible after startup
Before this patch, the cursor was invisible after labwc startup
unless manually moved by the user (or being positioned on top
of some some automatically spawned client surface). This patch
sets the cursor from its uninitialized value (LAB_CURSOR_CLIENT)
to the default cursor.
2023-03-29 21:39:11 +01:00
Consolatis
4cd8afa83e src/cursor.c: fix invisible cursor on output loss / restore
Previously, the cursor image was only updated on output loss when the
cursor was on a labwc owned surface. This patch forces a re-enter of a
client surface in the remaining case of cursor being over a non-labwc
surface which causes the client to re-set its own cursor image.

This fixes a regression caused by 4dc99e2f38.
Thanks to @Flrian for finding the root cause of the issue.

Fixes #820

Reported-by: @Flrian
Tested-by: @Flrian
2023-03-29 21:39:11 +01:00
Johan Malm
a8e0248f47 config: support scroll-factor
Fixes: issue #846
2023-03-27 20:30:00 +01:00
Juliusz Chroboczek
753aef9d78 Implement action "Lower" 2023-03-27 20:27:00 +01:00
Johan Malm
a6896e6978 desktop: move scene-tree node in move-to-back
view_minimize() does not need to call desktop_move_to_back() because the
stacking order is not changed and the windowSwitcher uses the scene-tree
nodes anyway.

Note: Movement of xwayland sub-views still relies on keeping server->views
in sync with z-order
2023-03-26 20:22:57 +01:00