Commit graph

58 commits

Author SHA1 Message Date
Jente Hidskes
15eeb7784e cage: add -v argument to print version 2020-01-26 18:18:49 +01:00
Jente Hidskes
a63c75c849 Cage: check if XDG_RUNTIME_DIR is set
Wayland requires this environment variable to be set, see
https://manpages.debian.org/experimental/libwayland-doc/wl_display_connect.3.en.html
2020-01-25 23:30:28 +01:00
Jente Hidskes
cc1f975c44
cage: center cursor only on initial startup
With Cage now supporting hotplugging of outputs, we shouldn't warp the
cursor to the center of every new output. Rather, we should warp it only
on the initial startup.
2020-01-18 11:57:16 +01:00
Jente Hidskes
8f6ffa1419
Use hard tabs 2020-01-05 13:42:17 +01:00
Kenny Levinsen
06ada15661 Support multiple outputs
Outputs are arranged in a horizontal layout in the order they are
created in by wlroots. Maximized xdg_shell views will span all outputs,
like the global fullscreen mode in sway.

Fixes #87
2019-12-26 17:14:57 +01:00
Jente Hidskes
0aeba8085c
Replace all wayland-server.h includes with wayland-server-core.h
The documentation for `wayland-server.h` says:

> Use of this header file is discouraged. Prefer including
> wayland-server-core.h instead, which does not include the server protocol
> header and as such only defines the library PI, excluding the deprecated API
> below.

See also
ca45f4490c (diff-b57e10fe0774258a6d21b22077001cff)
2019-12-20 17:16:53 +01:00
Jente Hidskes
7c6d6c75ae Implement wlr_export_dmabuf_unstable_v1 2019-12-20 17:02:16 +01:00
Jente Hidskes
dd87c1fab5 Rename data_device_mgr to _manager 2019-12-20 12:35:41 +01:00
Jente Hidskes
65177466e7 Implement wlr-gamma-control-unstable-v1
Closes #20
2019-12-20 12:35:41 +01:00
Derek Wallace
33bb3c818c Removed destructors per wlroots PR 1915 2019-12-18 21:30:29 +01:00
Andri Yngvason
c13ada98de Add xdg output manager 2019-08-25 18:14:01 +02:00
Andri Yngvason
da6b6c208e Add screencopy 2019-08-25 18:14:01 +02:00
Jan Beich
61894994f3
Cage: drop root on startup like Sway
wlroots may need setuid to run on DRM if built without (e)logind
support.
2019-05-01 13:38:19 +02:00
Jente Hidskes
90498e85d5 Cage: print the correct variable 2019-04-22 18:43:19 +02:00
Tristan Daniel
9e6a5ad44f Cage: implement output transform
This commit adds the command line switch -r, which rotates the output 90
degrees clockwise and can be specified up to three times.
2019-04-14 08:31:33 +02:00
Jente Hidskes
69872baead
Cage: encapsulate debug specific behavior 2019-03-23 20:18:37 +01:00
Jente Hidskes
78fc6fbe0d
Cage: fix previous commit 2019-03-23 20:18:13 +01:00
Jente Hidskes
d855ea6718
Cage: update for wlroots 0.5.0 2019-03-23 16:42:31 +01:00
Jente Hidskes
848929c88c
Cage: exit when there is no application passed
This regression was introduced in 667667505a
due to wrongfully handling optind.
2019-02-26 18:56:23 +01:00
Jente Hidskes
b758e421cb Cage: bail when there is no xdg decoration manager 2019-02-24 00:29:22 +01:00
Jente Hidskes
cd0c51814f Cage: implement server-decoration protocol
GTK still uses the (now deprecated) server-decoration protocol, which is
the predecessor to xdg-decoration. Hence, with this commit Cage now also
hides decorations on applications such as Firefox.

Fixes #47, see also
https://github.com/Hjdskes/cage/pull/45#issuecomment-466402865.
2019-02-24 00:29:22 +01:00
Jente Hidskes
1c5cbe6de0
Cage: don't destroy wlr_backend manually
The backend gets destroyed automatically when the wl_display is
destroyed, so we're getting a use-after-free when we do this ourselves
again.

Fixes #44
2019-02-23 19:49:01 +01:00
Jente Hidskes
65f7107078
cage: fix signal handler event source memory leaks 2019-02-21 11:38:30 +01:00
Jente Hidskes
2166fbdcfb Implement xdg-decoration
This commit adds a commandline switch (-d) to disable client side
decorations, if possible. In this case, Cage will not draw any
decorations of its own, in order to maximize screen real estate.

The default behavior remains the same, i.e., if -d is not passed,
clients will draw their client side decorations, if any.

Fixes #32
2019-02-21 09:14:59 +01:00
Jente Hidskes
996f641cf0
Cage: reset signal mask after forking
Cage uses wl_event_loop_add_signal to handle SIGINT and SIGTERM, which
masks these signals. This means that the subprocess spawned by Cage
start with these signals masked, which can lead to delays in Cage
shutting down on e.g. ^C. Hence, we now unmask all signals between fork
and exec.

Fixes #40
2019-02-17 21:14:31 +01:00
Jente Hidskes
9d825d6dc7
Move set_window_title to output 2019-02-16 00:56:09 +01:00
Jente Hidskes
667667505a Put damage tracking debugging behind a flag 2019-02-16 00:35:17 +01:00
Jente Hidskes
f0eb115bda
seat: remove cg_ prefix from cg_seat_destroy 2019-02-02 17:13:10 +01:00
Jente Hidskes
fd5175cbf8 seat: remove cg_ prefix 2019-01-31 14:47:11 +01:00
Jente Hidskes
6ebc684ee6
cage: free window title 2019-01-25 09:02:38 +01:00
Jente Hidskes
c00ac5c462 Set Cage's window title to toplevel's title
When using the Wayland or X11 backend, Cage is drawn inside a window.
This commit sets this window's title to that of the currently focused
toplevel window inside Cage.

Fixes #29.
2019-01-24 16:15:03 +01:00
Jente Hidskes
5deb7776fc
Cage: destroy XWayland before clients
This is the order in which it should be done.
2019-01-18 13:29:30 +01:00
Jente Hidskes
9b797fb98e
Cage: move xwayland check 2019-01-17 22:25:20 +01:00
Jente Hidskes
2c5b3c5ad0
Cage: add debug print for Wayland socket 2019-01-17 21:46:43 +01:00
Jente Hidskes
21c01c9ee0 Add idle inhibitor support
With this, some apps (e.g. mpv) can block the idle tracker from
kicking in. This way, the screen won't blank (or whatever you
configured) when the application doesn't want it to.
2019-01-09 20:05:09 +01:00
Jente Hidskes
bf58eadf50 Add idle tracking
Note that this does not do much without an idle manager "on the other
side". See, for example, swayidle: https://github.com/swaywm/sway/blob/master/swayidle/swayidle.1.scd

Fixes #7.
2019-01-09 20:05:09 +01:00
Jente Hidskes
96372c145f
cage.c: fix include order 2019-01-04 20:23:50 +01:00
Jente Hidskes
81761cae96
Cage: fix possibly uninitialized variable 2019-01-03 13:55:38 +01:00
Jente Hidskes
e721808c88
Update copyright to include 2019 2019-01-02 21:01:01 +01:00
Jente Hidskes
a34c726a1c
Add XWayland support
With Cage becoming more popular since its mention on Phoronix and
therefore getting more use-cases than just my own project, add XWayland
support. The refactoring of 2cf40f7 makes this much easier. Note that
this is a no-cost addition for those of us not using XWayland as it is a
compile-time option that needs to be explicitly enabled by adding
`-Dxwayland=true` to your meson command.
2019-01-02 20:58:48 +01:00
Jente Hidskes
2cf40f7a9b
Refactor cage into separate source files
This makes Cage much easier to maintain. Not only is it easier where to
look and to maintain a mental model of the code, there is also more
encapsulation, better abstractions and better extendability.
2018-12-31 00:12:33 +01:00
Jente Hidskes
e1525a20c8
Do not create a dmabuf global
In new enough wlroots versions, the renderer creates the dmabuf global
itself.

Fixes #11.
2018-12-28 15:32:07 +01:00
Jente Hidskes
f680ee02db
Fix possibly uninitialized variable warning 2018-12-25 20:29:24 +01:00
Jente Hidskes
4ea5cc6b32
Use Wayland's event loop for signals
Now we don't require a global variable.
2018-12-25 20:29:24 +01:00
Jente Hidskes
b22f4b465c
Improve child spawning 2018-12-25 20:29:24 +01:00
Jente Hidskes
96fd0e13bb
Add error handling 2018-12-25 20:29:24 +01:00
Jente Hidskes
3be28b5b6d
Remove unmap support
Since we do not ever minimize or otherwise unmap clients (except when
destroying them), we don't need to track mapped/unmapped state. The
destroy case is captured in checking whether the surface has a buffer
attached to it, before requesting its texture.
2018-12-25 20:29:24 +01:00
Jente Hidskes
11e71dbfb5
Make dialogs modal
That is, do not allow another view to get focus upon clicking a pointer
button.
2018-12-25 20:29:24 +01:00
Jente Hidskes
e68d76f403
Abstract fullscreen view away into a function 2018-12-25 20:29:23 +01:00
Jente Hidskes
0f3ce4a7d8
Remove renderer pointer from server struct 2018-12-25 20:29:23 +01:00