Commit graph

175 commits

Author SHA1 Message Date
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
41d4ccfe44 xwayland: reintroduce XWayland workaround
This was temporarily removed when introducing proper view abstractions.
Now that we have the cg_xwayland_view struct, we reintroduce this
workaround in its proper place.

This also fixes the previous workaround, which checked whether a view
was *currently* mapped and not if it *has ever* been mapped.

See #18, #19 and 443d955dfd.
2019-01-31 14:47:11 +01:00
Jente Hidskes
7175100d0d view: reorder functions
It had gotten a bit messy. Now functions are grouped together (i.e.,
getters, queries, etc).
2019-01-31 14:47:11 +01:00
Jente Hidskes
64b971a665 view: add proper abstraction with interface 2019-01-31 14:47:11 +01:00
Jente Hidskes
24517922cc view: remove cg_ prefix 2019-01-31 14:47:11 +01:00
Jente Hidskes
f25460f365
xdg_shell/xwayland: include respective header 2019-01-25 20:34:11 +01:00
Jente Hidskes
e9139f08e3
xdg_shell/xwayland: unlink listeners on destroy 2019-01-25 16:27:51 +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
7379226bbe
seat: remove unused surface_commit listener 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
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
443d955dfd view: test whether XWayland surfaces have been mapped
This is to work around "misbehaving" (for lack of a better term)
clients. At the moment, Firefox Nightly and Google Chrome/Chromium are
known to be suchs client:

When XWayland support is enabled, Firefox first creates an XWayland
surface, closes this (before mapping it) and then opens an XDG toplevel
surface. Cage tries to manage the first XWayland surface, but when it
closes, Cage has no surfaces left and hence closes as well.

Hence, Cage terminates before it picks up on Firefox's XDG toplevel, and
Firefox (rightly) prints it cannot read the Wayland pipe.

In Chromium's case, it simply opens an XWayland surface which it
immediately closes, before opening the "real" XWayland surface.

The workaround is to track whether an XWayland surface has been mapped
and, if it hasn't, to not exit when we have no views left.

Firefox's behavior and the workaround are discussed in #18.

This commit fixes #18 and is part of the fix for #19.
2019-01-19 19:43:24 +01:00
Jente Hidskes
a324d22dfe
meson: check WLR_HAS_XWAYLAND when building with XWayland 2019-01-19 19:21:13 +01:00
Jente Hidskes
a8e15442ab
xdg_shell/xwayland: do not check parent for other view types
An xdg-shell surface can never be a parent of an xwayland surface and
vice-versa.
2019-01-18 17:37:40 +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
7f7d8ac33e
README: credit rootston as well 2019-01-18 10:19:54 +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
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
b0bd4e680d view: add view_has_children to query if a view has children
This allows us to check per-view whether is has dialogs open, instead of
diong it on a global basis as we are doing currently. This is necessary
for fully supporting multiple primary clients.
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
2c51cd62b6
view_center: remove cg_server 2019-01-10 15:57:53 +01:00
Jente Hidskes
29009ddd77
view: hide maximize and center functions
This is now handled in view_position.
2019-01-10 15:57:25 +01:00
Jente Hidskes
a4a3a4954a
output: handle size changes
Fixes #23.
2019-01-10 15:50:31 +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
905199a1a8
view.h: conditionally include xwayland.h 2019-01-04 20:23:33 +01:00
Jente Hidskes
eaa71b7af4
Use correct CG_ namespace in headers 2019-01-04 20:23:01 +01:00
Jente Hidskes
691847ca12
Add XWayland note to README 2019-01-04 18:49:48 +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
c848bafaed
view_destroy: focus the previous view when closing the current
Fixes #4.
2019-01-04 17:26:26 +01:00
Jente Hidskes
3ef0fc3867
view_destroy: unmap surface if it isn't yet
Otherwise, we're left with an invalid link in the view list.
2019-01-04 17:25:07 +01:00
Jente Hidskes
2b8ee61d8b
Merge pull request #16 from Hjdskes/touch
Add touch input
2019-01-04 16:22:15 +01:00
Jente Hidskes
ce755c8591
Add touch input
Fixes #1
2019-01-04 15:55:13 +01:00
Jente Hidskes
f47a76c9be
xdg_shell: only track toplevel xdg surfaces
We don't need to manage popups, but in
786e28bdac we ended up doing so. This
reverts Cage's behavior.
2019-01-04 13:41:25 +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
7077f9ba1c
seat: move desktop_view_at comment 2019-01-03 22:30:55 +01:00
Jente Hidskes
183e509dd9
s/ifdef/if/g
ifdef gives us some troubles with the thing being set to 0 but still be
defined, so let's just use if.
2019-01-03 22:30:34 +01:00
Jente Hidskes
81761cae96
Cage: fix possibly uninitialized variable 2019-01-03 13:55:38 +01:00
Jente Hidskes
907bb78c92
Add missing config.h.in 2019-01-02 22:28:56 +01:00
Jente Hidskes
2847e0d54f
Seat: abstract away a view switch statement
We have our view abstraction, so why not use it?
2019-01-02 21:31:30 +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
Jente Hidskes
431320443a
seat: reverse conditional for early-exit of set_focus 2019-01-02 21:13:18 +01:00
Jente Hidskes
3e10b1f7eb
README: document XWayland compile-time option 2019-01-02 21:13:00 +01:00
Jente Hidskes
9a4afdb025
Make the README for development only
For users, we have Cage's project page at
https://hjdskes.nl/projects/cage.
2019-01-02 21:06:56 +01:00