Comments (12)
On Windows, minimize means resize. We need a patch for the WM_SIZE
event in the upstream winit crate.
See:
from lapce.
Thank you! I'll get started on it in a few days and i will keep you updated! Great work on the editor by the way. It seems to run smoothly and i can only imagine the amount of time and effort to get to this point
from lapce.
Is it alright if i pick up the issue and see if i can fix it?
Feel free to try fixing it!
You'd want to look at lapce-app/src/terminal/view.rs
and probably the wheel_scroll
function in terminal/data.rs
, since it seems like some issue with scroll changing but possibly not getting sent to the terminal? Unsure.
from lapce.
I found out that when the application is minimized, the view buffer of the window only shows a small portion of the titlebar. This can be seen for a split second when you open the application.
This caused the terminals size to become 0 or less, causing it to move the cursor to the incorrect location. When the window is opened, the terminal is resized again and the cursor is moved again, causing it to render at the wrong location. I have validated this by forcing the terminals size to 1200x200 and the bug stopped appearing.
Is the scaling of the application intentional to save performance? As this is a pretty minor bug i want to make sure the fix will not break more important components.
from lapce.
I'm unsure as to the answer here. It might be something done in floem?
from lapce.
I am not sure myself to be honest. I'm looking into it, but if it is something caused by floem it might have to take the problem upstream.
from lapce.
Thank you kindly! I will see if i can get some kind of workaround
from lapce.
It seems the only way to really stop the cursor from displacing is to keep the width and height of the element when there is a drastic change in the size or to check for the exact size the window is when minimized, but this seems quite hacky an unreliable. I am not entirely sure how to proceed, but i think trying to solve the problem in lapce itself might not be a great idea. I'll keep the issue opened for a while to see if anyone else has some ideas, but i will close the issue soon
from lapce.
(The issue should remain open even if we can't fix it right now — thank you for trying at it! — because it would still be a bug)
I think ideally this is something fixed, or given a workaround, in floem. So we could have a change in our winit fork to support knowing when the window was minimized and ignore size changes with that.
from lapce.
Good point. I didn't know lapce used a custom winit fork, I'll give it a go
from lapce.
After some diffing i found out that while there is a resize event taking place when minimizing, it does not seem to be manually called. The winit crate seems to simply set a flag to the window and windows does the rest. Even if i could capture the minimizing event and bypass the size change somehow, the bug still happens when the window is made very small.
The only solutions i can think of are a minimum size or bypassing the size setting when checking the percentage of window scaling. Both solutions don't seem reliable. If anyone has any ideas i am glad to try them, but for now i am not sure how to proceed.
from lapce.
I created a PR for winit lapce/winit#6 to fix the issue when minimizing. But it doesn't work when manually resizing to a small size.
I believe that's a bug in ConPTY, as window terminal, vscode integrated terminal, and alacritty have similar issues.
https://github.com/microsoft/terminal/issues?q=is%3Aissue+is%3Aopen+label%3AProduct-Conpty+resize
from lapce.
Related Issues (20)
- Lapce panic while editing code with Floem error HOT 1
- Do not run HOT 3
- Cursor on column 0 of non empty line is not displayed HOT 1
- Inconsistent line and column numbering
- Failed to start due to X11 error HOT 1
- Fresh installation via Snap on Ubuntu 22.04 Remote (Nomachine) fails to start. HOT 1
- terminal profiles broken again HOT 10
- Garbled characters appear using special Chinese symbols
- can not open file when click menu "go to definition" on a function HOT 1
- syntax highlighting for cpp is not working HOT 1
- File synchronization issue
- Publish to crates.io HOT 1
- `lapse` executable immediately quits on execution in Clear Linux OS, without showing any errors or warnings HOT 3
- App just not working(windows 11) HOT 1
- Lapce doesn't switch between INS/OVR modes
- Settings are not saved on remote hosts
- When launching Lapce, a panic occurred at the slice::from_raw_parts. HOT 2
- The latest pre-release version cannot open the page. HOT 2
- Unable to compile from Git on Windows
- Unable to minimize the window on X11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lapce.