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

Draft: Qt Frontend #3024

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Draft: Qt Frontend #3024

wants to merge 16 commits into from

Conversation

Blquinn
Copy link

@Blquinn Blquinn commented Nov 2, 2023

Description

This is an initial draft on adding Qt QWebEngine support.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Linux (I guess theoretically any platform that Qt supports)

If you build an app with the qt tag on this branch, you should see a small window with example.org come up.

Checklist:

Since this is just a proof of concept draft, I'm holding off on this checklist for now.

  • I have updated website/src/pages/changelog.mdx with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@Blquinn Blquinn mentioned this pull request Nov 2, 2023
@leaanthony
Copy link
Member

This is absolute 🔥 I'm speechless 🤯

@Blquinn
Copy link
Author

Blquinn commented Nov 3, 2023

Thanks 😊 I had fun doing it!

I think things are looking pretty good as far as high level design / patterns. What do you think?

I can keep forging ahead implementing the rest of the front end functions if you think I'm headed in the right direction.

@leaanthony
Copy link
Member

Yeah, I think that would be great. I'm keen for you to keep @tmclane across this as he has valuable experience in the linux side of Wails.

@tmclane
Copy link
Member

tmclane commented Nov 9, 2023

I personally dislike the number of files this has to touch. But that isn't a problem with your changes it is more of a problem with the structure of the project as it currently sits. I think it would be nice if we could move common linux stuff in linux and move the webkit and qt frontend work into packages underneath linux. Could hopefully avoid having to place a !qt tag on everything. Let me experiment with that unless you want to take it on as well. Perhaps leaving it this way for v2 and we can do it better in v3 would be more appropriate.

@Blquinn
Copy link
Author

Blquinn commented Nov 9, 2023

Yea the flag situation isn't exactly ideal. Totally agree with your assessment. There's a lot of code that could and should be shared, I did a good amount of copy/paste from the Linux module. Feel free to take a stab at it!

@Blquinn
Copy link
Author

Blquinn commented Nov 14, 2023

Following up to say that I've implemented pretty much everything other than menus and multi-window. There's a couple things that aren't working, like window positioning, but I think that's just a wayland thing.

@tmclane
Copy link
Member

tmclane commented Nov 15, 2023

Nice! I've been swamped at work and at home so haven't had any free time to look/work on this. Window placement does work in v3 using gtk under Wayland. I don't see why it wouldn't work with qt as well.

Looking forward to playing with this after I install something with kde on it.

@Blquinn
Copy link
Author

Blquinn commented Nov 15, 2023

Perhaps there is some way of getting it to work -- I'm able to resize the window using the cursor. The wayland protocol itself definitely doesn't support it directly, but rather the compositor would see https://wayland-book.com/xdg-shell-in-depth/interactive.html. Simply calling the Window's move() method doesn't work as it does on other platforms.

I also confirmed that it works on x11 by setting QT_QPA_PLATFORM=xcb and that gets window positioning to work.

@PylotLight
Copy link
Contributor

@Blquinn How'd you go with this one? What would you say the current status is of this PR?

@tmclane
Copy link
Member

tmclane commented Dec 11, 2023

I'll check this out this week!

@Blquinn
Copy link
Author

Blquinn commented Dec 11, 2023

@Blquinn How'd you go with this one? What would you say the current status is of this PR?

I think it's pretty far along. Things that still need to be done are:

  • Menus
  • Processing messages and requests from webview
  • Setting window theme

I'd prefer to wait to implement the rest for an architectural review of some kind. Hopefully @tmclane can take a look this week! :)

@tmclane
Copy link
Member

tmclane commented Dec 13, 2023

@Blquinn So I pushed up a rebased copy of your branch to this repository. I did add a single commit to the end which moved all the desktop/linux -> desktop/gtk and updated the import that used it. I also removed all of the !qt build tags that were added in that directory. Would you please pull these changes and see if it works to your satisfaction?

Near as I can tell it is as functional as it was.

https://github.com/wailsapp/wails/tree/linux-qt

@tmclane
Copy link
Member

tmclane commented Dec 13, 2023

Jump on the Discord if you want to talk about this in real time.

@leaanthony
Copy link
Member

Moving this to discord would absolutely be the best way forward. Use this link to join.

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.

None yet

4 participants