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

Better Windows support #8809

Closed
wants to merge 39 commits into from
Closed

Conversation

JunkuiZhang
Copy link
Contributor

@JunkuiZhang JunkuiZhang commented Mar 4, 2024

  • Menus, shortcuts, drag-drop, copy-paste....
  • Using Blade and LinuxTextSystem to render
  • Keyboards and mouse events are supported, IME is supported too
  • With this pr merged, terminal will be easily supported

Edit:
Close #8825

I will add some videos or pics below

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 4, 2024
@JunkuiZhang
Copy link
Contributor Author

JunkuiZhang commented Mar 4, 2024

屏幕截图 2024-03-04 145832
  • Menus
屏幕截图 2024-03-04 150613
  • Popups
屏幕截图 2024-03-04 150448
  • Drag-drop
屏幕截图 2024-03-04 150512

@zaucy
Copy link
Contributor

zaucy commented Mar 4, 2024

@JunkuiZhang this is what my experience was like running the latest commit on this PR 01cdc7038f58acb54445756c3bc22b674c9be3b7

when I first do cargo run it's stuck in this state for a little bit
image

then finally I can resize it to get it visible it behaves like this:
pr-8809

sometimes when I click it creates multi cursors as well

@JunkuiZhang
Copy link
Contributor Author

This is quite strange. It runs perfectly fine on my end. I will upload a video

@JunkuiZhang
Copy link
Contributor Author

1.mp4

@JunkuiZhang
Copy link
Contributor Author

I use win + G to record this, it dose not record the popups

@ThatFrogDev
Copy link
Contributor

I use win + G to record this, it dose not record the popups

@JunkuiZhang: if you are on the latest version of Windows 11 you can also use Win+Shift+S and select the area you want to record :)

currently, they are just black boxs for me
@JunkuiZhang
Copy link
Contributor Author

I use win + G to record this, it dose not record the popups

@JunkuiZhang: if you are on the latest version of Windows 11 you can also use Win+Shift+S and select the area you want to record :)

Thx for the tips!

@mikayla-maki
Copy link
Contributor

mikayla-maki commented Mar 5, 2024

I have not yet joined Discord as the service is not available in China.

@JunkuiZhang I'm so sorry that y'all have to deal with that. Is there another place we could get in touch that's less asynchronous?

Regarding the two PRs, as CI is failing on this branch and #8791 handles key events slightly better (e.g. the esc issue), I'm going to merge that one first.

But that said, I would really love to see the IME support, menus, and etc. in this PR land as well. It's very important that we're usable for everyone and I really appreciate all the work you've put in :)

Could you split this work into a few more PRs with fewer changes, maybe one per major feature:

  1. Menus
  2. IME
  3. Drag and Drop

And we could get each of those merged individually?

@mikayla-maki
Copy link
Contributor

3. but the IME window position relies on caret position information. In other software like VS Code, the IME window always appears below the caret. However, Zed lacks caret position information,

Zed is able to get this information from the InputHandler::bounds_for_range method :)

@JunkuiZhang
Copy link
Contributor Author

JunkuiZhang commented Mar 6, 2024

I have not yet joined Discord as the service is not available in China.

@JunkuiZhang I'm so sorry that y'all have to deal with that. Is there another place we could get in touch that's less asynchronous?

Regarding the two PRs, as CI is failing on this branch and #8791 handles key events slightly better (e.g. the esc issue), I'm going to merge that one first.

But that said, I would really love to see the IME support, menus, and etc. in this PR land as well. It's very important that we're usable for everyone and I really appreciate all the work you've put in :)

Could you split this work into a few more PRs with fewer changes, maybe one per major feature:

  1. Menus
  2. IME
  3. Drag and Drop

And we could get each of those merged individually?

@mikayla-maki If this is Zed's decision. By the way, I have returned to school after the Spring Festival holiday, so once I have submitted all the contents in this PR, I probably won't have that much time for further development.

@mikayla-maki
Copy link
Contributor

I understand, thank you for the work you've already put in!

mikayla-maki pushed a commit that referenced this pull request Mar 6, 2024
### Description
This is a part of #8809 

Update mio from 0.8.8 to 0.8.11.

When using named pipes on Windows, mio will under some circumstances
return invalid tokens that correspond to named pipes that have already
been deregistered from the mio registry. The impact of this
vulnerability depends on how mio is used. For some applications, invalid
tokens may be ignored or cause a warning or a crash. On the other hand,
for applications that store pointers in the tokens, this vulnerability
may result in a use-after-free.

### Connections

[named-pipes: fix receiving IOCP events after deregister
#1760](tokio-rs/mio#1760)

[Windows Named pipes invalid memory access
#6369](tokio-rs/tokio#6369)


Release Notes:

- N/A
mikayla-maki pushed a commit that referenced this pull request Mar 6, 2024
### Description

This is a part of #8809 


Release Notes:
- N/A
mikayla-maki added a commit that referenced this pull request Mar 6, 2024
### Description

This is a part of #8809 , impl the following functions:

- `os_version`
- `local_timezone`
- `double_click_interval`
- `set_cursor_style`
- `open_url`
- `reveal_path`

Release Notes:
- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
mikayla-maki added a commit that referenced this pull request Mar 7, 2024
### Description

This is a part of #8809 



https://github.com/zed-industries/zed/assets/14981363/2b085b9d-8b83-4ac7-8b84-07c679760eba




Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
mikayla-maki pushed a commit that referenced this pull request Mar 8, 2024
### Description
This is a part of #8809 , and this PR dose not include `open file
dialog`, as I already saw two PRs impl this.



https://github.com/zed-industries/zed/assets/14981363/3223490a-de77-4892-986f-97cf85aec3ae




Release Notes:

- N/A
mikayla-maki pushed a commit that referenced this pull request Mar 19, 2024
As I mentioned before, there are the following issues with how GPUI
handles scale factors greater than 1.0:
1. The title bar buttons do not function correctly, with minimizing
button performing maximization and maximizing button performing closure.
2. As discussed in #8809, setting a scale factor greater than 1.0 causes
GPUI's drawing content to be pushed off the screen.

This PR introduces `LogicalSize` and `PhysicalSize` to differentiate
between coordinate systems for proper GPUI rendering, and now scale
factors above 1.5 are working correctly.

`Zed` with a scale factor equals 1.5, and change between different scale
factors:



https://github.com/zed-industries/zed/assets/14981363/3348536d-8bd3-41dd-82f6-052723312a5b



Release Notes:

- N/A
pjlast pushed a commit to pjlast/zed that referenced this pull request Mar 26, 2024
As I mentioned before, there are the following issues with how GPUI
handles scale factors greater than 1.0:
1. The title bar buttons do not function correctly, with minimizing
button performing maximization and maximizing button performing closure.
2. As discussed in zed-industries#8809, setting a scale factor greater than 1.0 causes
GPUI's drawing content to be pushed off the screen.

This PR introduces `LogicalSize` and `PhysicalSize` to differentiate
between coordinate systems for proper GPUI rendering, and now scale
factors above 1.5 are working correctly.

`Zed` with a scale factor equals 1.5, and change between different scale
factors:



https://github.com/zed-industries/zed/assets/14981363/3348536d-8bd3-41dd-82f6-052723312a5b



Release Notes:

- N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zed main branch build windows crash
5 participants