Skip to content
This repository was archived by the owner on Jul 18, 2018. It is now read-only.

Window pixel size #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

john-peterson
Copy link
Member

Patch

Allowing an unrestricted window size is beneficial because

  • that doesn't interfere with the size from Snap or WindowPad
  • f.e. mintty and putty offer this feature

Discussion

@Maximus5

What is the reason? What profit you want to get specifying size in pixels?

The answer is given in the pull request message.

On the first look the patch is not correct - window size is calculated in many places and your "pixel size" may be broken in some branches of code....
And your patch suppose size of "console" but not "window", hm?

What additional changes are necessary?

I've planned some changes in resize process. For example: need to remove "IdealRect" mentions from SetWindowMode and all other code... Can't say what changes exactly will be needed after that. But I'll take care about it.

@Maximus5
Copy link

This patch must be more complicated... For example, CVConGroup::SetAllConsoleWindowsSize uses cells instead of pixels...
I'm working on my version, and hope it will be available soon for testing. Also, it will support percents as side by side with pixels and cells.

@john-peterson
Copy link
Member Author

Window size

CVConGroup::SetAllConsoleWindowsSize uses cells instead of pixels

Do you mean that

SetAllConsoleWindowsSize
    SetConsoleSizeSrv
        pIn->SetSize.size.X = pixels instead of letters

should use pixels instead of letters?

What's the benefit of that? considering that

  • partial letters aren't shown in cmd, conhost, minttyor putty
  • i.o.w. if the console client area is 1×1 letters (and one letter is 8×12 pixels) a client area of 15×23 pixels in f.e. mitty will have black instead of partial letters outside the 8×12 area

Does Windows allow an uneven size for cmd? considering that this program that size it

MoveWindow(GetConsoleWindow(), 0,0, 400, 200, true);
RECT r;
GetWindowRect(GetConsoleWindow(), &r);
printf("%d %d", r.right, r.bottom);

return "401 203" instead of "400 200"

@Maximus5
Copy link

Yes, these and many other functions must be changed. But you misunderstand the reason.
RealConsole must works with cells of course, but resize of ConEmu' window must be ready for pixels (and percents of screen, btw), because if not - any event may reset your preferred pixel size and resize ConEmu window to the calculated size (I mean cell*fontsize).

@john-peterson
Copy link
Member Author

Window size

Yes, these and many other functions must be changed. But you misunderstand the reason.
RealConsole must works with cells of course …

How should "CVConGroup::SetAllConsoleWindowsSize" be changed and for what purpose?

… but resize of ConEmu' window must be ready for pixels (and percents of screen, btw), because if not - any event may reset your preferred pixel size and resize ConEmu window to the calculated size (I mean cell*fontsize).

Which event reset the windows size (so that the client area is cell*fontsize)? considering that I've not noticed this with these settings and build of this branch

@Maximus5
Copy link

Look, wndWidth/wndHeight are used in many places of sources.
If you didn't notice any problems - you are lucky... but they may be.

@john-peterson
Copy link
Member Author

Look, wndWidth/wndHeight are used in many places of sources.
If you didn't notice any problems - you are lucky... but they may be.

Which other (beside that in this patch) code will reset the windows size (so that the client area is cell*fontsize)?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants