Commit graph

71 commits

Author SHA1 Message Date
5c5cb55abb move to hw-s 2024-09-19 22:38:36 +01:00
0bb709491b core: sanitize environment and paths from user data
fixes #242
2024-07-22 13:32:58 +02:00
Yaroslav
91e48d6acd
core: Small fixes (#215)
* fix build warnings

* properly generate wayland protocols on rebuild

* make systemd service installation optional
2024-05-21 12:16:37 +01:00
ccabd97be3 config: add screencopy:max_fps 2024-05-02 16:05:56 +01:00
12af841341 screencopy: fixup timing issues with frame re-scheduling
ref #120
2024-05-02 16:01:58 +01:00
Tom Englund
0fe840441e
core: reset screenshot pointer aswell (#209)
ensure the screenshot portal is destructed before the connection is
down, otherwise it segfaults inside sdbus.
2024-04-25 16:47:35 +01:00
9ace6f969c core: use a lock_guard for loopRequestMutex
fixes #207
2024-04-21 19:33:52 +01:00
65fb44ae49 config: add explicit ctors for config variables
fixes #190
2024-02-21 16:29:24 +00:00
4fc83e6871 core: avoid using uninitialized ptrs 2024-01-18 15:50:22 +01:00
899a70e759 core: don't critically exit if env doesnt have home
fixes #163
2024-01-07 19:14:05 +01:00
a2c37e2d6e core: fix invalid type passed to CConfig 2024-01-03 14:10:31 +01:00
c5b69eb5b5 config: add a config with hyprlang 2024-01-03 12:59:40 +01:00
54a30259be core: temporairly disable foreign_toplevel dynamic bind
ref #147
2023-12-31 01:04:31 +01:00
576a49ef3d core: fix incorrect usage of ms in poll thread
fuck me
2023-12-25 15:22:00 +01:00
24141c05c2 core: avoid having the toplevel mgr bound all the time 2023-12-25 15:05:30 +01:00
Oliver Enes
b2fc111096
portal: Added back screenshot functionality (#127) 2023-11-05 01:00:51 +00:00
d8daa2a84f core: fix pollfds hup check loop 2023-10-14 11:58:18 +01:00
Ngô Huy
60af24a70d
dbus: Fix issue #114 (#115)
The line #249 calls system bus by default, dbus will deny this request,
then we need to call session bus instead.
2023-10-12 23:17:00 +01:00
vaxerski
ec2e207740 core: fix missing sentinel in execl 2023-10-10 14:47:03 +01:00
vaxerski
667007fa4e core: kill process if threads are in a deadlock 2023-10-10 14:45:54 +01:00
vaxerski
f147831c53 core: remove debug terminate
I am a fucking idiot. fixes #107
2023-10-08 01:05:34 +01:00
vaxerski
158b5892bd internal: gracefully exit on termination after creating the event loop
possibly might help #103
2023-10-05 01:24:55 +01:00
Rudolchr
f9461b0b7d
build: Fix build when using clang (#100)
* Add -Wno-address-of-temporary to allow taking an address of temporary like -fpermissive does for gcc

* Make some implicit casts explicit

* Implement the wl_array_for_each macro inline as clang does not like to handle it's implicit typecast

* Removed unecessary include that was automatically added by the ide

* Replaced reinterpret_cast's with c-style casts
2023-09-26 22:23:02 +01:00
vaxerski
2f48e65503 core: rework event loop for polling and C++-style awaits
Stops the event loop from checking all the time in favor of locks and polling.
2023-09-16 18:22:53 +01:00
Vaxry
022469529c
Woo! Full rewrite, v1.0 release. (#78) 2023-09-06 20:36:48 +02:00
Pascal J
7d3da7e968
fix implicit function declaration (#53)
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2023-04-23 19:37:42 +01:00
vaxerski
2366b4d415 internal: remove metadata cursor mode 2023-04-13 21:14:13 +01:00
vaxerski
0527deefe8 internal: bring back metadata cursor support 2023-04-10 12:27:18 +01:00
vaxerski
ab8d54f6f6 feat: add session restore 2023-04-09 23:30:19 +01:00
Vaxry
510257c0e9
[WIP] Global Shortcuts impl (#35)
Implements the `GlobalShortcuts` portal via `hyprland-global-shortcuts-v1`

---------

Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
2023-04-09 13:47:05 +01:00
vaxerski
803c00db11 screencast: crudely allow metadata and ignore it 2023-04-05 22:23:59 +01:00
Leftas
607ce73671
Change from wlr to hyprland so dbus would recognize different implementation 2022-12-04 19:57:30 +02:00
columbarius
c83b3cc514 screenshot: Announce version property 2022-09-12 23:33:54 +02:00
columbarius
b5491df0c0 screencast: destroy session if output is removed
We teardown all existing screencast_instances using the removed output
by destroying the frame, removing all timers and then marking the
instance as ready for teardown so we can destroy it after the last connected
session is closed.

Any wlr_screencopy_frame_v1 has to be destroyed before the connected
output can be removed. Otherwise wlr_screencopy_frame_v1_destroy
segfaults the whole program. To ensure this we will make all frame
callbacks safe to be triggered for a previous destroyed frame.
2022-05-31 01:23:34 +02:00
Alias Gram
657b9edad5 chore(logging): change config file error to info 2022-04-18 18:44:47 +02:00
columbarius
0683f7ca7e screencast: add option to force implicit modifier to be linear
Linear buffer layouts are supported by most gpu vendors and as such
should be compatible in mixed mutli gpu setup where the implicit
modifier of one gpu is not supported by the other.

This option should make xdpw work in these environemnts.

The option is marked as experimental since it might be removed if
explicit modifiers provide a better solution.
2022-04-10 13:38:01 +02:00
columbarius
21d26fe23e session: destroy screencast_instance directly when paused
A PipeWire client might pause the stream which enables us to stop
requesting buffers from the compositor. In this case the the quit bool
won't be enacted on and thus we should destroy it directly from here.
2022-04-04 15:37:53 +02:00
Simon Ser
e23e109e41 Handle POLLHUP
This makes xdpw exit when either the D-Bus daemon, the Wayland
compositor or Pipewire is shut down. This avoids having dangling
non-functional xdpw instances, e.g. when restarting the compositor.

To test, start Sway nested in Sway, run xdpw with
WAYLAND_DISPLAY=wayland-2, and exit the nested Sway.
2021-07-01 11:58:26 +02:00
columbarius
6438edb7b9 config: handle missing HOME env variable gracefully
Fixes: https://github.com/emersion/xdg-desktop-portal-wlr/issues/149
2021-06-17 09:37:16 +02:00
columbarius
b20b9d76d7 config: fix format specifier for max_fps 2021-05-22 12:26:50 +02:00
columbarius
bbd4f9d2b1 doc: add note about the list character of env XDG_CURRENT_DESKTOP 2021-05-21 19:35:58 +02:00
columbarius
feede20314 config: parse XDG_CURRENT_DESKTOP as a list 2021-05-20 22:45:10 +02:00
columbarius
c60b2b6ca8 config: fix memory leak config_home_fallback 2021-05-06 11:52:16 +02:00
columbarius
620946b320 config: add missing keys to print_config 2021-05-03 15:19:20 +02:00
columbarius
22af25749e config: use inih instead if iniparser 2021-05-03 15:19:20 +02:00
Simon Ser
5d3cf9a8fa Remove -o and -f options
These can be specified in the configuration file now.
2021-04-21 12:12:40 -04:00
Aleksei Bavshin
9ba958c7d2 Fix gcc warnings on invalid free call
```
../src/core/config.c: In function ‘finish_config’:
../src/core/config.c:26:9: error: ‘free’ called on pointer ‘config_7(D)’ with nonzero offset 16 [-Werror=free-nonheap-object]
   26 |         free(&config->screencast_conf.exec_before);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/core/config.c:27:9: error: ‘free’ called on pointer ‘config_7(D)’ with nonzero offset 24 [-Werror=free-nonheap-object]
   27 |         free(&config->screencast_conf.exec_after);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/core/config.c:28:9: error: ‘free’ called on pointer ‘config_7(D)’ with nonzero offset 32 [-Werror=free-nonheap-object]
   28 |         free(&config->screencast_conf.chooser_cmd);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```
2021-04-10 10:50:24 +02:00
columbarius
9d78b21695 screencast: add outputchooser with config option
Supports "dmenu" chooser type, which is called with a dmenu type list
piped to stdin, "simple" type, which recieves nothing on stdin and
default, which tries the hardcoded choosers.
Choosers are required to return the name of the choosen output as given
by the xdg-output protocol.

Thanks to piater for closing overlooked pipes.
Thanks to ericonr for suggestions regarding fork and pipes.
2021-04-02 15:07:38 +02:00
David96
4c2d8fc808 Add exec_before and exec_after
Adds an option to execute some program before and after screencast (e.g.
for disabling notifications during a cast)
2021-03-16 23:44:08 +01:00
Simon Ser
a18c298ad4 Don't use ~/.config when XDG_CONFIG_HOME is set
According to the spec, ~/.config is a fallback used when
XDG_CONFIG_HOME is unset. When the user has explicitly set
XDG_CONFIG_HOME, we shouldn't try to use the fallback.
2021-03-15 18:08:57 +01:00