zed icon indicating copy to clipboard operation
zed copied to clipboard

Better Windows support

Open JunkuiZhang opened this issue 11 months ago • 15 comments

  • 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

JunkuiZhang avatar Mar 04 '24 06:03 JunkuiZhang

屏幕截图 2024-03-04 145832

  • Menus 屏幕截图 2024-03-04 150613

  • Popups 屏幕截图 2024-03-04 150448

  • Drag-drop 屏幕截图 2024-03-04 150512

JunkuiZhang avatar Mar 04 '24 07:03 JunkuiZhang

What dose not work:

  1. System themes - The background color of menus wont change to black even if we set a dark theme
  2. Scale factor - Currently, the scale factor is not functioning correctly. If a value greater than 1.0 is set, the right and bottom sides of the window will be pushed outside the window and become invisible. Since this value is consistently set to 1.0 in Linux, I suspect this issue may be related to Blade.
  3. IME - The IME is functional, 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, so currently the IME window will appear below the mouse cursor.
  4. Some menu actions

JunkuiZhang avatar Mar 04 '24 07:03 JunkuiZhang

Dark theme but with white menus

屏幕截图 2024-03-03 003702

Scale factor 1.5, note that Zed's "bottom bar" is off the screen

屏幕截图 2024-02-17 171720

IME window position in Zed and VSCode

屏幕截图 2024-03-04 152112 屏幕截图 2024-03-04 152207

JunkuiZhang avatar Mar 04 '24 07:03 JunkuiZhang

As I am still in the learning process and do not have experience with large-scale projects, I am unsure if my code implementation follows best practices. Therefore, any suggestions and criticisms are welcome.

JunkuiZhang avatar Mar 04 '24 07:03 JunkuiZhang

hey looks like we both got started on better Windows support :) https://github.com/zed-industries/zed/pull/8791

I just gave your PR a shot and some things don't seem to work. Pressing 'esc' for instance just prints 'escape'. I've fixed those issues in my PR above, but you've added a bunch of things that I haven't gotten to yet. We should divide and conquer :)

Are you in the zed discord? If you aren't then you should join so we can all collaborate. https://zed.dev/docs/conversations

zaucy avatar Mar 04 '24 08:03 zaucy

hey looks like we both got started on better Windows support :) #8791

I just gave your PR a shot and some things don't seem to work. Pressing 'esc' for instance just prints 'escape'. I've fixed those issues in my PR above, but you've added a bunch of things that I haven't gotten to yet. We should divide and conquer :)

Are you in the zed discord? If you aren't then you should join so we can all collaborate. https://zed.dev/docs/conversations

Currently, there are indeed many bugs, primarily requiring resolution of numerous merge conflicts for this PR, with some changes being rolled back. I have not yet joined Discord as the service is not available in China. I am considering ways to join.

JunkuiZhang avatar Mar 04 '24 08:03 JunkuiZhang

hey looks like we both got started on better Windows support :) #8791

I just gave your PR a shot and some things don't seem to work. Pressing 'esc' for instance just prints 'escape'. I've fixed those issues in my PR above, but you've added a bunch of things that I haven't gotten to yet. We should divide and conquer :)

Are you in the zed discord? If you aren't then you should join so we can all collaborate. https://zed.dev/docs/conversations

Pressing Esc works fine here, that's stange. I will clean the build cache and test again.

JunkuiZhang avatar Mar 04 '24 08:03 JunkuiZhang

Currently, when attempting to open a folder in Zed, the application does not perform the acion. Upon checking the log, an error is reported stating that the folder cannot be found. Since it should be an absolute path, like "C:/xxx/xxx/xxx", but it gives the name directly, so I guess this may be a bug? 屏幕截图 2024-03-04 172723 If you drag and drop a folder, it works fine

JunkuiZhang avatar Mar 04 '24 09:03 JunkuiZhang

Rust Analyzer works great

Note the buttom bar, it is running!!

屏幕截图 2024-03-04 233917

JunkuiZhang avatar Mar 04 '24 15:03 JunkuiZhang

@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

zaucy avatar Mar 04 '24 17:03 zaucy

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

JunkuiZhang avatar Mar 04 '24 17:03 JunkuiZhang

https://github.com/zed-industries/zed/assets/14981363/00fbbe09-7905-4582-bf4d-4cefd39a96b7

JunkuiZhang avatar Mar 04 '24 18:03 JunkuiZhang

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

JunkuiZhang avatar Mar 04 '24 18:03 JunkuiZhang

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 :)

ThatFrogDev avatar Mar 04 '24 19:03 ThatFrogDev

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!

JunkuiZhang avatar Mar 04 '24 19:03 JunkuiZhang

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 https://github.com/zed-industries/zed/pull/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 avatar Mar 05 '24 16:03 mikayla-maki

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 :)

mikayla-maki avatar Mar 05 '24 16:03 mikayla-maki

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.

JunkuiZhang avatar Mar 06 '24 08:03 JunkuiZhang

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

mikayla-maki avatar Mar 06 '24 19:03 mikayla-maki