Commit graph

241 commits

Author SHA1 Message Date
Simon Ser
395189fb05 Upgrade to wlroots 0.15
- Update wlr_box includes to util/box.h: the wlroots header has
  been moved upstream.
- Subsurface fields have been moved
- Create renderer and allocator, stop using wlr_backend_get_renderer
- Initalize output rendering
2021-12-21 21:53:28 +01:00
Jente Hidskes
388d60d6b8 Tune compiler options 2021-12-19 11:12:19 +01:00
Jente Hidskes
8385b62a9b Move to GitHub actions 2021-12-19 11:12:19 +01:00
Palanix
d1367b1c46 removed focus_changed logic 2021-09-06 16:09:14 +02:00
Palanix
0ba1c40aa6 fix drag 2021-09-06 16:09:14 +02:00
Lorenz Brun
60492959a7 Set xdg_toplevel geometry for fullscreen clients 2021-09-06 15:46:09 +02:00
Simon Ser
b21f9c6322 Fix count_surface_iterator
This increments the pointer value, not the actual count.

References: https://github.com/Hjdskes/cage/issues/176
2021-08-11 12:54:49 +02:00
Simon Ser
1a3ab3eb3a build: allow using subproject for wlroots
This is handy when testing cage with a newer wlroots copy, or
when developing cage and wlroots patches in parallel.
2021-08-09 20:54:11 +02:00
Simon Ser
5424a35aba Damage drag icon when destroyed
This fixes the drag icon not disappearing when releasing the
pointer button.

Reproduction steps:

- Open gedit
- Drag some text around
- Release the pointer button
2021-08-09 20:53:24 +02:00
Simon Ser
cdb1cdf3b4 Don't manually parse XKB_* env vars
libxkbcommon will do it for us if we provide a NULL struct
xkb_rule_names.
2021-08-09 20:52:51 +02:00
Jente Hidskes
646b3e80b4 Update version to 0.1.4 2021-06-26 09:39:40 +02:00
Jan Beich
08e58c2b45 CI: bump wlroots version to 0.14.0 2021-06-26 09:25:36 +02:00
Jan Beich
636185bf9c meson: require wlroots 0.14.0 after 9a4523d47e
view.c:238:52: error: no member named 'subsurfaces_below' in 'struct wlr_surface'
        wl_list_for_each (subsurface, &view->wlr_surface->subsurfaces_below, parent_link) {
                                       ~~~~~~~~~~~~~~~~~  ^
/usr/include/wayland-util.h:443:30: note: expanded from macro 'wl_list_for_each'
        for (pos = wl_container_of((head)->next, pos, member);  \
                                    ^~~~
/usr/include/wayland-util.h:409:32: note: expanded from macro 'wl_container_of'
        (__typeof__(sample))((char *)(ptr) -                            \
                                      ^~~
2021-06-26 09:25:36 +02:00
Jan Beich
851268bedc view: chase swaywm/wlroots@9e58301df7
view.c:238:52: error: no member named 'subsurfaces' in 'struct wlr_surface'
        wl_list_for_each (subsurface, &view->wlr_surface->subsurfaces, parent_link) {
                                       ~~~~~~~~~~~~~~~~~  ^
/usr/include/wayland-util.h:443:30: note: expanded from macro 'wl_list_for_each'
        for (pos = wl_container_of((head)->next, pos, member);  \
                                    ^~~~
/usr/include/wayland-util.h:409:32: note: expanded from macro 'wl_container_of'
        (__typeof__(sample))((char *)(ptr) -                            \
                                      ^~~

Based on 3162766eef
2021-06-26 09:25:36 +02:00
Jente Hidskes
efaf76e9ab Include release scripts 2021-04-16 14:34:57 +02:00
Jente Hidskes
aa91af32a5 Update version to 0.1.3 2021-04-16 14:01:38 +02:00
Jan Beich
0891f4b814 CI: bump wlroots version to 0.13.0 2021-04-09 19:33:14 +02:00
Jan Beich
b07647fb78 CI: explicitly depend on Mesa on Arch Linux
meson.build:102:0: ERROR: Dependency "egl" not found, tried pkgconfig
2021-04-09 19:33:14 +02:00
Jan Beich
40fc92f7e7 CI: chase swaywm/wlroots@de5347d0f2
Run-time dependency xcb-icccm found: NO (tried pkgconfig and cmake)
Message: Required for Xwayland support.
2021-04-09 19:33:14 +02:00
Jan Beich
cb93785649 CI: chase swaywm/wlroots@3504bb587d + swaywm/wlroots@e8ad05913f
meson.build:70:4: ERROR: Problem encountered: Cannot build Cage with XWayland support: wlroots has been built without it
2021-04-09 19:33:14 +02:00
Jan Beich
eb18383e8e meson: require wlroots 0.13.0 after 0db62672a4
cage.c:307:59: error: too few arguments to function call, expected 2, have 1
        server.backend = wlr_backend_autocreate(server.wl_display);
                         ~~~~~~~~~~~~~~~~~~~~~~                  ^
subprojects/wlroots/include/wlr/backend.h:43:21: note: 'wlr_backend_autocreate' declared here
struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
                    ^
2021-04-09 19:33:14 +02:00
Jan Beich
a5aa497ff1 output: chase swaywm/wlroots@cc56b4f073
output.c:456:36: error: no member named 'transform' in 'struct wlr_output::(anonymous at /usr/local/include/wlr/types/wlr_output.h:154:2)'
        wl_signal_add(&wlr_output->events.transform, &output->transform);
                       ~~~~~~~~~~~~~~~~~~ ^

Based on 2c76923282
2021-04-09 19:33:14 +02:00
Jan Beich
82bad3f0fc xdg_shell: chase swaywm/wlroots@07111828c5
xdg_shell.c:230:2: warning: implicit declaration of function 'wlr_xdg_surface_for_each_popup' is invalid in C99 [-Wimplicit-function-declaration]
        wlr_xdg_surface_for_each_popup(xdg_shell_view->xdg_surface, iterator, data);
        ^
ld: error: undefined symbol: wlr_xdg_surface_for_each_popup
>>> referenced by xdg_shell.c:230 (../xdg_shell.c:230)
>>>               cage.p/xdg_shell.c.o:(for_each_popup)

Based on 5438cc158a
2021-04-09 19:33:14 +02:00
Jan Beich
90da4ee4dc cage: chase swaywm/wlroots@4b03bdc3ab
cage.c:307:61: error: too many arguments to function call, expected single argument 'display', have 2 arguments
        server.backend = wlr_backend_autocreate(server.wl_display, NULL);
                         ~~~~~~~~~~~~~~~~~~~~~~                    ^~~~
/usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
 #define NULL    ((void *)0)
                 ^~~~~~~~~~~
/usr/local/include/wlr/backend.h:36:21: note: 'wlr_backend_autocreate' declared here
struct wlr_backend *wlr_backend_autocreate(struct wl_display *display);
                    ^

Based on 53f5197c26
2021-04-09 19:33:14 +02:00
Jan Beich
e6762725ed seat: chase swaywm/wlroots@e06c9e43af
seat.c:453:58: error: incomplete definition of type 'struct wlr_event_touch_down'
        wlr_cursor_absolute_to_layout_coords(seat->cursor, event->device, event->x, event->y, &lx, &ly);
                                                           ~~~~~^
seat.c:450:9: note: forward declaration of 'struct wlr_event_touch_down'
        struct wlr_event_touch_down *event = data;
               ^

Based on a56098a24e
2021-04-09 19:33:14 +02:00
Jan Beich
4a01da76f1 seat: chase swaywm/wlroots@7693f61d81
seat.c:263:56: error: use of undeclared identifier 'WLR_KEY_PRESSED'
        if ((modifiers & WLR_MODIFIER_ALT) && event->state == WLR_KEY_PRESSED) {
                                                              ^

Based on bb342ac5e6
2021-04-09 19:33:14 +02:00
Michael Weiss
0d85c1652e meson.build: Unify the indentation (replace all tabs) 2020-08-02 17:43:05 +02:00
Michael Weiss
7d37322906 seat.c: Make clangformat happy and simplify the control flow
This restores the original behaviour from 2cf40f7, is easier to read,
and satisfies clangformat.
This also doesn't call wlr_idle_notify_activity anymore, which was
probably unintended.
2020-08-02 17:43:05 +02:00
Jente Hidskes
d097393732
man: indent with tabs 2020-07-16 16:25:19 +02:00
Jente Hidskes
7b861bf175
Release Cage 0.1.2 2020-07-16 15:41:38 +02:00
Jente Hidskes
1037adbab7
man: document -s and fix some typos 2020-07-16 15:41:38 +02:00
Jan Beich
efb1121769 CI: bump wlroots version to 0.11.0 2020-07-16 15:25:11 +02:00
Jan Beich
99aba6b89b meson: require wlroots 0.11.0 after 6a12da1960
../output.c:235:57: error: no member named 'base' in 'struct wlr_buffer'
        wlr_output_attach_buffer(wlr_output, &surface->buffer->base);
                                              ~~~~~~~~~~~~~~~  ^
2020-07-16 15:25:11 +02:00
Jente Hidskes
0d694db6fe Invert wlr_xcursor_manager_load return value 2020-07-16 15:25:11 +02:00
Jan Beich
a6b1cf1d69 output: unbreak with wlroots 0.11.0
Port changes changes from
9d0aa0cb83
40e87fa98a
2020-07-16 15:25:11 +02:00
Jan Tatje
79992f39f3 Add option to allow changing VT
Code that does the VT switch taken from sway.
2020-07-16 14:46:28 +02:00
Jente Hidskes
bd961db6f5 cage: allow setting output mode 2020-06-26 20:56:11 +02:00
Jente Hidskes
72f6c0bae3 output: implement CAGE_MULTI_OUTPUT_MODE_LAST
In this mode, only the last connected output will be used. If that one
is unplugged, the previously last connected output will be enabled. This
for example allows one to switch between two outputs, e.g. on a handheld
device such as a mobile phone.
2020-06-26 20:56:11 +02:00
Jente Hidskes
64299054db output: add output_mode enum
This enum provides two means of behaviour for multi-output setups:
extend the display across all outputs, or only use the last one. The
former is the current (and default) behaviour; the latter will be added
in the next commit.
2020-06-26 20:56:11 +02:00
Jente Hidskes
f4b63cd6b8 output: add enable and disable functions
These will allow different patterns of multimonitor behaviour. In a
followup commit, we will introduce a behaviour where only the last
connected output is in use.
2020-06-26 20:56:11 +02:00
travankor
4e96d913fb
Add man page. (#141)
* Add man page.

* CI: add scdoc
2020-05-31 15:14:18 +02:00
travankor
6eb693c05b
Cage: drop gid before uid (#142)
If setuid is called first then the target user may not have the ability to
setgid. See https://wiki.sei.cmu.edu/confluence/display/c/POS36-C.+Observe+correct+revocation+order+while+relinquishing+privileges
2020-04-17 21:58:26 +02:00
Matthew Bauer
5d7ff9e64d
Don’t terminate display when no view is found (#132)
* Don’t terminate display when no view is found

Some apps like RetroArch will quit and fork itself to switch
modes (like from the menu to a loaded core). This means that for a
very short period of time we have no view available for Wayland. Right
now, Cage doesn’t actually exit when it does this terminate, so you
get this kind of zombie child process that is running but not showing
anything on the screen because there is no compositor.

The solution I have here is to just keep Cage’s Wayland server running
to avoid this issue. I’m open to other idea, but this seems sane to
me. Perhaps an alternative is to check if the process is still alive
when this happens, if not then we can do the quitting behavior. In
addition, we could make this an option if some users don’t want this
behavior.

* Remove "ever_been_mapped" from cg_wayland_view
2020-03-16 20:32:24 +01:00
Jente Hidskes
fc5564645e
seat: remove signals earlier in seat destroy handler (#130)
This fixes a bunch of invalid writes found with valgrind.
2020-02-27 20:39:15 +01:00
Jente Hidskes
9886efa112
seat: log around input device mapping (#128)
This should make it easier to troubleshoot why, for example, a touch
input device isn't mapped to a touch output device. See #126.
2020-02-23 16:00:57 +01:00
Jente Hidskes
27391f174a
Cage: check for sigchld_source being NULL before removing it
If something goes wrong during startup (i.e., the wlroots backend cannot
be created), we jump to the end. This then unconditionally removes the
sigchld_source, but that hasn't been set at this point yet.
2020-02-22 00:23:03 +01:00
project-repo
e96fccfa54
Implement support for wlr_keyboard_group (#123)
* Implement support for wlr_keyboard_group

* Cast pointers to void type when passing to wlr_log

* Fix bracket style

* Improve style

* Remove unnecessary function

* Prefer defined variable for brevity

* Remove unnecessary pointer printing

* Ameliorate style

* Remove duplicate functionality

* Set group repeat info

* Ameliorate style

* Fix bug introduced through renaming

* Ameliorate style in seat.h

* Remove cg_keyboard in favour of cg_keyboard_group

* Remove unused signalling

* Apply clang-format

* Fix ordering of commands

* Remove unnecessary field in cg_keyboard_group
2020-02-21 21:19:12 +01:00
Jente Hidskes
b2bcf06eee CI: add tasks that build without XWayland 2020-02-18 21:20:23 +01:00
Jente Hidskes
1e3417cd65 CI: add clang-format task 2020-02-18 21:20:23 +01:00
Jente Hidskes
6d0714bfa3 Begrudgingly format wl_list_* macros with a space before parameter list
I can't seem to configure clang-format to remove this space...
2020-02-18 21:20:23 +01:00