Commit Graph

786 Commits

Author SHA1 Message Date
novakane
2e7c1dbe6a config: make attach-mode global 2021-06-08 18:26:36 +00:00
novakane
75814eb876 view_stack: update tests for zig 0.8.0 2021-06-08 18:25:43 +00:00
Isaac Freund
68267a4cfe
river: don't extend timeout on transaction preemption
This avoids locking up the compositor if a client is unresponsive and
the user continuously initiates new transactions through their actions.
2021-06-08 15:18:45 +00:00
Isaac Freund
e90474657f
view: send activated/fullscreen configures immediately
The transaction system exists to coordinate size changes of all views
in a layout in order to achieve frame perfection. Since many clients
do not need to commit a new buffer in response to a activated state
change alone, this breaks things when such a configure event is tracked
by the transaction system. Instead, simply send activated and fullscreen
configures right away but still track this state in a double-buffered
way so that e.g. border color changes based on focus are frame-perfect.

This also fixes a related issue with the transaction system where views
that did not need to commit in response to our first configure were not
rendered until their next frame.
2021-06-08 06:00:15 +00:00
Isaac Freund
021fd8f376
code: remove now unnecessary zig fmt directives
zig fmt does what we want since zig 0.8.0
2021-06-08 03:20:56 +00:00
Isaac Freund
1bacaa5b43
view: get rid of notifyConfiguredOrApplyPending()
This function is only called in one place, just inline the code.
2021-06-08 02:56:19 +00:00
Isaac Freund
cef6d5a0be
render: fix damage tracking of drag icons 2021-06-07 18:34:54 +00:00
Isaac Freund
0e9dc089d1
render: track subsurfaces created before role assignment 2021-06-05 19:30:43 +00:00
Isaac Freund
c0a2286847
code: update to zig 0.8.0 2021-06-05 17:29:58 +00:00
Isaac Freund
ca4abd261f
xdg-toplevel: remove set_app_id listener 2021-05-31 15:46:39 +00:00
Isaac Freund
acaf192465
render: actually damage output on view opacity change 2021-05-31 15:21:42 +00:00
Isaac Freund
9ee788b65e
render: damage output on view opacity change 2021-05-31 01:00:49 +00:00
Isaac Freund
13f01bcb4b render: do basic yes/no damage tracking 2021-05-24 16:43:21 +02:00
Leon Henrik Plickat
6333e465d2 Allow changing output focus with pointer 2021-05-19 14:15:28 +02:00
Isaac Freund
c8b1017923
river: remove Seat.input_manager
This is no longer needed as server is global.
2021-05-13 15:13:17 +02:00
Isaac Freund
50cdcf3ee4
river: remove all stored *Root pointers
These are no longer needed as server is global.
2021-05-13 15:08:53 +02:00
Isaac Freund
3d031631c7
river: remove misc stored *Server pointers
These are no longer needed as server is now global.
2021-05-13 15:06:00 +02:00
Isaac Freund
ece465b7ed
river: remove InputManager.server
The server is now global so this is no longer needed.
2021-05-13 14:53:08 +02:00
Isaac Freund
ac27db236a
river: remove Output.root
The server is now global so this is no longer needed.
2021-05-13 14:35:36 +02:00
Isaac Freund
89e0d4c083
river: remove Root.server
The server is now global so this is no longer needed.
2021-05-13 14:26:27 +02:00
Isaac Freund
271b1563a8
river: make server a global variable 2021-05-13 14:25:34 +02:00
Isaac Freund
7ccb4794c9 river: always render floating views above layout views 2021-05-05 15:54:52 +02:00
Isaac Freund
0c8e718d95
cursor: handle popup subsurfaces properly
I added the required functions in wlroots 0.13.0, so use them.
2021-04-27 18:56:06 +02:00
Isaac Freund
e80b883a47 river-layout: update to v2
This implements the changes to the river-layout protocol proposed
in the previous commit removing river-options.
2021-04-27 00:10:20 +02:00
Isaac Freund
871fc7c8de river-options: remove protocol
This protocol involves far too much accidental complexity. The original
motivating use-case was to provide a convenient way to send arbitrary
data to layout clients at runtime in order to avoid layout clients
needing to implement their own IPC and do this over a side-channel.
Instead of implementing a quite complex but still rigid options protocol
and storing this state in the compositor, instead we will simply add
events to the layout protocol to support this use case.

Consider the status quo event sequence:

1. send get_option_handle request (riverctl)
2. roundtrip waiting for first event (riverctl)
3. send set_foo_value request (riverctl)
4. receive set_foo_value request (river)
5. send foo_value event to all current handles (river)
6. receive foo_value event (rivertile)
7. send parameters_changed request (rivertile)
8. receive parameters_changed request (river)
9. send layout_demand (river)

And compare with the event sequence after the proposed change:

1. send set_foo_value request (riverctl)
2. receive set_foo_value request (river)
3. send set_foo_value event (river)
4. send layout_demand (river)

This requires *much* less back and forth between the server and clients
and is clearly much simpler.
2021-04-27 00:10:20 +02:00
Isaac Freund
a6f908d7eb river: get rid of all server-created options
- Replace the layout option with new default-layout and output-layout
commands.
- Remove the ability to get/set the output title entirely.
2021-04-27 00:10:20 +02:00
novakne
84f5283889 pixman: update and fix PointerConstraint 2021-04-22 10:33:28 +02:00
Isaac Freund
d08032d685 river-options: rework, bump to v2
Options are now all global but may be overridden per-output. If an
output local value is requested but none has been set, the global value
is provided instead. This makes for much better ergonomics when
configuring layout related options in particular.
2021-04-20 18:27:03 +02:00
Isaac Freund
33fb7725c5 river: send SIGTERM to init command process group
Run the init command in a new process group and send SIGTERM to the
entire group on exit. Without doing this, only the sh invocation used
for the `sh -c` would receive SIGTERM.

This is particularly useful when starting a per-session server manager
as the init command.
2021-04-20 18:27:03 +02:00
Leon Henrik Plickat
f72656b72e river-layout: create and implement protocol
Replace the current layout mechanism based on passing args to a child
process and parsing it's stdout with a new wayland protocol. This much
more robust and allows for more featureful layout generators.

Co-authored-by: Isaac Freund <ifreund@ifreund.xyz>
2021-04-20 18:27:03 +02:00
novakne
df3e993013 river: fix to work with latest zig-pixman 2021-04-20 13:14:45 +02:00
Isaac Freund
9e3e92050e
river: update for wlroots 0.13.0 2021-04-08 00:21:17 +02:00
Isaac Freund
3c1f1df0c0
render: don't schedule new frame on output commit failure
This reverts commit c457b12cf3.

This attempted workaround seems to work fine if the output commit only
fails with EBUSY, but enters an infinite loop otherwise.
2021-03-28 13:55:22 +02:00
Qiu
c457b12cf3
render: schedule new frame on output commit failure
This seems to fix issues with rendering freezing described in
https://github.com/ifreund/river/issues/153.
2021-03-27 16:17:24 +01:00
Leon Henrik Plickat
e6f11fc5d2 Fix crash when layer surface dimensions or margins are unexpectedly large 2021-03-27 13:10:19 +01:00
Isaac Freund
27cac16ced
build: fix if wlroots x11 backend is disabled 2021-03-01 14:54:36 +01:00
Bonicgamer
26b0acddb7 river: pointer-constraints and relative-pointer 2021-02-22 14:47:31 +01:00
Isaac Freund
4beb39920a
river-control: fix various bugs
It kinda shows that this was the first protocol I ever implemented
server-side:

- Use client as well as ID for keys in the hashmap as IDs might
  (and will) be the same between clients.
- Clear saved args after running a command.
2021-02-19 19:58:44 +01:00
Isaac Freund
3d66cbd2d4
toplevel-management: send output enter on map 2021-02-17 22:01:45 +01:00
Leon Henrik Plickat
5887d54f04 Deny move/resize requests from tiled XdgToplevel Views 2021-02-17 14:42:23 +01:00
Marten Ringwelski
870f0b746e Implement pointer-gestures-unstable-v1 2021-02-15 18:18:18 +01:00
Isaac Freund
6470d8c776
command: silently ignore re-declaring a mode
This change is made in the interest of allowing users to simply re-run
their init script at runtime without errors. Making this an error
doesn't really gain us anything.
2021-02-14 18:13:15 +01:00
Isaac Freund
5c0be25142
command: allow map/map-pointer overwrite existing
The ergonomics of remapping keys are currently quite bad as unmap
must first be called for every mapping before defining a new one.
Any benefit that might be gained by the current strictness of map/
map-pointer is outweighed by this fact.

In a similar spirit, silently ignore unmapping a non-existent mapping.
2021-02-14 18:08:55 +01:00
Isaac Freund
fb7d50a019
xdg shell: use XdgSurface.getGeometry()
This is important to use instead of direct access as clients are not
strictly required to set a geometry, in which caese the dimensions
of the wl_surface are used instead.
2021-02-14 16:55:24 +01:00
Alexey Yerin
945b7dc986 swap: use correct direction for it_wrap
Always using .forward results in a crash when running `swap previous` on
the first view in stack which should be wrapped.
2021-02-10 10:53:00 +01:00
foxfromabyss
98d51f6d24 Use std.log instead of log.zig 2021-02-08 18:35:11 +01:00
Isaac Freund
1834bd4bd0
river-options: fix setting null string options 2021-02-02 18:16:36 +01:00
Leon Henrik Plickat
7029a5cd3e
output: add output_title default option
Outputs now have a default option, "output_title". If this changes, the
outputs title is set to the option value. This title is currently only
relevant when run nested in a wayland/X11 session.

Co-authored-by: Isaac Freund <ifreund@ifreund.xyz>
2021-02-02 01:14:06 +01:00
Isaac Freund
5e09b853f7
xwayland: allow setting size if unmapped/floating
This effectively allows unmapped and floating xwayland views to set
their own dimensions, which seems to make some popups less broken.
2021-01-31 18:24:21 +01:00
Isaac Freund
cd005e15f8
river-options: free options of destroyed outputs
This is done when river's internal Output struct is destroyed, not when
the advertised wl_output global is removed. This means that options will
persist when an output is disabled and re-enabled.
2021-01-21 10:43:18 +01:00
Isaac Freund
8cbccbfb6e river-options: implement 2021-01-16 23:51:15 +01:00
Isaac Freund
a586c1ad71
code: remove unneeded c.zig @import()s 2021-01-12 10:28:11 +01:00
Isaac Freund
41e52065cc
cursor: ensure output focus before focusing layer 2021-01-08 22:27:52 +01:00
Isaac Freund
a029105f15 cursor: focus output before view on follow cursor 2021-01-08 10:58:08 +01:00
Isaac Freund
7249f5c9c3
xwayland: use layout coords for configures 2021-01-07 22:15:42 +01:00
Isaac Freund
11e1c4791f
XwaylandUnmanaged: remove dead code 2021-01-07 21:48:55 +01:00
Isaac Freund
e7442e53c1
XdgPopup: fix unconstrainFromBox coordinates 2021-01-07 21:22:11 +01:00
Isaac Freund
a672738603
render: iterate subsurfaces of popups manually
wlr_xdg_surface_for_each_popup() fails to do this and
wlr_xdg_surface_for_each_popup_surface() is not yet merged, so implement
a workaround for now.
2021-01-07 16:11:48 +01:00
Isaac Freund
b468f0aa85
cursor: fix down mode motion event coords
These are required to be surface local and we need to take the output's
layout coords into account as the cursor itself is in layout coords.
2021-01-07 11:19:22 +01:00
Isaac Freund
751b63f6fa
render: pass Output by constant pointer
This is semantically what we want as we store a pointer to the output in
the SurfaceRenderData struct.
2021-01-06 17:53:04 +01:00
Isaac Freund
b73cb7bb69
render: draw popups over borders 2021-01-05 20:05:35 +01:00
Marten Ringwelski
30ba87fa15
command: Implement spawn-tagmask 2021-01-02 11:39:09 +01:00
Alex Mohr
75588a553c build: derive default config path from install prefix
- Add `default_config_path` build option for the river executable
2021-01-01 23:23:44 +01:00
Isaac Freund
d2e2dad09c
view: fix build with xwayland disabled 2021-01-01 13:34:19 +01:00
Isaac Freund
a2ef687e51
view: fix handling of title/app_id change 2021-01-01 13:29:57 +01:00
Isaac Freund
4984944c60
Config: move opacity settings to sub struct 2020-12-31 15:52:03 +01:00
Isaac Freund
cc08be2dee
code: clean up listener initialization 2020-12-31 15:35:35 +01:00
Isaac Freund
ba9df86472
command: s/master/main/g (breaking change)
main is a better term to use here for several reasons:

1. It is more accurate: "master" implies that the designated views have
some kind of control over the other views, which is not the case. "main"
better expresses that the difference between the "main" view and others
is one of importance/focus.

2. It is a shorter word. 2 whole characters saved!

3. It reduces the chance of future development time being lost to
good-intentioned people complaining about usage of the word master as
has recently happened with regards to the default git branch name.
2020-12-30 18:15:47 +01:00
Isaac Freund
5f4ba06566
docs: improve explanation of tags
"tagmask" is a misleading term as the arguments are used much more like
a set of tags than a mask.
2020-12-30 14:25:37 +01:00
Isaac Freund
ac20f5aa1d
root: improve handling of 0 -> 1 output transition
Recover more gracefully from being hotplugged down to 0 outputs and then
gaining a new one. Move all views to the new output and restore the
focused output tags of the last output to be removed.
2020-12-30 13:19:40 +01:00
Isaac Freund
a098bbe03a
root: stop tracking xwayland views in transactions
Frame perfection for xwayland views would require too much complexity
to support and would bleed all over the codebase.
2020-12-29 20:38:30 +01:00
Isaac Freund
055fba5c3c
cursor: fix motion coords sent in down mode
We need to subtract the coords of the actual surface as they may not
alingn with the current box if using CSD.
2020-12-27 16:11:52 +01:00
Isaac Freund
4be1d59861
OutputManager: delete
Somehow I failed to do this in the previous commit.
2020-12-27 15:27:28 +01:00
Isaac Freund
3438c05332
root: merge in OutputManager
These two files were primarily dealing with the same things. Merging
them removes some indirection from the code and keeps things simpler.
2020-12-27 15:24:20 +01:00
Isaac Freund
c51f2176b3
view: unify clamped move logic, fix overflow 2020-12-27 01:06:18 +01:00
Isaac Freund
1732c69442
keyboard: set repeat_info to config values on creation 2020-12-26 19:17:24 +01:00
Isaac Freund
760c88b094
foreign-toplevel-management: basic implementation
We do no yet set the parent of toplevels. We also only honor activate
requests if the target view is already visible on the focused output.
2020-12-24 13:07:59 +01:00
Isaac Freund
386316bdbd
output: get rid of active field
The less state that needs to be maintained, the better
2020-12-21 16:19:44 +01:00
Isaac Freund
518fb96604
xwayland: handle hinted dimension < View.min_size
This avoids an assertion failure in std.math.clamp() when applying the
constraints.
2020-12-18 18:59:13 +01:00
Isaac Freund
6cf01f3624
OutputManager: get rid of output_config_pending 2020-12-14 16:25:16 +01:00
Isaac Freund
20d804cdb5 code: switch to custom wlroots/libwayland bindings
This is a big step up over @cImport() for ergonomics and type safety.
Nearly all void pointer casts have been eliminated!
2020-12-13 22:53:33 +01:00
Marten Ringwelski
b2b1a1f5e1 render: remove unnecessary call to wlr_output_effective_resolution 2020-12-12 16:35:33 +01:00
Isaac Freund
d099b167d2
config: free filter list items 2020-12-10 19:42:53 +01:00
Marten Ringwelski
49bf0e679f
focus-follow-cursor: Change output focus when needed 2020-12-07 13:51:06 +01:00
Marten Ringwelski
0fecdf60cb Ignore custom mode requests 2020-12-07 11:47:55 +01:00
Marten Ringwelski
c3b8986054 Implement wlr_output_management_unstable_v1 2020-12-07 11:47:55 +01:00
Marten Ringwelski
4b7246685f code: Fix render call width and height 2020-12-07 11:47:55 +01:00
Marten Ringwelski
157dccbbbb code: Add Root.all_outputs 2020-12-07 11:47:55 +01:00
Marten Ringwelski
10373da634 code: Add Root.removeOutput 2020-12-07 11:47:55 +01:00
Marten Ringwelski
fc549d6249 code: Refactor Root.addOutput 2020-12-07 11:47:55 +01:00
Marten Ringwelski
0dd8197f03 code: Introduce OutputManager 2020-12-07 11:47:55 +01:00
Isaac Freund
dae6c06e0c
screencopy: add workaround for wlroots bug
Currently screencopy's copy_with_damage request is broken for
compositors not submitting damage. As a workaround simply damage
the whole output each frame.
2020-12-05 01:10:06 +01:00
Isaac Freund
807d4a4212
keyboard: handle destruction 2020-11-29 21:05:27 +01:00
Isaac Freund
f1e5f1aacb style: fix zig fmt regression
CI works now so this shouldn't happen again
2020-11-21 11:53:37 +01:00
Marten Ringwelski
7d0014cd38 code: Set wlroots loglevel based on -l flag 2020-11-19 21:18:43 +01:00
Bonicgamer
cbd4a2807b
control: implement set-repeat 2020-11-18 15:28:33 +01:00
Leon Henrik Plickat
1626203c44 Add default config location 2020-11-18 15:15:22 +01:00
Isaac Freund
f80992e329
meta: make copyright headers more maintainable
- list all files as copyright "The River Developers"
- add an AUTHORS file to acknowledge contributors
2020-11-11 20:33:43 +01:00
Isaac Freund
77d3eb1bf0
layer-shell: render all popups over top layer
This means the popups belonging to e.g. a surface in the background
layer will be rendered over views.
2020-11-10 12:12:56 +01:00
Isaac Freund
a90ddd305b
code: use zig 0.7.0 and wlroots 0.12.0 2020-11-10 11:46:03 +01:00
Isaac Freund
2b24e55375
server: drop gtk-primary-selection support 2020-11-03 16:10:50 +01:00
Marten Ringwelski
d23b8a7f27 code: Move wlr_output_layout_add from Output.init to Root.addOutput 2020-11-02 14:08:00 +01:00
Marten Ringwelski
30b1675fe8 render: Print a log message when wlr_output_commit fails 2020-10-31 19:11:22 +01:00
Marten Ringwelski
d821f6b0dc Implement wlr-output-power-management-unstable-v1 protocol 2020-10-31 19:11:22 +01:00
Marten Ringwelski
773c5ff687
Implement virtual_keyboard_unstable_v1 protocol 2020-10-31 17:02:08 +01:00
Marten Ringwelski
76217970f5 Implement wlr_virtual_pointer_unstable_v1 protocol 2020-10-31 09:47:57 +01:00
Marten Ringwelski
1bd6f6bed1 code: Remove most of the hack around @cImport and flexible arrays 2020-10-30 15:23:52 +01:00
Marten Ringwelski
9a2e11620c Implement unmap-pointer 2020-10-27 00:32:20 +01:00
Marten Ringwelski
882a271d81 Implement unmap 2020-10-27 00:32:20 +01:00
Leon Henrik Plickat
5407325400 Add tests for ViewStack.swap() 2020-10-26 22:58:09 +01:00
Leon Henrik Plickat
ac1762567c Send zriver_seat_status_v1.focused_view when title of focused view changes 2020-10-25 17:28:13 +01:00
Marten Ringwelski
3f1b0dfaa9
control: implement swap 2020-10-25 12:41:19 +01:00
Marten Ringwelski
16c8752de2
code: Remove allocator argument from Mapping.init 2020-10-25 12:22:25 +01:00
Isaac Freund
e4a3698d86
view: update comments
These should have been moved in the previous commit
2020-10-22 19:24:01 +02:00
Bonicgamer
79dc9cc49a
xwayland: make behavior more like xdg toplevels
- float fixed size xwayland windows by default
- align configure handling with that of xdg toplevel views
2020-10-22 19:22:54 +02:00
Isaac Freund
e179690a9c
code: update os.waitpid usage for breaking change 2020-10-22 18:20:09 +02:00
Isaac Freund
3e4743e9a2
Revert "Remove checking translated keysyms"
This reverts commit 744e6b3052.

This broke VT switching and likely other keysyms which don't have
a "raw" equivalent.
2020-10-21 15:24:11 +02:00
Leon Henrik Plickat
03a2da9690 Introduce mode "locked"
This mode is automatically entered when the screen is locked.
2020-10-19 16:00:17 +02:00
Leon Henrik Plickat
744e6b3052 Remove checking translated keysyms
Raw keysyms are enough to handle all possible keybinds
2020-10-18 16:36:11 +02:00
Leon Henrik Plickat
4b4f7c464c Allow "None" as modifier string for bindings without modifiers
This is more userfriendly than the empty string approach.
2020-10-18 16:36:11 +02:00
Leon Henrik Plickat
ec5d5e8826 Move Cursor.Mode impl functions to Cursor 2020-10-17 23:42:37 +02:00
Leon Henrik Plickat
d5d1e87a95 Implement XDG-Toplevel move and resize request handlers 2020-10-17 23:42:37 +02:00
Leon Henrik Plickat
1e0ee3b146 Remove unused event parameter from Cursor.Mode.enter() 2020-10-17 23:42:37 +02:00
Leon Henrik Plickat
b6861bc80b Update view.float_box when setting a floating view to fullscreen 2020-10-17 21:23:13 +02:00
Leon Henrik Plickat
036f9a1cb9 Always set fullscreen views to fully opaque 2020-10-08 18:41:47 +02:00
Leon Henrik Plickat
d4ca5d7a88 introduce Output.getEffectiveResolution() 2020-10-07 21:03:59 +02:00
Leon Henrik Plickat
b2f13f5bcc Implement "move", "snap" and "resize" commands 2020-10-07 21:03:59 +02:00
Leon Henrik Plickat
6f9ecd4eda Create wlr_viewporter 2020-10-06 20:19:07 +02:00
Leon Henrik Plickat
1e58e8b7f8 Create wlr_export_dmabuf_manager_v1 2020-10-06 20:19:07 +02:00
Leon Henrik Plickat
18f5fcb1ef Implement primary selection 2020-10-06 17:46:05 +02:00
Leon Henrik Plickat
bb23464322 Send view tags when applying pending state in XdgToplevel.zig 2020-10-05 23:03:57 +02:00
Leon Henrik Plickat
b67ea748a3 Implement configurable view opacity with fade effect 2020-10-05 23:03:57 +02:00
Isaac Freund
27b666dbba
code: update to zig master in prep for 0.7.0
This commit makes the minimal necessary changes to get things working,
there are further changes which can be made to take advantage of new
features.
2020-10-02 20:34:24 +02:00
Isaac Freund
0bd8274bd4
server: support wlr-gamma-control 2020-09-30 12:59:00 +02:00
Isaac Freund
2b77be8c87
seat: start transaction on focus-output
This fixes a delay due to the missing startTransaction() call causing
unapplied pending state.
2020-09-30 11:16:27 +02:00
Isaac Freund
d783347476
layer-shell: default to focused output
Layer shell clients may leave the output on which to display a layer
surface up to the compositor. Instead of always putting such surfaces
on the first output use the focused output of the default seat.
2020-09-29 17:27:33 +02:00
Isaac Freund
3e955935eb
docs: use foot in the example config.sh 2020-09-28 22:57:22 +02:00
Isaac Freund
b3279b87cc
layer-shell: make invalid 0 dimension a hard error 2020-09-28 22:52:53 +02:00
Isaac Freund
e019b9de47
view: always set fullscreen x/y to 0,0
This position is output relative not layout relative.
2020-09-28 16:28:47 +02:00
Marten Ringwelski
52cd871151 Implement map -release 2020-09-15 15:58:54 +02:00
Marten Ringwelski
7e02fb679c Implement focus-follows-cursor 2020-09-15 15:15:55 +02:00
Isaac Freund
f597e7da63
seat: implement drag and drop 2020-09-14 20:11:25 +02:00
Isaac Freund
976a3ce73d
cursor: handle borderless views in move/resize 2020-09-08 18:54:57 +02:00
Isaac Freund
989e7aaeda
config: implement map-pointer command
This command takes a mode, modifiers, button/event name, and pointer
action as arguments. It stores these in the config data structure.

The currently available pointer actions are move-view and resize-view,
which replace the previously hard-coded functionality.

Closing the hovered view with middle click has temorarily been removed
until it is decided if we wish to make this another special pointer
action or perhaps allow running any arbitrary command (which would of
course include close).
2020-08-24 18:57:43 +02:00
Isaac Freund
fd8c5e6410
style: attach_mode() -> attachMode() 2020-08-24 11:50:38 +02:00
Isaac Freund
e92b6307d9
river-status: don't report destroying views 2020-08-22 17:17:57 +02:00
Isaac Freund
dd425a3e66
root: clean up initialization 2020-08-21 21:06:59 +02:00
Isaac Freund
0b2c992f4d
river-status: clean up initialization 2020-08-21 21:06:59 +02:00
Isaac Freund
997b151df2
output: clean up initialization 2020-08-21 21:06:59 +02:00
Isaac Freund
4a334829f3
config: handle alloc failure in Mapping init 2020-08-21 21:06:59 +02:00
Isaac Freund
c7c1934b70
Keyboard: clean up initialization 2020-08-21 21:06:59 +02:00
Isaac Freund
163fa47822
xdg-decoration: clean up initialization 2020-08-21 21:06:59 +02:00
Isaac Freund
5098553fb4
river-status: clean up initialization 2020-08-21 21:06:58 +02:00
Isaac Freund
a201ced77d
config: clean up initialization 2020-08-21 21:06:58 +02:00
Isaac Freund
71a751f1ad
seat: clean up initialization 2020-08-21 21:06:58 +02:00
Isaac Freund
37ea1bac36
layer-surface: clean up initialization 2020-08-21 16:53:04 +02:00
Isaac Freund
eb21e03b42
xdg-popup: clean up initialization 2020-08-21 16:51:09 +02:00
Isaac Freund
5cea3f68e3
xwayland: clean up initialization 2020-08-21 16:48:17 +02:00
Isaac Freund
1fbaaa55b3
xdg-toplevel: clean up initialization 2020-08-21 16:45:27 +02:00
Isaac Freund
283f3f8061
view: clean up initialization 2020-08-21 16:43:12 +02:00
Isaac Freund
7274761069 cursor: leave mode if target view is destroyed 2020-08-21 16:31:39 +02:00
Isaac Freund
db416eb119 view stack: rework iteration for flexibility
There is now a single iter() function which accepts a filter and context
allowing users of the api to filter the views in any arbitrary way. This
change allowed for a good amount of code cleanup, and this commit also
ensures that the correct properties are checked in each case, including
the new View.destroying field added in the previous commit. This fixes
at least one crash involving switching focus to a destroying view.
2020-08-21 16:31:39 +02:00
Isaac Freund
fa08d85c58 view: implement frame-perfect destroy
river's View objects may now outlive their wlroots counterparts so that
we can continue to render a destroyed view until the transaction is
completed.
2020-08-21 16:31:39 +02:00
Leon Henrik Plickat
59d6432332 Implement "attach-mode" 2020-08-18 11:00:51 +02:00
Isaac Freund
340bfbd7f1
xwayland: fix signed to unsigned int casting error 2020-08-13 13:47:14 +02:00
Isaac Freund
7de2edb623
seat: implement kde idle protocol 2020-08-13 12:22:32 +02:00
Isaac Freund
aabd85b028 layer-shell: improve configure handling
- don't send a new configure on commit if nothing has changed
- simplify code
2020-08-13 11:17:15 +02:00
Isaac Freund
7a6ac8eb6e seat: set focus before starting transactions
Focus was made double-buffered in 96a91fd. However, much of the code
still behaved as if focus was separate from the transaction system.
This commit completes the work started in 96a91fd and ensures that
focus is applied consistently in a single transaction.
2020-08-13 11:17:15 +02:00
Isaac Freund
bd99428766 view: handle setting fullscreen in configure() 2020-08-13 11:17:15 +02:00
Isaac Freund
2669a615b6 root: refactor transaction initiation
- require the caller to use Root.startTransaction() directly
- introduce View.applyPending() to unify logic
- introduce View.shouldTrackConfigure() to unify more logic
- update all callsites to intelligently rearrange only what is necessary
2020-08-13 11:17:15 +02:00
Leon Henrik Plickat
946e4f21ba Enforce minimum window size also for views with constraints 2020-08-10 22:15:09 +02:00
Leon Henrik Plickat
45a730cbd3 Fix crashing bug for window size smaller than 2 * (border width + gap size) 2020-08-10 19:26:13 +02:00
Isaac Freund
e66c8b0019
code: clean up cursor resize mode
- offset_{x,y} is consistent with delta_{x,y}
- no need to name the type, it's only referenced in one place
2020-08-07 21:36:28 +02:00
Isaac Freund
0c4e3295b1
cursor: implement implicit grabs
When a button is held down and the cursor leaves a surface, events now
continue to be sent to the client. This allows e.g. dragging a scroll
bar from outside the surface.
2020-08-07 13:54:58 +02:00
Isaac Freund
91052f7477
cursor: refactor mode handling 2020-08-07 12:08:58 +02:00
Isaac Freund
96a91fd2f7 view: double buffer focus, use counter not bool
- Double buffering focus state ensures that border color is kept in sync
with the transaction state of views in the layout.
- Using a counter instead of a bool will allow for proper handling of
multiple seats. This is done in the same commit to avoid more churn in
the future.
2020-08-03 18:54:18 +02:00
Isaac Freund
7d77160fe3
view: arrange on unmap if fullscreened from layout
We don't rearrange the layout on fullscreening a view that is part of
the layout since the fullscreened view hides the layout. This means that
if a non-floating fullscreen view is closed the layout needs to be
rearranged.
2020-08-01 20:03:32 +02:00
Isaac Freund
ef4efbcadf
view: fix xdg_toplevel fullscreen request handling 2020-08-01 19:56:34 +02:00
Isaac Freund
845fcad9e6
layout: use fork/execve instead of ChildProcess
This keeps things simpler, and we will need this control anyways in
order to enforce a timeout.
2020-08-01 18:37:06 +02:00
Isaac Freund
05557086e6
output: simplify layout code 2020-08-01 17:34:45 +02:00
Isaac Freund
56df9176b3
server: handle SIGINT/SIGTERM with wl_event_loop
This is cleaner than having a separate signal handler and should be more
consistent/reliable.
2020-08-01 17:27:49 +02:00
Isaac Freund
54b09c4ae9
server: use fork/execve for startup command
std.ChildProcess leaks an fd currently and is more complex than what we
need anyways.
2020-08-01 13:40:41 +02:00
Isaac Freund
d2ebd5e4e2
view: remember floating dimesions
When a floating view is returned to the layout or made fullscreen, it
now saves the dimesions it had while floating and returns to that same
position/size if made to float again.
2020-07-31 20:22:37 +02:00
Isaac Freund
d6823fe3a0 cursor: handle xwayland views for move/resize 2020-07-31 17:06:26 +02:00
Isaac Freund
7a244092e5 view: sidestep transaction for float/fullscreen
Transactions are only useful when multiple views need to atomically
change size together. Float/fullscreen views are independant of the
layout and should bypass the transaction system.
2020-07-31 17:06:26 +02:00
Isaac Freund
ecef8c2dc4 cursor: forbid move/resize of fullscreen views 2020-07-31 17:06:26 +02:00
Isaac Freund
d87356c93a view: forbid mode change if cursor target
Making a floating view tiled during a resize breaks things badly.
2020-07-31 17:06:26 +02:00
Isaac Freund
9f3ee76e51 cursor: implement resize 2020-07-31 17:06:26 +02:00
Isaac Freund
ac3066d8fc
code: refactor and simplify cursor move mode 2020-07-28 16:17:16 +02:00
Isaac Freund
627ab7ec8a
cursor: ensure theme loaded on output creation 2020-07-17 20:40:33 +02:00
Isaac Freund
43bcce9afe
code: fix a pair of leaks 2020-07-17 16:01:35 +02:00
Isaac Freund
0091445b9f
cursor: properly set XCURSOR_SIZE if default 2020-07-17 12:58:54 +02:00
Leon Henrik Plickat
228c2c372f Fix bug causing XDG toplevels with a parent to not respect the CSD filter 2020-07-16 21:24:08 +02:00
Leon Henrik Plickat
a93c263502 Implement csd-filter-add and float-filter-add commands 2020-07-16 21:24:08 +02:00
Leon Henrik Plickat
76da7e2b0d Make float_filter a slice list 2020-07-16 21:24:08 +02:00
Isaac Freund
0ebb5ccc17
code: update to wlroots 0.11.0 2020-07-16 21:20:43 +02:00
Leon Henrik Plickat
be29b0ef95 Implement csd_filter list 2020-07-16 17:08:19 +02:00
Isaac Freund
101f47d78f
code: use a tagged union to store focus
This simplifies the code and is more robust than two separate pointers.
2020-07-15 14:15:17 +02:00
Isaac Freund
8afe7c2c87
code: simplify direction parsing 2020-07-15 13:03:28 +02:00
Isaac Freund
1389b4a850
code: deduplicate command include code 2020-07-15 12:54:36 +02:00
Isaac Freund
2b2b78dd4d
command: split set-option into "toplevel" commands
`riverctl set-option view_padding 10` becomes `riverctl view-padding 10`

Having set-option doesn't really gain us anything and is more verbose as
well as being slightly inaccurate as the changes instantly apply.
2020-07-15 12:42:20 +02:00
Isaac Freund
6bdb152808
cursor: make xcursor theme configurable
- add a new command to set the theme
- export the theme of the default seat through environment variables
2020-07-14 17:34:29 +02:00
Isaac Freund
f3d4e5ac53
command/spawn: use _exit(2) instead of exit(3)
Something in exit(3) is causing the intermediate fork to segfault.
2020-07-12 12:16:05 +02:00
Isaac Freund
8120829e5c
xwayland: set seat
This makes e.g. the clipboard work.
2020-07-09 22:31:01 +02:00
Isaac Freund
cbf645d468
command/spawn: clean up and disown children
- Call setsid
- Clean up the signal mask.
- Use a double fork so that processes get inherited by init.
2020-07-08 14:00:51 +02:00
Leon Henrik Plickat
d77ac5ac7a cursor: close view on middleclick when pointer_modifier is active 2020-07-08 12:25:52 +02:00
Leon Henrik Plickat
d292e61cfd cursor: implement moving views 2020-07-07 19:06:52 +02:00
Isaac Freund
dfe61fe77d
xwayland: don't crash on null title 2020-07-06 16:10:59 +02:00
Isaac Freund
014963612c
river-status: fix bug sending old output tag state 2020-07-06 11:09:23 +02:00
Isaac Freund
24c0355ba8
layer-shell: respect single anchor exclusive zones 2020-07-05 23:34:59 +02:00
Isaac Freund
341fe1e977
code: handle out of memory as well as possible 2020-07-05 22:49:17 +02:00
Isaac Freund
3752a7879b
server: send SIGTERM to startup process on exit 2020-07-05 15:44:21 +02:00
Isaac Freund
9dd18c6373
server: exit cleanly on SIGINT and SIGTERM 2020-07-05 14:49:34 +02:00
Isaac Freund
86386e84bc
output: introduce state struct
This simplifies the handling of the current/pending tags and will be
used in the future for atomic layout updates involving layer surface
exclusive zones.
2020-07-02 21:56:26 +02:00
Isaac Freund
34d42d9e8c
xdg-shell: honor fullscreen requests 2020-06-29 11:52:53 +02:00
Isaac Freund
c78d31acf4
view: save and restore floating dimensions
When a floating view is fullscreened and returned to floating, it should
remember its previous floating size/position.
2020-06-29 11:15:55 +02:00
Isaac Freund
7b6e05005d
render: draw fullscreen views properly
- use a solid black background
- only draw the overlay layer
2020-06-29 01:46:24 +02:00
Isaac Freund
eb1e66b0fe
seat: prioritize fullscreen views for focus 2020-06-29 01:04:37 +02:00
Isaac Freund
acd08840ab
command: disable focus-view in fullscreen 2020-06-29 01:04:37 +02:00
Isaac Freund
3cbd95fadc
river: implement toggle-fullscreen
The command works, but behaves a little strangely. Also, fullscreen
views are not yet rendered on an opqaue backdrop.
2020-06-29 01:00:57 +02:00
Isaac Freund
82a444a7c0
view: use saved geometry for borders if needed
This fixes the issues caused by 60f06a1 and greatly simplifies the code.
Turns out we were already tracking the dimensions needed.
2020-06-28 20:45:17 +02:00
Isaac Freund
5b96d831d3
view: replace mode with float/fullscreen bools
The enum would be awkward here since if a view is fullscreened while
floating it should still be floating when defullscreened.
2020-06-28 20:30:12 +02:00
Isaac Freund
60f06a1a40
view: draw borders around actual dimensions
Previously if the view did not take the size requested, we would draw
the borders around the size we asked the view to take rather than its
actual size.
2020-06-28 01:46:53 +02:00
Isaac Freund
7f2e2610e3
code: fix tests 2020-06-28 00:35:38 +02:00
Isaac Freund
b6ef4c5a1a
cursor: fix viewAt() ordering
Focused views must be checked first as they are always rendered on top.
2020-06-28 00:29:44 +02:00
Isaac Freund
9dfcec72a8
view: simplify default float dimension handling 2020-06-27 23:48:04 +02:00
Isaac Freund
c04112b81a
view: introduce state struct to simplify code
The state struct holds all of the state that is double-buffered and
applied through transactions. This more explicit handling simplifies
much of the code, and will allow for easier implementation of new
feature such as fullscreen.
2020-06-27 23:18:41 +02:00
Isaac Freund
89d0fb012d
view: use a mode enum instead of floating bool
This is in preperation for fullscreen support which will add another
mode to this enum.

This commit also fixes a bug that allowed clicking floating views though
layout views in some cases.
2020-06-27 18:12:18 +02:00
Isaac Freund
3904275373
command: log output of commands run by mappings 2020-06-26 18:43:20 +02:00
Isaac Freund
40597f184d
command: allow output on success, refactor 2020-06-26 17:57:03 +02:00
Isaac Freund
558918d286
config: fix leak of hashmap keys 2020-06-26 12:58:11 +02:00
Isaac Freund
dfb03fd0cb
command: dupe mode name memory
The hashmap doesn't take ownership of the memory pointer to by these
slices, so we need to dupe them to avoid use-after-free.
2020-06-26 12:46:18 +02:00
Isaac Freund
08d630567f
river-status: fix view-tags array size 2020-06-26 12:31:04 +02:00
Isaac Freund
b6d981254b
seat: pass a null terminated string 2020-06-26 01:13:00 +02:00
Isaac Freund
79bb0accac
code: improve error handling consistency 2020-06-26 00:59:31 +02:00
Isaac Freund
8fc045b445
code: clean up server init 2020-06-26 00:07:02 +02:00
Isaac Freund
a7c422dad7
data-control: implement protocol 2020-06-25 23:08:56 +02:00
Isaac Freund
ebc661f4a7
command: add background_color option
This is trivial to support and allows basic customization without
running a layer-shell program such as swaybg. This is especially useful
in low memory situations.
2020-06-19 18:44:28 +02:00
Isaac Freund
2ef8261493
river-status: fix memory leak 2020-06-19 14:48:28 +02:00
Isaac Freund
12d34d4ded
bikeshed: rename util.allocator to util.gpa
This is less typing and more clear. A definite win.
2020-06-19 14:32:30 +02:00
Isaac Freund
aae89356a1
code: refactor layoutExternal
- Use an arena allocator, cleaner and should be faster.
- Simplify construction of the command to be run
2020-06-19 14:20:29 +02:00
Isaac Freund
37a98e1a7a
layout: fix loop counter
The counter should not be incremented if the view was floating.
2020-06-19 14:02:42 +02:00
Isaac Freund
582164ce41
code: refactor Server.start()
This was needlessly verbose
2020-06-17 22:17:51 +02:00
Isaac Freund
0efc04508b
cli: allow setting log level with '-l' flag 2020-06-17 02:01:07 +02:00
Isaac Freund
d74323bbbf
code: improve logging functions
this implements a modified version of the logging interface proposed
here: https://github.com/ziglang/zig/pull/5348
2020-06-17 01:31:38 +02:00
Isaac Freund
42f8076cec
river-status: fix crash due to bad alignment
Using an ArrayList to back the wl_array we need to pass to libwayland
is much safer and avoids this kind of bug.
2020-06-16 22:49:47 +02:00
Isaac Freund
c5de1641dc
code: create util.allocator and use globally
river is not a library and passing a general purpose allocators around
everywhere does not make sense and leads to ugly code. This does not
prevent us from using local arenas if they are fitting.
2020-06-16 22:48:08 +02:00
Isaac Freund
fb8d855ec9
code: create voidCast() util function 2020-06-16 20:54:05 +02:00
Isaac Freund
ce18f24129
river-status: actually destroy the manager object 2020-06-16 18:27:46 +02:00
Isaac Freund
f0c3aa3744
river-control: implement protocol changes 2020-06-16 18:27:46 +02:00
Leon Henrik Plickat
5de21d0d23 Commands: rework layout command 2020-06-16 15:48:53 +02:00
Leon Henrik Plickat
2fce8c7108 Output: Add layoutExternal() 2020-06-16 15:48:53 +02:00
Leon Henrik Plickat
754e24a710 Output: Rework layout switching in arrangeViews() 2020-06-16 15:48:53 +02:00
Leon Henrik Plickat
bdc56517e9 Output: Remove layoutMasterStack() and rework layoutFull()
layoutFull() now enforces a minimum view size of 50x50
2020-06-16 15:48:53 +02:00
Isaac Freund
e1a1459177
xdg-shell: improve child handling
- wait until map to send tiled state
- only set toplevels with no parent to tiled (toplevels with a parent
are generally popup-like things such as a file chooser or yes/no prompt)
- track dimesions and offset of the surface and take offset into account
for rendering.
2020-06-13 23:38:00 +02:00
Isaac Freund
c2d32a44c3
command: add view_padding option 2020-06-13 13:32:35 +02:00
Isaac Freund
4f029aa5c7
command: allow alpha in colors, simplify code 2020-06-13 13:09:43 +02:00
Isaac Freund
40c62577e1
code: simplify option handling 2020-06-13 12:14:36 +02:00
lazy-dolphin
efe2c2ce4b command: add border_focused_color and border_unfocused_color options 2020-06-13 11:53:39 +02:00
Isaac Freund
0ab2b3134e
code: simplify view rendering 2020-06-11 01:19:59 +02:00
Isaac Freund
8839ae7335
command: don't zoom floating views 2020-06-11 01:15:01 +02:00
Isaac Freund
ff219c7d8d
render: floating as normal, focused views on top
This means that floating views can be (partially) obscured by normal
views if they are low in the stack, and that the "full" layout will
work a little nicer as the focused view is always the top rendered.
2020-06-11 00:09:42 +02:00
lazy-dolphin
1b7c1c7b2c command: implement set-option
Only border and padding options are currently available.
2020-06-10 18:08:21 +02:00
Isaac Freund
ddc7da0f16
transactions: save transform, refactor rendering 2020-06-10 00:06:26 +02:00
Isaac Freund
48ea771310
transactions: save and render subsurface buffers 2020-06-09 23:13:14 +02:00
Isaac Freund
052c8e1dcb
transactions: handle preemption take 2
This implementation is far simpler than c0d7e71 as it takes advantage of
wlroots's tracking of pending state.

Additionally, we now send frame done events if a view that we are
configuring commits with the wrong dimensions. This is necessary in
order to trigger a redraw for some clients as well as being a more
correct implementation of the protocol.
2020-06-09 20:06:30 +02:00
Isaac Freund
24b1a566de
transactions: revert c0d7e71 2020-06-09 17:04:38 +02:00
Isaac Freund
7c094420ed
transactions: propogate x/y of new box if needed 2020-06-08 14:11:52 +02:00
Isaac Freund
5f2aa02132
transactions: set timeout back to 200ms
The change to 1000ms was an accident
2020-06-08 01:16:15 +02:00
Isaac Freund
c0d7e71ec4
transactions: handle preemption properly
when a transaction interrupts an ongoing transaction, we must be careful
to handle the configures properly. This commit adds a new member to view
so that we can store the dimensions sent with the last configure in
order to determine if the preempting transaction should override the
ongoing configure or not.

Additionally, some views do not ack a configure if they already have the
requested dimensions. This can happen if a pending configure setting
alternative dimensions is overridden, so in this case we do not wait for
an ack before committing the transaction.
2020-06-08 00:10:30 +02:00
Isaac Freund
7b1e07d3d5
code: remove dead code 2020-06-07 19:40:19 +02:00
Isaac Freund
b8cc4cc22c
river-status: send view_tags on view output change 2020-06-06 15:07:19 +02:00
Isaac Freund
2b10720366
map: allow creating mappings with no modifiers 2020-06-05 10:54:39 +02:00
Isaac Freund
7a40ac370d
river-status: use correct resource and fix crash 2020-06-05 00:24:46 +02:00
Isaac Freund
a63fb461ba
river-status: send view_tags on view map/unmap 2020-06-05 00:24:46 +02:00
Isaac Freund
5aa7fe8af8
river-status: implement protocol 2020-06-04 16:56:58 +02:00
Isaac Freund
03fc51d8d6
Eliminate some magic numbers 2020-06-02 17:02:03 +02:00
Isaac Freund
ea7f5d4064
Use tag masks for tag commands and clean up 2020-06-02 16:38:23 +02:00
Isaac Freund
0e9ecb6051
Rename focus -> focus-view 2020-06-02 14:04:23 +02:00
Isaac Freund
9856bc92ec
Clean up some memory leaks 2020-06-02 13:45:56 +02:00
Isaac Freund
eaf13f3bcf
Don't recreate transaction timer unnecessarily 2020-06-02 00:18:28 +02:00
Isaac Freund
631983b734
Replace _ with - as separator in commands 2020-06-01 20:51:20 +02:00
Isaac Freund
c63420cf45
Use + instead of | to separate modifiers
Although | makes more logical sense, it has another meaning in most
shells.
2020-06-01 20:50:22 +02:00
Isaac Freund
7cadd40051
De-hardcode all mappings
Move the default mappings to contrib/config.sh.
2020-06-01 20:45:40 +02:00
Isaac Freund
072dd575aa
Add support for running a command on startup 2020-06-01 19:43:21 +02:00
Isaac Freund
939beef168
Split river and riverctl directories 2020-06-01 15:56:50 +02:00