Commit graph

93 commits

Author SHA1 Message Date
Tomi Ollila
785a34e8ad Fixed some typos 2024-01-04 19:32:51 +00:00
kyak
266690091f Remove headers not being used directly
Fix clangd warnings regarding headers not being used directly.
2023-12-22 20:19:39 +00:00
Consolatis
27de4e6398 theme: create hover button fallbacks
...by copying the non-hover variant and adding a transparent overlay.

Co-authored-by: @johanmalm
2023-12-21 02:42:23 +01:00
nullableVoidPtr
41891209fc chase: use wlroots tree node getters 2023-12-03 18:24:26 +00:00
Consolatis
ddc9047a67 Restore nested resize
Chases: 756ecf8ee9f1e75bc7b8297dc84f97c7d699174b
backend/wayland: use request_state when toplevel is resized

Chases: 3ef68a484243555b020200c6f95246d994932c3f
backend/x11: use request_state when window is resized

Ref: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/2693

We now delay requested resolution changes by the backend until
the next frame event which causes us to render the new content
on the already enlarged buffer. Before this change, an empty
(black) buffer would have been shown instead before the next
frame event caused a new render of the actual contents.

Keep commiting the new state and then scheduling a frame event
would not help as due to the commit call it would still show an
empty buffer in the meantime.

Just modifying wlr_output->pending wouldn't work either because
wlr_scene_output_commit() *completely* ignores it (and it will
be removed in future wlroots commits). For this reason we move
to wlr_scene_output_build_state() directly because it allows us
to supply the current wlr_output->pending state and thus apply
any resolution change in lockstep with new rendering. Result:
No more flickering in the wayland backend and resizing is again
smooth as butter.

This prevents constant flicker while resizing
when running nested via the wayland backend.

For the X11 backend (can be tested via `WLR_BACKENDS=x11 labwc`),
it is still rather janky but at least doesn't cause endless self-
resizing anymore.
2023-11-27 21:01:53 +00:00
John Lindgren
404fabec92 Chase wlroots: wlr_scene_surface_from_buffer renamed
Chases: 7b32c25a4fbdcde4197a06c8e0ff638c54753bd7
wlr_scene: Rename wlr_scene_surface_from_buffer
2023-11-27 21:01:53 +00:00
Consolatis
d2c403b84f src/common/spawn.c: Restore SIGPIPE default handler before exec
Fixes: #1209
Reported-by: @bdantas
2023-10-29 15:18:32 +01:00
Consolatis
8d17ab2d60 scaled_scene_buffer: make dropping the buffer optional
In preparation to also use the scaled_scene_buffer for
theme components like rounded corner images and button
icons.

No functional change intended.
2023-10-19 21:48:57 +01:00
Consus
3e5b988d38 common: use fnmatch() for pattern matching
Drop-in POSIX-compliant function that has a nice glob(7) manual page for
reference.
2023-10-01 14:17:29 +01:00
Consus
12f6a8975a Unbreak match_glob
Since bool is not a C89 type, include <stdbool.h> in match.h.
2023-10-01 14:17:29 +01:00
Johan Malm
ccc3d14658 common/buf.c: do not use memcpy for overlapping regions 2023-09-23 16:28:23 +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
Johan Malm
c6c1f8e04b buf: do not expand $() in buf_expand_shell_variables() 2023-09-23 14:52:59 +01:00
Johan Malm
a386133068 common/file-helpers.c: share file_exists() to reduce duplication 2023-09-17 19:26:41 +01:00
redtide
143714f1c9 src/common/parse-bool.c: support on/off boolean values 2023-09-13 05:27:27 +01:00
Consolatis
58b33fb0c9 Add window resize indicator 2023-08-19 18:37:16 +02:00
John Lindgren
216056a653 Chase wlroots: Add missing #include
Chases: 323f0b94db22877487bca073fca497cd033719e8
wlr_scene: Cleanup header includes
2023-07-17 08:35:46 -04:00
Johan Malm
b200dd2e7b osd: use theme->osd_border_width for focused item 2023-06-29 19:14:08 +01:00
Johan Malm
f4f35a9dff common/string-helpers.c: add strdup_printf() 2023-06-26 06:30:33 +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
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
Johan Malm
ac1899ada5 parse-bool.c: add helpers to set bool/int iff valid boolean 2023-04-28 20:48:39 +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
bdf6e13881 Move get_bool() to src/common/
...in preparation for sharing it more widely
2023-03-26 19:52:50 +02:00
Consolatis
82e9e866ec Enable more compiler warnings 2023-02-01 10:42:22 +01:00
Consolatis
1995a33df9 CodeStyle: prevent space in code indents 2023-01-31 21:22:40 +00:00
Consolatis
d00327bc32 menu: Dynamically adjust menu width based on widest item
Adds two new theme vars:
- menu.width.min (menu will never be smaller than this)
- menu.width.max (menu will never be wider than this + padding)

A fixed menu width can be achieved by setting
menu.width.min == menu.width.max.
2022-12-06 21:08:43 +00:00
Johan Malm
e45e2c7e60 Fix coding style 2022-11-03 23:01:52 +01:00
Johan Malm
d424514e24 Fix minor coding-style violations
...based on https://github.com/johanmalm/checkpatch.pl
2022-09-22 22:39:44 +01:00
John Lindgren
a54d378e6c common: Add znew/znew_n() macros 2022-09-18 15:25:19 -04:00
John Lindgren
cb40cdc36c common: Add additional memory utilities (xzalloc() etc.) 2022-09-17 10:57:30 -04:00
John Lindgren
07a83c19f0 config: Add support for font slant and weight 2022-09-15 21:48:05 +01:00
Consolatis
15a5b710db alt-tab preview: restore functionality after move to scene-graph 2022-08-28 20:40:36 +02:00
Consolatis
127a9c7be4 src/{common/font,theme}.c: Switch to cairo helpers 2022-08-26 06:54:12 +01:00
Consolatis
fb36463c34 common/graphic-helpers: Add cairo helpers 2022-08-20 22:16:52 +01:00
Consolatis
8c8583ef94 common/graphic-helpers: Add multi_rect 2022-08-20 22:16:52 +01:00
Johan Malm
a610aff946 scaled_font_buffer.c: simplify calls to zfree()
There is no need to check foo != NULL before zfree(foo)
2022-08-12 11:16:17 +02:00
Johan Malm
429df42a8f menu: render submenu arrows 2022-08-12 11:16:17 +02:00
Johan Malm
6a750d465e font: remove unused font_buffer_update() 2022-08-12 11:16:17 +02:00
Joshua Ashton
722aa042b7 main: Increase FD limit
This defaults to 1024, which is tiny, but is a requirement
for processes using the deprecated `select` function.

We must reset this back whenever we fork to start a new process,
as this is inherited, and breaks applications using `select` otherwise.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2022-07-17 00:59:23 +00:00
Joshua Ashton
6c2bbb42ea common: Add helpers for raising/lowering FD limit
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2022-07-17 00:59:23 +00:00
Johan Malm
fd7ec0ab95 buf.c: fix bug in environment variable expansion
Allow underscore in environment variable names.

Closes issue #439

Helped-by: @Consolatis
...who both found the bug and told us how to fix it :)
2022-07-15 21:51:28 +02:00
Consolatis
d309df6f87 src/common/font.c: Add font_width() 2022-06-15 16:14:02 +01:00
Consolatis
5d79911244 Add scaled_font_buffer implementation 2022-06-14 22:03:08 +01:00
Consolatis
c3f07aacf0 Add abstract scaled_scene_buffer implementation 2022-06-14 22:03:08 +01:00
Consolatis
f3a685155d common/font: Add scale argument 2022-06-14 22:03:08 +01:00
Consolatis
efd9155513 Chase wlroots: children are now only availabe in tree nodes
Chases wlroots 71f8a48d380701de1e3331d53d470bd76f5f643b
wlr_scene: Move children list from wlr_scene_node to wlr_scene_tree
2022-06-07 07:13:37 +01:00
Consolatis
bda48da68d Deal with font_buffer_create() failures 2022-05-26 22:19:56 +01:00
Consolatis
163179dda1 Chase wlroots: wlr_scene_surface
To update the wlroots subproject use
meson subprojects update wlroots
2022-05-26 06:48:00 +01:00