-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
IDLE: Improve zoomheight doc and behavior. #81220
Comments
Restore Height restores to default, not previous size. This is a bit surprising, but is documented. "Toggles the window between normal size and maximum height. The initial size defaults to 40 lines by 80 chars unless changed on the General tab of the Configure IDLE dialog." AFAIK, this has always been the case. The switch from 'normal size' to 'initial size' might make this a little less clear than sticking to 'normal'. Also, only height, not width is relevant. It could be noted that 'normal' != 'previous'. This entry is above the code context entry in the doc, but the changed menu entry is below the code context menu entry (at my request, I believe). Both were moved from the Window menu in bpo-22703. The doc entry needs to be moved down. Side note: this is an example of where a popup menu hint would be helpful. I will make a PR. |
As reported on the idle-dev list, on my system (Windows 10, display resolution 3200 x 200, scaling of text at 200% as recommended), the Zoom Height changes the height of the window and Idle's status bar is no longer visible. Clicking on Restore Height does nothing: Idle's window does not return to the default (the size it had when it was open); it stays the same with the status bar either hidden behind the task bar. |
I have tried on another computer (Windows 10, screen resolution 1920 x 1080, text scaling 100%) and it works as expected: clicking on Restore Height restores the window's height to its original value. Back to the computer where I reported the problem: changing the scaling from 200% to 100% (which makes everything nearly unreadable) does not solve the problem. Both tests were done with Python 3.7.3 (32 bit). |
Andre Roberge reported on idle-dev that Restore Height has no effect for him with Python 3.7.3, 32 bit, on Windows 10. Since it works for me on Win 10, 3.7.3-32 bit local debug build and 3.7.3-64 bit installed and ditto for 3.8, I am initially baffled. Andre, the only way I know to debug this is for you to add debug prints to zoomheight.py and start IDLE in a console, to see the print output, with 'py -m idlelib' (add -3.7 if needed). The first thing I can think of is 'print(geom)' and 'print(newgeom)' in zoom_height() after they are fetched and defined near the top and bottom. |
I have a 27" 2560X1440 screen. For me:
>>> import tkinter; tkinter.Tk().tk.call('tk', 'scaling')
1.333... I presume 3200x200 should be 3200x2000 and that the diagonal size is small enough that the screen is a HiDPI screen, making tk's scaling above 1.4, so that run.fix_scaling() adjusts font sizes. I am not sure what you mean by 'scaling at 100%/200%' other than tk scaling <, >= 1.4 or HiDPI no/yes, or how you changed the scaling. I grepped idlelib for 'scaling' and only found references to the function and the tk call. In any case, tcl/tk does not properly support HiDPI screens. Serhiy Storchaka contributed fix_scaling to make IDLE readable on a HiDPI Linux laptop. The 1.4 and .75 values are empirical. With help from Windows experts, I added the SetProcessDpiAwareness call near the top of pyshell when a Windows user with a HiDPI screen reported a problem on idledev. I believe that the call tells Windows that IDLE already makes a scaling adjustment, so it should not also do so. zoomheight.zoom_height() restores by calling top.wm_geometry(''). This works for normal screens but somehow not for your HiDPI Windows screen. Can you do the print experiment I suggested previously? I will experiment to see how much '22' needs to be increased for Windows to accomodate the task bar. What is really needed is to determine the size and orientation of the taskbar, or rather the remaining 'full-screen' height. Serhiy, do you still have a HiDPI screen? If so, does Options => Zoom/Restore Height work for you? Do Linux desktop managers have bottom panels or taskbars that can cover part of a zoomed window? Ignore any task bar over status bar issue.) |
Tal, how is zoom/restore height working on your Mac? On my updated Macbook Air Mohave, the zoom bottom margin of 88 is too large. Since IDLE starts fully zoomed on this small screen, I determined this by shrinking Shell and then zooming it. The result leaves a margin between IDLE and the app panel, which goes away when restoring to initial state. But I want to know if 88 is too large on other machines before I change it. |
The current patch fixed the hidden status bar on Windows. I just had to increase the margin reserved for the taskbar from 76 to 114. This will also work if the taskbar is moved to the top of the screen. If the taskbar is moved to either side or if it is less high for previous versions of Windows, a visible margin is better than a hidden status bar. |
Thanks. I did a quick check. 114 solves the problem of the Restore Height not At 164, I can see parts of the status bar At 180, there is a tiny gap [image: image.png] 178 seems to be just touching. [image: image.png] With the vertical resolution of my screen being 2000 px, tiny gaps are Using a measuring tape, the physical size of my screen is 183 mm; the I can add these comments (and screenshots?) on the bug tracker if you'd Thanks for finding the solution to this problem. André P.S. I *just* started using IDLE again as I want to use it as a basis for On Sat, May 25, 2019 at 7:11 PM Terry J. Reedy <report@bugs.python.org>
|
Thank you. Along with your path browser report, things are much Under 'Advanced scaling settings', one can enter a custom scaling size. No need to post what you wrote. Let me summarize the numbers I want What I need to do now is examine the tk screen sizing system and On 5/25/2019 6:42 PM, Andre Roberge wrote:
|
On Sat, May 25, 2019 at 9:49 PM Terry J. Reedy <report@bugs.python.org>
Yes, that's the settings I was talking about (my OS is in French, so I Mine is set at 200%, as recommended by Windows - and which makes the text My taskbar is 11+mm high. 78 or something near
Yes, see above.
I think that would possibly work out best - people could customize to their André
|
Andre, we need to severely trim quotes when posting by email. A summary with added info. Andre: 2000 pixels / 183 mm = 10.9 pixels / mm I don't see now to get from px/mm, settings, and bar height to the needed zoom correction. Conclusion 1: The previous Windows zoom margin of 78 is likely better for people with stock Windows (text size = 100%), making the change to 114 in PR 13575 wrong for them. Conclusion 3: We need to somehow calculate a specific correction from information available from tkinter. If necessary, add a 'Configurtion' button to the Options menu or Settings dialog. Display a maximized text window, have user verify that it fits properly, and get geometry. |
I do not have "Zoom/Restore Height". I have only "Restore Height" which maximizes the height. The result looks identical with and without PR 13576 applied. There is no overlapping nor gap between the IDLE windows and the bottom panel. |
When you start, it should say 'Zoom Height', then 'Restore Height' after you maximize. But if on a screen small enough that the initial height is the same as zoomed, IDLE might get confused. No change on Linux in the PR is the intention, so that is good. |
To get the maximum available height, does Tk's wm_maxsize() not work? https://www.tcl.tk/man/tcl8.6/TkCmd/wm.htm#M54 Answering my own question above: No, it gives the total screen height, which doesn't ignore e.g. taskbars. The best way to get the actual available height appears to be:
Testing on Windows, this does respect the taskbar, as well as scaling in the display settings. (Also note that Tk window heights appear not to include the window manager's title bar.) I've yet to test on other OSs, but I've seen this method recommended before, and it has the potential to be robust. Terry, would you like to see a PR with such an implementation? |
I volunteer to do some testing. In addition to the problem I noted on my |
Tal, please go ahead after updating your repository. I just merged PR 13576 after reverting the change from 72 to 114 that only works for me and adding Skip News. Include a blurb with your patch. It only needs to include something like "Fix zoom height calculation so that it should work on all monitors, regardless of resolution, pixel density, and display setting." Besides replacing the newheight calculation, the patch will need a a reduced conditional expression "potential to be robust"> I hope so. Your suggestion is part of my 'Conclusion 3 above, but I feared that it might not work at all on a withdrawn window, let alone give us numbers that work. I was unaware of others trying it. Andre, yes, before merging, we should test on multiple (different) Windows systems, as well as other OSes. |
I haven't found a way to maximize a hidden window; being "zoomed" and "withdrawn" are both considered "states" by Tk, and apparently a window cannot be in both states simultaneously. An alternative is, when zooming the height:
There is a visual artifact when doing so - the window is seen to maximize and then return to its original width. |
See an implementation in PR #57887. |
As I wrote on Github: On my computer (Windows 10, resolution: 3000 x 2000, scaling of UI elements If I run the program on a secondary monitor (4k), the height only changes, |
Thank you Andre for the reports and followup and Tal for the research. I can start using this now. |
Hey, I did the implementation too! :) I'm really happy to see this fixed in time for 3.8. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: