Skip to content

IDLE: Improve zoomheight doc and behavior. #81220

Closed

Description

@terryjreedy
BPO 37039
Nosy @terryjreedy, @taleinat, @aroberge, @serhiy-storchaka, @csabella, @miss-islington
PRs
  • bpo-37039: IDLE - zoomheight fixes #13576
  • [3.7] bpo-37039: IDLE - zoomheight fixes (GH-13576) #13602
  • bpo-37039: Make IDLE's Zoom Height adjust to users' screens #13678
  • [3.7] bpo-37039: Make IDLE's Zoom Height adjust to users' screens (GH-13678) #14167
  • [3.8] bpo-37039: Make IDLE's Zoom Height adjust to users' screens (GH-13678) #14168
  • Files
  • image.png
  • image.png
  • image.png
  • 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:

    assignee = 'https://github.com/terryjreedy'
    closed_at = <Date 2019-06-17.20:17:35.114>
    created_at = <Date 2019-05-25.01:15:52.063>
    labels = ['3.8', 'expert-IDLE', 'type-bug', '3.7', '3.9']
    title = 'IDLE: Improve zoomheight doc and behavior.'
    updated_at = <Date 2019-06-17.20:32:18.338>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2019-06-17.20:32:18.338>
    actor = 'taleinat'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2019-06-17.20:17:35.114>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2019-05-25.01:15:52.063>
    creator = 'terry.reedy'
    dependencies = []
    files = ['48358', '48359', '48360']
    hgrepos = []
    issue_num = 37039
    keywords = ['patch']
    message_count = 26.0
    messages = ['343450', '343468', '343469', '343490', '343507', '343517', '343518', '343521', '343526', '343528', '343534', '343545', '343565', '343689', '343690', '343702', '343703', '343711', '343751', '343963', '343965', '345891', '345895', '345899', '345900', '345902']
    nosy_count = 6.0
    nosy_names = ['terry.reedy', 'taleinat', 'aroberge', 'serhiy.storchaka', 'cheryl.sabella', 'miss-islington']
    pr_nums = ['13576', '13602', '13678', '14167', '14168']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue37039'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    Activity

    1. terryjreedy commented on May 25, 2019

      @terryjreedy
      MemberAuthor

      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.

    2. changed the title [-]IDLE: Zoomheight restores to default, not previous size[/-] [+]IDLE: Zoom Height Restore restores to default, not previous size[/+] on May 25, 2019
    3. self-assigned this
      on May 25, 2019
    4. aroberge commented on May 25, 2019

      arobergemannequin
      Mannequin

      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.

    5. aroberge commented on May 25, 2019

      arobergemannequin
      Mannequin

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

    6. terryjreedy commented on May 25, 2019

      @terryjreedy
      MemberAuthor

      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.

    7. terryjreedy commented on May 25, 2019

      @terryjreedy
      MemberAuthor
      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('').
      https://www.tcl.tk/man/tcl8.6/TkCmd/wm.htm#M42 says
      "If newGeometry is specified as an empty string then any existing user-specified geometry for window is cancelled, and the window will revert to the size requested internally by its widgets."

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

    8. changed the title [-]IDLE: Zoom Height Restore restores to default, not previous size[/-] [+]IDLE: Improve zoomheight doc and behavior.[/+] on May 25, 2019
    9. terryjreedy commented on May 25, 2019

      @terryjreedy
      MemberAuthor

      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.

    10. terryjreedy commented on May 25, 2019

      @terryjreedy
      MemberAuthor

      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.

    11. aroberge commented on May 25, 2019

      arobergemannequin
      Mannequin

      Thanks.

      I did a quick check. 114 solves the problem of the Restore Height not
      working, but the status bar is still hidden. To me, the crucial part of
      the problem was the restore height not working, so I'd be happy with this.

      At 164, I can see parts of the status bar
      [image: image.png]

      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
      essentially invisible. Because of this huge resolution, most display
      elements (text, icons ... and the taskbar) are set up to be twice as big -
      this is the 200% factor I was referring to. So, in pixel terms, the taskbar
      on my computer is likely twice as high as yours.

      Using a measuring tape, the physical size of my screen is 183 mm; the
      taskbar is 8 mm high.

      I can add these comments (and screenshots?) on the bug tracker if you'd
      like.

      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
      my project. The last time I had used IDLE was with Python 2.4 - I quickly
      moved on to using other editors. There's been tremendous progress since and
      I want to thank you for all your work.

      On Sat, May 25, 2019 at 7:11 PM Terry J. Reedy <report@bugs.python.org>
      wrote:

      Terry J. Reedy <tjreedy@udel.edu> added the comment:

      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.

      ----------


      Python tracker <report@bugs.python.org>
      <https://bugs.python.org/issue37039\>


    12. 6 remaining items

    13. aroberge commented on May 27, 2019

      arobergemannequin
      Mannequin

      I volunteer to do some testing. In addition to the problem I noted on my
      computer where the status bar disappeared behind the task bar, I noticed
      that on my secondary 4k monitor (resolution: 3840 x 2160), clicking Zoom
      Height resulted in a window stretched only about 2/3 of the maximum screen
      height - so, the opposite "problem".

    14. terryjreedy commented on May 27, 2019

      @terryjreedy
      MemberAuthor

      New changeset df9b032 by Terry Jan Reedy in branch 'master':
      bpo-37039: IDLE - zoomheight fixes (GH-13576)
      df9b032

    15. terryjreedy commented on May 27, 2019

      @terryjreedy
      MemberAuthor

      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
      new_y = 22 if macosx.isAquaTk() else 0
      unless we can get it also from the maximized window geometry.

      "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.

    16. miss-islington commented on May 27, 2019

      @miss-islington
      Contributor

      New changeset abdda3a by Miss Islington (bot) in branch '3.7':
      bpo-37039: IDLE - zoomheight fixes (GH-13576)
      abdda3a

    17. taleinat commented on May 28, 2019

      @taleinat
      Contributor

      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:

      1. save the current window position and size
      2. maximize the current window
      3. set the horizontal position and width to their original values

      There is a visual artifact when doing so - the window is seen to maximize and then return to its original width.

    18. taleinat commented on May 30, 2019

      @taleinat
      Contributor

      See an implementation in PR #57887.

    19. aroberge commented on May 30, 2019

      arobergemannequin
      Mannequin

      As I wrote on Github:

      On my computer (Windows 10, resolution: 3000 x 2000, scaling of UI elements
      set to 200%), clicking on Zoom Height makes Idle go full screen. Clicking
      on the same menu (now called Restore Height) does absolutely nothing: Idle
      stays in full screen mode.

      If I run the program on a secondary monitor (4k), the height only changes,
      but nowhere enough to be equal to the height of the screen.

    20. terryjreedy commented on Jun 17, 2019

      @terryjreedy
      MemberAuthor

      New changeset 5bff3c8 by Terry Jan Reedy (Tal Einat) in branch 'master':
      bpo-37039: Make IDLE's Zoom Height adjust to users' screens (GH-13678)
      5bff3c8

    21. miss-islington commented on Jun 17, 2019

      @miss-islington
      Contributor

      New changeset 0f31a2d by Miss Islington (bot) in branch '3.7':
      bpo-37039: Make IDLE's Zoom Height adjust to users' screens (GH-13678)
      0f31a2d

    22. terryjreedy commented on Jun 17, 2019

      @terryjreedy
      MemberAuthor

      New changeset 4b68a8e by Terry Jan Reedy (Miss Islington (bot)) in branch '3.8':
      bpo-37039: Make IDLE's Zoom Height adjust to users' screens (GH-13678) (GH-14168)
      4b68a8e

    23. terryjreedy commented on Jun 17, 2019

      @terryjreedy
      MemberAuthor

      Thank you Andre for the reports and followup and Tal for the research. I can start using this now.

    24. taleinat commented on Jun 17, 2019

      @taleinat
      Contributor

      Hey, I did the implementation too! :)

      I'm really happy to see this fixed in time for 3.8.

    25. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions