Commit graph

55 commits

Author SHA1 Message Date
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
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
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
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
Jente Hidskes
6cbc202662 Apply clang-format 2020-02-18 21:20:23 +01:00
Jente Hidskes
8a6d16391f
output: include seat.h 2020-02-03 21:23:39 +01:00
Damon
e3be8159b3
output: wrap xwayland.h include in CAGE_HAS_XWAYLAND (#120)
* move xwayland.h include to ifdef block for X11

* use correct ifdef CAGE_HAS_XWAYLAND
2020-02-03 21:14:29 +01:00
Jente Hidskes
b04e02cd60 output: add support for direct scan-out
Fixes #88.
2020-02-01 23:24:49 +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
12aa43abba output: initialise wlr_output before positioning views 2020-01-11 17:07:33 +01:00
Jente Hidskes
2f9442906d output: refactor get_surface_box
The function also did an intersection check, so it did more than just
getting the surface box. This refactoring makes it more clear.

This commit also fixes a bug in coordinate spaces that makes dialogs
render properly over multiple outputs.
2020-01-11 17:07:33 +01:00
Jente Hidskes
23f8d609ce output: check whether outputs are enabled 2020-01-11 17:07:33 +01:00
Jente Hidskes
a53dca91ce Render popups separately from their toplevel view when possible 2020-01-11 17:07:33 +01:00
Jente Hidskes
2db815aa23 Refactor surface damaging and rendering code
This is based on code from Sway, which is also MIT licensed hence
compatible. This makes the surface damaging and rendering code easier to
follow and makes it easier to import future changes to Sway as well.
2020-01-11 17:07:33 +01:00
Tristan Daniel
84216ca2a4 output: call wlr_output_rollback if not rendering
Required by wlroots 0.9.0.
2020-01-10 19:33:30 +01:00
Tristan Daniel
51e6c760da Update new output handler for wlroots 0.9.0
Following breaking changes in wlroots 0.9.0, wlr_output_commit must be
called after wlr_output_set_mode, wlr_output_set_transform and wlr_output_enable.
Additionally, wlr_output_enable is no longer implicitly called by
wlr_output_set_mode.

Fixes #102
2020-01-06 11:49:57 +01:00
Jente Hidskes
8f6ffa1419
Use hard tabs 2020-01-05 13:42:17 +01:00
Jente Hidskes
651d579c30
seat: be explicit about output- and layout coordinates
This commit follows up on 95b7782c72
2020-01-05 13:16:01 +01:00
Jente Hidskes
95b7782c72
Be explicit about output- and layout coordinates 2019-12-29 16:07:14 +01:00
Jente Hidskes
22adaae715
output: log error when failing to allocate output 2019-12-26 17:25:22 +01:00
Kenny Levinsen
edfe4e07ce Avoid excessive log messages with multiple outputs 2019-12-26 17:14:57 +01:00
Kenny Levinsen
739ba1fe65 Check calloc return value 2019-12-26 17:14:57 +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
Ruben Vandamme
0fb513fb85 Set startup color to black. 2019-08-27 18:14:57 +02:00
Jente Hidskes
b16fc7d780
output: use the output's preferred mode
On outputs that have modes, we need to set one before we can use it.  We
pick the preferred mode, or if this is not advertised, the last listed
mode. This mode is generally the mode with the highest resolution.

Fixes #10
2019-05-03 21:14:51 +02:00
Jente Hidskes
5af455a905
output: fix damage tracking debug mode
We want to damage the whole output in this mode. However if we overwrite
the damaged region after it's useless.

See
8b1220f5a3 (diff-95fe5e5b411cc64a5dc31e2b72669a0d)
2019-05-03 21:07:40 +02:00
Jente Hidskes
f23257d170 output: don't submit too much damage
See https://github.com/swaywm/wlroots/issues/1666#issue-436967396 and
the linked changes
https://github.com/swaywm/wlroots/pull/1668/files#diff-95fe5e5b411cc64a5dc31e2b72669a0d
2019-05-03 21:03:09 +02:00
Drew DeVault
9354781f32 Update to wlroots 0.6.0 2019-05-03 21:03:09 +02:00
Jente Hidskes
cf06e42687 CI: add a FreeBSD build on Sourcehut 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
1ef3843839 Wrap x11 backend features in wlroots' feature flag
Fixes #46
2019-02-23 23:05:54 +01:00
Jente Hidskes
9d825d6dc7
Move set_window_title to output 2019-02-16 00:56:09 +01:00
Jente Hidskes
5a1da1baee output: optimize when drawing whole surface 2019-02-16 00:35:17 +01:00
Jente Hidskes
1308c0ffc3 view: add function to damage whole view 2019-02-16 00:35:17 +01:00
Jente Hidskes
667667505a Put damage tracking debugging behind a flag 2019-02-16 00:35:17 +01:00
Jente Hidskes
e981cb8a1c Implement damage tracking
Fixes #5.
2019-02-16 00:35:17 +01:00
Jente Hidskes
7de253386c output: do not render an overlay for now
There are better ways to do this (i.e., custom shaders). We will get
back to this later.
2019-01-31 14:47:11 +01:00
Jente Hidskes
2387bce647
output: remove mode link on destroy 2019-01-25 16:25:40 +01:00
Jente Hidskes
8db6b82c59
Suppport output transforms 2019-01-25 16:25:39 +01:00
Jente Hidskes
8cb1e5c4ef
output: don't draw multiple overlays 2019-01-25 16:18:05 +01:00
Jente Hidskes
14aadbca1b
Output: render software cursors
As mentioned, this is a no-op when there hardware cursors are supported.

Fixes #14.
2019-01-17 11:04:14 +01:00
Jente Hidskes
b6024e982f Fully support multiple primary clients
This is the path we settled on in #24.

That is: any new toplevel window takes over the Cage display, hiding any
previous toplevels until it is closed. Only when the last toplevel is
closed, does Cage exit as well.
2019-01-12 19:27:24 +01:00
Jente Hidskes
112a662ebc Implement support for drag 'n drop icons
Fixes #8.
2019-01-11 15:28:09 +01:00
Jente Hidskes
1f85e1061b render_data: take x,y instead of cg_view
This enables us to render surfaces other than views. See the next
commit.
2019-01-11 15:28:09 +01:00
Jente Hidskes
a4a3a4954a
output: handle size changes
Fixes #23.
2019-01-10 15:50:31 +01:00
Jente Hidskes
8faf7a2f59
output: render an overlay when dialogs are open
Fixes #6.
2019-01-04 18:33:59 +01:00
Jente Hidskes
5f60b0a00c
output: remove xwayland include
We don't need it in this file.
2019-01-03 22:31:13 +01:00
Jente Hidskes
9a99ba604f
Output: abstract away a view switch statement
We have our view abstraction, so why not use it?
2019-01-02 21:23:16 +01:00