Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement wayland support using Smithay #1073

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

blackdragon2447
Copy link
Contributor

@blackdragon2447 blackdragon2447 commented May 31, 2023

Description

This PR's aim is to give LeftWM support for wayland as an alternative to xorg.

Todo

  • Fix Stuff
    • Pointer not working (Relative is not impl)
    • Windows seem to be placed at an offset (Hacky solution)
    • Duplicate/Ghost windows -> problems with buffers? (Needs confirm)
    • Performance -> Keyboard
    • Numlock and Capslock lights don't turn off
    • Cursor placement on new window
    • Focus window on window close
    • Stuff like bars are treated as normal windows
  • Finish LeftWM <=> Smithay communication system:
    • Implement SmithayHandle::wait_readable
    • Add send_event method to SmithayState
  • Move the running of Smithay's calloop into a separate thread and return a SmithayHandle from SmithayHandle::new
  • Borders -> will probably break when doing more compositing.
  • Other Compositing?
  • Screencopy
  • Backgrounds -> Can be done by external programs because we support wlr_layer_shell
  • Keyboard Inhibit
  • WLR layer shell
    • Window types in leftwm-core
    • Focussable
  • Implement the sending of DisplayEvents and acting on DisplayActions and DisplayServer methods
    • Events
      • Movement
      • MouseCombo
      • WindowCreate (started) -> XdgShellHandler::new_toplevel
      • WindowChange
      • WindowDestroy (started) -> XdgShellHandler::toplevel_destoryed
      • WindowTakeFocus
      • HandleWindowFocus
      • VerifyFocusAt
      • MoveFocusTo
      • MoveWindow
      • ResizeWindow
      • ScreenCreate
      • SendCommand
      • ConfigureXlibWindow
      • ChangeToNormalMode
    • Actions
      • KillWindow
      • AddedWindow (started)
      • MoveMouseOver
      • MoveMouseOverPoint
      • SetState
      • SetWindowOrder
      • MoveToTop
      • DestroyedWindow
      • WindowTakeFocus (started)
      • Unfocus
      • FocusWindowUnderCursor
      • ReplayClick
      • ReadyToReizeWindow
      • ReadyToMoveWindow
      • SetCurrentTags
      • SetWindowTag (started)
      • NormalMode
      • ConfigureXlibWindow
    • Methods
      • flush
      • generate_verify_focus_event
      • update_windows (started)

Contributing

Contributions are of course highly appreciated.
For those wanting to contribute, please tell me what part you want to work (Here in the comments or on matrix/discord) on to prevent anyone from doing double work.

Type of change

  • Development change (no change visible to user)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation only update (no change to the factual codebase)
  • This change requires a documentation update

Updated user documentation:

TBD

Checklist:

  • Ran make test-full locally with no errors or warnings reported
    Note: To fully reproduce CI checks, you will need to run make test-full-nix. Usually, this is not neccesary.
  • Manual page has been updated accordingly
  • Wiki pages have been updated accordingly (to perform after merge)

@blackdragon2447 blackdragon2447 self-assigned this Jul 6, 2023
@blackdragon2447 blackdragon2447 added the feature A new feature or request label Sep 6, 2023
@wprzytula
Copy link

What's the status of this? I'd love to see Wayland support in LeftWM, and this seems to be stalled.

@blackdragon2447
Copy link
Contributor Author

This pull is one of my side projects so progresss depends heavily on my time and motivation, but I do intend on actually finishing it at some point, when I have that time and motivation.

@wprzytula
Copy link

Understood. If there is something I could help you with in this PR, feel free to reach for me. I'm not familiar with the codebase though, but I'm proficient in Rust.

@blackdragon2447
Copy link
Contributor Author

Contributions always welcome, tho I do not think there is currently much that can be done without knowledge of at least the smithay-display-server crate and some familiarity of leftwm-core

Events:
- `WindowCreate`
- `ScreenCreate`
- `WindowDestory`
Actions/Methods:
- `AddedWindow`
- `WindowTakeFocus`
- `SetWindowAction`
- `DisplayServer::update_windows`
…yed windows from `WindowRegistry`; Implement `generate_verify_focus_event`
- Don't build `leftwm` and `leftwm-worker` if xlib isn't enabled
- Don't build `leftway` and `leftway-worker` if smithay isn't enabled
- Don't build `lefthk-worker` if lefthk isn't enabled
@Eskaan
Copy link
Contributor

Eskaan commented Mar 9, 2024

Happy to see your work continue! Can't wait to try out your Wayland implementation once it's ready.

@blackdragon2447
Copy link
Contributor Author

Tbh, currently I am doing just some tiny bits since I am still quite out of it...

@AethanFoot
Copy link
Member

Im really hoping to find time to help with this. It will be great to have this great work through!

@blackdragon2447
Copy link
Contributor Author

Yay, while I am still quite out of it, I'm getting back in, digging though smithay's anvil once again to get by bearings with an impl I know is correct.
And it'll be nice to have someone to bounce ideas of off, and to help figure out stuff.
Feel free to poke me on discord or matrix about this.

@blackdragon2447
Copy link
Contributor Author

I am currently tempted partially restart on the implementation, but with more proper planning and knowing everything I've learned from the attempt(s) up until now, which I guess doing planning and stuff might be easier with someone to bounce ideas of off.

@AethanFoot
Copy link
Member

Sounds good, I will have a glance over the current code and smithays code to get some ideas going.

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants