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,
^
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
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
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
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
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.
../output.c:235:57: error: no member named 'base' in 'struct wlr_buffer'
wlr_output_attach_buffer(wlr_output, &surface->buffer->base);
~~~~~~~~~~~~~~~ ^
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.
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.
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.
* 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
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.
* 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
This adds a first iteration of a clang-format style definition. It
formats the current code such that it aligns (mostly..) with the style
I prefer, but it is most likely incomplete and there will be corner
cases.
Fixes#124.
Previously, is git was found but the build was run from a snapshot,
`version` wouldn't be set. This commit fixes this by first setting
version to the project version and only then, conditionally, setting it
to the git version.
Fixes#125.
With the new CLOEXEC setting, spawning the primary client
can fail *after* forking. In this case, the client process
has been forked and will need to be cleaned up.
In case something fails before pid has been set, it's set to 0.
From waitpid(2):
The value of pid can be:
0 meaning wait for any child process whose process group ID
is equal to that of the calling process at the time of the
call to waitpid().
That will be none in this case, and hence this won't block and is thus
safe.
As mentioned by @emersion:
By default, pipe creates FDs without the CLOEXEC flag set, which means
they will be leaked to any other child process spawned. Would be nice to
set the CLOEXEC flag to prevent the leak.
wl_display will destroy the outputs, whose destroy handler will remove
them from the output layout. But by that point, the output layout has
already been destroyed.
According to the Wayland docs:
If the event source is registered for re-check with
wl_event_source_check(): 0 for all done, 1 for needing a re-check. If
not registered, the return value is ignored and should be zero.
See e.g. http://manpages.ubuntu.com/manpages/cosmic/man3/wl_event_source.3.html
Since we don't register any of these for re-checking, we should
return 0.
This prevents a segfault when shutting down during startup, when a
client is passed that doesn't spawn a window.
It also brings us one step closer to not having to have a pointer to the
backend in cg_server.