Skip to content

wayland: rebased and merge into master#2079

Merged
maan2003 merged 32 commits intolinebender:masterfrom
james-lawrence:wayland-rebase
Jan 7, 2022
Merged

wayland: rebased and merge into master#2079
maan2003 merged 32 commits intolinebender:masterfrom
james-lawrence:wayland-rebase

Conversation

@james-lawrence
Copy link
Contributor

pull all the changes from wayland into master since we're down to just a few missing pieces in wayland (mostly pieces also missing within the x11 backend) time to let it soak in master.

richard-uk1 and others added 8 commits December 6, 2021 07:16
Also use `im` crate to solve reentrancy on windows collection (a group
of windows, rather than the ubiquitous Microsoft product).
while not 100% there implements significant improvements to the wayland
backend. most (all?) examples seem to basic work. most outstanding work
is integrating with the druid APIs cleanly, implement repeating keys,
some point work, naturally performance fixes and finally there are some
bugs when resuming from sleep.
@maan2003
Copy link
Collaborator

maan2003 commented Dec 6, 2021

We also want CI for wayland backend, probably just need to copy

test-stable-gtk:
runs-on: ubuntu-latest
name: cargo clippy+test (gtk)
steps:
- uses: actions/checkout@v2
- name: install libgtk-3-dev
run: |
sudo apt update
sudo apt install libgtk-3-dev
- name: install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
profile: minimal
override: true
- name: restore cache
uses: Swatinem/rust-cache@v1
- name: cargo clippy druid-shell
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path=druid-shell/Cargo.toml --all-targets -- -D warnings
- name: cargo test druid-shell
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path=druid-shell/Cargo.toml
# We use --all-targets to skip doc tests; there are no gtk-specific
# doctests in the main druid crate anyway
- name: cargo test druid
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path=druid/Cargo.toml --all-targets --features=svg,image,im

@james-lawrence
Copy link
Contributor Author

agreed, can do it as part of the next PR if you want. CI env is very different than my environment, which isn't an issue but don't want to think about it for this one. =)

@maan2003
Copy link
Collaborator

maan2003 commented Dec 6, 2021

I can do it tomorrow. wanted it because cargo clippy --features wayland --no-default-features generates 107 warnings 😅
(most should be fixed by cargo clippy --features wayland --no-default-features -Z unstable-options --fix)

@maan2003
Copy link
Collaborator

maan2003 commented Dec 7, 2021

can you add the following commits:
maan2003/druid@33b31ba - add CI for wayland
maan2003/druid@3fe57bb - fixes bug in build.rs
maan2003/druid@8a5884c - disable ApplicationExt static assertion for wayland
maan2003/druid@3c9591c - fixes most of clippy warnings

@maan2003
Copy link
Collaborator

maan2003 commented Dec 7, 2021

also squash 11d72d8 and c3d7fdb

maan2003 and others added 16 commits December 7, 2021 15:33
removes the need to use some unsafe code.
allows for us to replace inner surfaces dynamically. (necessary for
layershells).
fix minor issue with global id
- fixes a seg fault when resizing the current window.
- fixes a bug where even if no seg fault happens we skip painting.
while these changes don't fully implement a working copy/paste.
I have confirm that when Clipboard::get_string is invoked the
contents from the system clipboard are returned.
- bunch of other misc cleanups
- refactors some of the wayland connection code out of the
  application startup.
@james-lawrence
Copy link
Contributor Author

james-lawrence commented Dec 8, 2021

@emersion we talked, your concerns were understood. using unstable protocols by default comes with that risk. I'd expect the same potential risks from any of the unstable protocols. this isn't news to anyone. same with the xdg_output, or layershell.

if it breaks its entirely not your problem.

@emersion
Copy link

emersion commented Dec 8, 2021

No, it has nothing to do about the protocols being "unstable". "unstable" protocols (in wayland-protocols parlance) just means that a separate protocol may supersede it at some point, but "unstable" protocols never see backwards-incompatible changes. See the wayland-protocols README.

In other words, even if you use an "unstable" protocol, your client will never be broken by a protocol update.

What I'm talking about here is very different. I'm saying that I'll make it so your clients won't even launch on purpose, to avoid having other clients be tempted to use privileged protocols they must not use.

this isn't news to anyone

Please take time to understand how Wayland works before making your points.

if it breaks its entirely not your problem.

Yes, it is my problem, because it causes more work for me. I'm already spending a good chunk of time trying to convince you and explain that this pull request is doing the wrong thing.

@kennylevinsen
Copy link

We have talked it out on IRC, and we're all good. :)

In the wlroots team we're mainly worried about special protocols ending up used by normal clients when such use will be blocked in the future. @james-lawrence explained that this part is going away in the next PR, so while we find it odd that its included here, I guess that's just people having different git workflows.

james-lawrence and others added 3 commits December 11, 2021 10:09
- remove wlr management api.
- allow the application logic to make use of the code.
@james-lawrence
Copy link
Contributor Author

@maan2003 this is ready to go, I pulled in changes from the next branch I was going to PR to resolve @emersion concerns.

makes the PR larger than I wanted and makes it no longer a pure rebase but ./shrug. at this point I think with there will be 1 final small PR around layershell reinitializing unless I encountered something when working on my applications.

I'll be opening up issues around the remaining work once the final PR is in for documentation/disccusion purposes for whomever takes up the torch next. ;)

@james-lawrence
Copy link
Contributor Author

oh and of course I'll be avail if issues crop up.

Copy link
Collaborator

@maan2003 maan2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for such a late review :/

@maan2003
Copy link
Collaborator

Also, choice of using Rc or Arc feels arbitrary. please explain the reasoning

@james-lawrence
Copy link
Contributor Author

@maan2003 all good, its holiday season. =)

@james-lawrence
Copy link
Contributor Author

@maan2003 generally speaking I recall some comment about moving to arc be default within druid but i could be misremembering.

I'm fairly indifferent to the usage of either outside of what rust itself enforces or performance related issues.

most (all?) of the RC usage is from the original branch I started this work off of. it seems slapdash because why I defaulted to using arcs and original branch defaulted to using RC.

@maan2003
Copy link
Collaborator

I recall some comment about moving to arc be default within druid.

that is probably for druid only, we mostly use Rc in druid shell

@james-lawrence
Copy link
Contributor Author

ah then it was a misunderstanding on my end. is the arc/rc stuff a blocker for this PR? would be easier for me to tackle after this is merged to limit the diverging from my private branch.

@james-lawrence james-lawrence force-pushed the wayland-rebase branch 2 times, most recently from 29335c1 to 4145711 Compare December 31, 2021 13:39
@maan2003
Copy link
Collaborator

is the arc/rc stuff a blocker for this PR?

We can fix it later :)

Copy link
Collaborator

@maan2003 maan2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@james-lawrence
Copy link
Contributor Author

@maan2003 bump =) weekend is coming up have some bug fixes in my branch I'm planning on opening another PR for =)

@maan2003
Copy link
Collaborator

maan2003 commented Jan 7, 2022

Sorry, I forgot to merge this.

@maan2003 maan2003 merged commit b11f8ed into linebender:master Jan 7, 2022
@maan2003 maan2003 mentioned this pull request Jan 7, 2022
@james-lawrence james-lawrence deleted the wayland-rebase branch January 8, 2022 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants