View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001809 | Far Manager | _Common | public | 2011-06-24 20:52 | 2011-06-28 19:52 |
| Reporter | Maximus | Assigned To | DrKnS | ||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | closed | Resolution | fixed | ||
| Product Version | 3.0 | ||||
| Fixed in Version | 3.0 | ||||
| Summary | 0001809: Некорректная прогрутка консоли при выходе | ||||
| Description | С некоторых пор фар восстанавливает размер экранного буфера при выходе. Плохо то, что: 1. экранный буфер _прокручивается_, но без учета позиции курсора. 2. не восстанавливается видимость и высота курсора. | ||||
| Steps To Reproduce | Пример для консоли по умолчанию 80x25 с высотой буфера 300 фар в качестве редактора, запуск через батник: ==== begin dir %WINDIR% "%~dp0far.exe" /p /m /e "%~dp0FarEng.hlf" cmd ==== end или как "панели": ==== begin dir %WINDIR% "%~dp0far.exe" /p /m cmd ==== end В обоих случаях курсор оказывается либо в позиции 0x0 либо 23x0 а видимая область прокручивается в низ консоли, в результате курсор и вывод cmd оказывается не виден. | ||||
| Tags | No tags attached. | ||||
| Build | 2079 | ||||
|
|
Info110624.diff (1,254 bytes)
Index: interf.cpp
===================================================================
--- interf.cpp (revision 6352)
+++ interf.cpp (working copy)
@@ -85,8 +85,7 @@
Console.GetTitle(strInitTitle);
Console.GetWindowRect(InitWindowRect);
Console.GetSize(InitialSize);
- CONSOLE_CURSOR_INFO InitCursorInfo;
- Console.GetCursorInfo(InitCursorInfo);
+ Console.GetCursorInfo(InitialCursorInfo);
GeneralCfg->GetValue(L"Interface",L"Mouse",&Opt.Mouse,1);
@@ -161,6 +160,15 @@
Console.SetTitle(strInitTitle);
Console.SetSize(InitialSize);
+ COORD CursorPos = {};
+ Console.GetCursorPosition(CursorPos);
+ SHORT Height = InitWindowRect.Bottom-InitWindowRect.Top, Width = InitWindowRect.Right-InitWindowRect.Left;
+ if (CursorPos.Y > InitWindowRect.Bottom || CursorPos.Y < InitWindowRect.Top)
+ InitWindowRect.Top = (CursorPos.Y <= Height) ? 0 : max(CursorPos.Y-Height,0);
+ if (CursorPos.X > InitWindowRect.Right || CursorPos.X < InitWindowRect.Left)
+ InitWindowRect.Left = (CursorPos.X <= Width) ? 0 : max(CursorPos.X-Width,0);
+ InitWindowRect.Bottom = InitWindowRect.Top + Height;
+ InitWindowRect.Right = InitWindowRect.Left + Width;
Console.SetWindowRect(InitWindowRect);
Console.SetSize(InitialSize);
|
|
|
> InitWindowRect.Top = (CursorPos.Y <= Height) ? 0 : max(CursorPos.Y-Height,0); зачем во второй ветке max, если там CursorPos.Y > Height и разность априори больше нуля? |
|
|
да, max похоже не нужен |
|
|
некрасивый код получился. случайно? |
|
|
interf110628.diff (608 bytes)
Index: interf.cpp =================================================================== --- interf.cpp (revision 6377) +++ interf.cpp (working copy) @@ -168,7 +168,8 @@ if (CursorPos.X > InitWindowRect.Right || CursorPos.X < InitWindowRect.Left) InitWindowRect.Left = Max(0, CursorPos.X-Width); InitWindowRect.Bottom = InitWindowRect.Top + Height; - InitWindowRect.Right = InitWindowRect.Left + Width; Console.SetWindowRect(InitWindowRect); + InitWindowRect.Right = InitWindowRect.Left + Width; + Console.SetWindowRect(InitWindowRect); Console.SetSize(InitialSize); delete KeyQueue; |
|
|
Ага. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2011-06-24 20:52 | Maximus | New Issue | |
| 2011-06-24 20:52 | Maximus | File Added: Info110624.diff | |
| 2011-06-25 15:36 | DrKnS | Note Added: 0007211 | |
| 2011-06-25 16:00 | Maximus | Note Added: 0007212 | |
| 2011-06-27 09:09 | DrKnS | Build | => 2079 |
| 2011-06-27 09:09 | DrKnS | Status | new => closed |
| 2011-06-27 09:09 | DrKnS | Assigned To | => DrKnS |
| 2011-06-27 09:09 | DrKnS | Resolution | open => fixed |
| 2011-06-27 09:09 | DrKnS | Fixed in Version | => 3.0 |
| 2011-06-28 19:50 | Maximus | Note Added: 0007221 | |
| 2011-06-28 19:50 | Maximus | Status | closed => feedback |
| 2011-06-28 19:50 | Maximus | Resolution | fixed => reopened |
| 2011-06-28 19:50 | Maximus | File Added: interf110628.diff | |
| 2011-06-28 19:52 | DrKnS | Note Added: 0007222 | |
| 2011-06-28 19:52 | DrKnS | Status | feedback => closed |
| 2011-06-28 19:52 | DrKnS | Resolution | reopened => fixed |