mu icon indicating copy to clipboard operation
mu copied to clipboard

Mu 1.1.1 on macOS 12.4 (M1): min window height & width seems to be 50% of monitor. Way too wide on 49" wide screen monitor.

Open haikusw opened this issue 3 years ago • 1 comments

What were you trying to do?

Run Mu for first time.

What steps did you take to trigger the issue?

Launch Mu and it opens a window that is way way way wider than it needs to be. Tried to resize it smaller - no can do!

Play with resizing height and width and determine that it appears the minimum width and height were set to be 50% of the screen height and width (an unfortunate assumption) instead of basing it on the window content (toolbar items or whatever) or just allowing the user to indicate how small they want the window to be.

Update: comment here confirms visual idea that it was 50% https://github.com/mu-editor/mu/issues/2315#issuecomment-1191922836

What did you expect to happen?

I should be able to resize the window down to as small as I, the user who should be in charge, wish to.

What actually happened?

On a 49" widescreen monitor this makes for a window with a max width of roughly 2560 pixels wide when the toolbar icons need only 1040 pixels to fit all their content.

From a UX perspective, the programmer should not decide what the minimum "usable" width is. The user may have a use case that is different than anything you can imagine. The only real limit should probably be: no smaller than the minimum that still allows the user to expand the window back to a more reasonable size.

One could argue that it should not go smaller than the minimum width necessary to display all the toolbar icons; I would counter by saying that this ignores use cases where the user may wish to make it smaller to the point where it's wide enough to still read the code (which they may have written at only 60 characters per line) for a situation where they want to refer to the code but don't need to interact with the toolbar icons, just as a for-example.

This is the minimum size on macOS with a Samsung 49" curved display:

Screen Shot 2022-07-21 at 1 42 36 PM

Operating System Version

macOS 12.4

Mu Version

1.1.1

Other Info

No response

Editor Log

2022-07-21 13:44:55,491 - root:269(run) INFO: 

-----------------

Starting Mu 1.1.1
2022-07-21 13:44:55,491 - root:270(run) INFO: uname_result(system='Darwin', node='HaikuSilly.domain', release='21.5.0', version='Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101', machine='x86_64', processor='i386')
2022-07-21 13:44:55,508 - root:271(run) INFO: Platform: macOS-10.16-x86_64-i386-64bit
2022-07-21 13:44:55,508 - root:272(run) INFO: Python path: ['/', '/Applications/Mu Editor.app/Contents/Resources/Python/lib/python38.zip', '/Applications/Mu Editor.app/Contents/Resources/Python/lib/python3.8', '/Applications/Mu Editor.app/Contents/Resources/Python/lib/python3.8/lib-dynload', '/Applications/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages', '/Applications/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/setuptools-57.4.0-py3.8.egg', '/Applications/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/pip-21.1.3-py3.8.egg']
2022-07-21 13:44:55,508 - root:273(run) INFO: Language code: en_US
2022-07-21 13:44:55,508 - mu.settings:220(load) WARNING: No settings file found at /Users/tyler/Library/Application Support/mu/settings.json; skipping
2022-07-21 13:44:55,736 - mu.virtual_environment:585(ensure_and_create) INFO: Added log handler.
2022-07-21 13:44:55,737 - mu.virtual_environment:596(ensure_and_create) DEBUG: Checking virtual environment; attempt #1.
2022-07-21 13:44:55,737 - mu.virtual_environment:685(ensure_path) INFO: Virtual Environment found at: /Users/tyler/Library/Application Support/mu/mu_venv-38-20220721-121304
2022-07-21 13:44:55,737 - mu.virtual_environment:698(ensure_interpreter) INFO: Interpreter found at: /Users/tyler/Library/Application Support/mu/mu_venv-38-20220721-121304/bin/python
2022-07-21 13:44:55,737 - mu.virtual_environment:429(run_subprocess) INFO: Running ('/Users/tyler/Library/Application Support/mu/mu_venv-38-20220721-121304/bin/python', '-c', 'import sys; print("%s%s" % sys.version_info[:2])') with kwargs {'shell': False}
2022-07-21 13:44:55,946 - mu.virtual_environment:441(run_subprocess) DEBUG: Process returned 0; output: 38
2022-07-21 13:44:55,946 - mu.virtual_environment:730(ensure_interpreter_version) INFO: Both interpreters at version 38
2022-07-21 13:44:55,947 - mu.virtual_environment:759(ensure_pip) INFO: Pip found at: /Users/tyler/Library/Application Support/mu/mu_venv-38-20220721-121304/bin/pip
2022-07-21 13:44:55,949 - mu.virtual_environment:742(ensure_key_modules) DEBUG: Verifying import of: pgzero
2022-07-21 13:44:55,949 - mu.virtual_environment:429(run_subprocess) INFO: Running ('/Users/tyler/Library/Application Support/mu/mu_venv-38-20220721-121304/bin/python', '-c', 'import pgzero') with kwargs {'shell': False}
2022-07-21 13:44:55,980 - mu.virtual_environment:441(run_subprocess) DEBUG: Process returned 0; output: 
2022-07-21 13:44:55,980 - mu.virtual_environment:742(ensure_key_modules) DEBUG: Verifying import of: flask
2022-07-21 13:44:55,981 - mu.virtual_environment:429(run_subprocess) INFO: Running ('/Users/tyler/Library/Application Support/mu/mu_venv-38-20220721-121304/bin/python', '-c', 'import flask') with kwargs {'shell': False}
2022-07-21 13:44:56,154 - mu.virtual_environment:441(run_subprocess) DEBUG: Process returned 0; output: 
2022-07-21 13:44:56,154 - mu.virtual_environment:742(ensure_key_modules) DEBUG: Verifying import of: ipykernel
2022-07-21 13:44:56,155 - mu.virtual_environment:429(run_subprocess) INFO: Running ('/Users/tyler/Library/Application Support/mu/mu_venv-38-20220721-121304/bin/python', '-c', 'import ipykernel') with kwargs {'shell': False}
2022-07-21 13:44:56,558 - mu.virtual_environment:441(run_subprocess) DEBUG: Process returned 0; output: 
2022-07-21 13:44:56,558 - mu.virtual_environment:742(ensure_key_modules) DEBUG: Verifying import of: ipython_genutils
2022-07-21 13:44:56,558 - mu.virtual_environment:429(run_subprocess) INFO: Running ('/Users/tyler/Library/Application Support/mu/mu_venv-38-20220721-121304/bin/python', '-c', 'import ipython_genutils') with kwargs {'shell': False}
2022-07-21 13:44:56,588 - mu.virtual_environment:441(run_subprocess) DEBUG: Process returned 0; output: 
2022-07-21 13:44:56,588 - mu.virtual_environment:742(ensure_key_modules) DEBUG: Verifying import of: esptool
2022-07-21 13:44:56,588 - mu.virtual_environment:429(run_subprocess) INFO: Running ('/Users/tyler/Library/Application Support/mu/mu_venv-38-20220721-121304/bin/python', '-c', 'import esptool') with kwargs {'shell': False}
2022-07-21 13:44:56,643 - mu.virtual_environment:441(run_subprocess) DEBUG: Process returned 0; output: 
2022-07-21 13:44:56,643 - mu.virtual_environment:628(ensure_and_create) INFO: Valid virtual environment found at /Users/tyler/Library/Application Support/mu/mu_venv-38-20220721-121304
2022-07-21 13:44:56,643 - mu.settings:169(save) DEBUG: Saving to /Users/tyler/Library/Application Support/mu/venv.json
2022-07-21 13:44:56,668 - mu.logic:768(__init__) INFO: Setting up editor.
2022-07-21 13:44:56,669 - mu.logic:789(__init__) INFO: Log directory: /Users/tyler/Library/Logs/mu
2022-07-21 13:44:56,669 - mu.logic:790(__init__) INFO: Data directory: /Users/tyler/Library/Application Support/mu
2022-07-21 13:44:56,669 - mu.logic:804(setup) INFO: Available modes: python, circuitpython, microbit, esp, web, pyboard, debugger, pygamezero, lego, pico
2022-07-21 13:44:56,669 - mu.modes.base:61(get_default_workspace) INFO: Using workspace /Users/tyler/mu_code from settings file
2022-07-21 13:44:56,712 - mu.modes.base:61(get_default_workspace) INFO: Using workspace /Users/tyler/mu_code from settings file
2022-07-21 13:44:56,712 - mu.logic:1549(change_mode) INFO: Workspace directory: /Users/tyler/mu_code
2022-07-21 13:44:56,712 - mu.logic:878(restore_session) DEBUG: <SessionSettings from /Users/tyler/Library/Application Support/mu/session.json>
2022-07-21 13:44:56,716 - mu.logic:900(restore_session) INFO: Loaded files.
2022-07-21 13:44:56,716 - mu.logic:906(restore_session) INFO: User defined environment variables: {}
2022-07-21 13:44:56,716 - mu.logic:911(restore_session) INFO: Minify scripts on micro:bit? False
2022-07-21 13:44:56,745 - mu.modes.base:61(get_default_workspace) INFO: Using workspace /Users/tyler/mu_code from settings file
2022-07-21 13:44:56,754 - mu.interface.main:1033(show_message) DEBUG: Could not find an attached CircuitPython device.
2022-07-21 13:44:56,754 - mu.interface.main:1034(show_message) DEBUG: Python files for CircuitPython devices are stored on the device. Therefore, to edit these files you need to have the device plugged in. Until you plug in a device, Mu will use the directory found here:

 /Users/tyler/mu_code

...to store your code.
2022-07-21 13:44:58,667 - mu.logic:1549(change_mode) INFO: Workspace directory: /Users/tyler/mu_code
2022-07-21 13:44:58,759 - mu.logic:962(restore_session) INFO: Starting with blank file.
2022-07-21 13:44:59,781 - mu.logic:1416(show_admin) INFO: Showing admin with logs from /Users/tyler/Library/Logs/mu/mu.log
2022-07-21 13:44:59,781 - mu.virtual_environment:922(installed_packages) INFO: Discovering installed third party modules in venv.
2022-07-21 13:44:59,782 - mu.virtual_environment:114(run_blocking) INFO: About to run blocking /Users/tyler/Library/Application Support/mu/mu_venv-38-20220721-121304/bin/pip with args ['list', '--disable-pip-version-check'] and envvars {}
2022-07-21 13:45:00,227 - mu.virtual_environment:164(wait) DEBUG: Finished: True; exitStatus 0; exitCode 0
2022-07-21 13:45:00,227 - mu.virtual_environment:249(run) DEBUG: Process output: Package           Version
----------------- -------
appnope           0.1.2
asttokens         2.0.5
backcall          0.2.0
bitstring         3.1.9
black             22.1.0
cffi              1.15.0
click             8.0.4
cryptography      36.0.1
decorator         5.1.1
ecdsa             0.17.0
entrypoints       0.4
esptool           3.2
executing         0.8.2
Flask             2.0.3
ipykernel         5.5.6
ipython           8.0.1
ipython-genutils  0.2.0
itsdangerous      2.1.0
jedi              0.18.1
Jinja2            3.0.3
jupyter-client    7.1.2
jupyter-core      4.9.2
MarkupSafe        2.1.0
matplotlib-inline 0.1.3
mypy-extensions   0.4.3
nest-asyncio      1.5.4
numpy             1.22.2
parso             0.8.3
pathspec          0.9.0
pexpect           4.8.0
pgzero            1.2.1
pickleshare       0.7.5
pip               22.0.3
platformdirs      2.5.1
prompt-toolkit    3.0.28
ptyprocess        0.7.0
pure-eval         0.2.2
pycparser         2.21
pygame            2.1.2
Pygments          2.11.2
pyserial          3.5
python-dateutil   2.8.2
pyzmq             22.3.0
reedsolo          1.5.4
setuptools        60.9.3
six               1.16.0
stack-data        0.2.0
tomli             2.0.1
tornado           6.1
traitlets         5.1.1
typing_extensions 4.1.1
wcwidth           0.2.5
Werkzeug          2.0.3
wheel             0.37.1
2022-07-21 13:45:00,227 - mu.virtual_environment:931(installed_packages) INFO: []

haikusw avatar Jul 21 '22 20:07 haikusw

Issue is here in class Window's setup method:

        screen_width, screen_height = self.screen_size()
        self.setMinimumSize(screen_width // 2, screen_height // 2)

Suggest you pick a more reasonable default (200 pixels or 400 pixels if you must). Consider that they may be on a small netbook with a small screen and need to make the window small so they can look at two things at once side-by-side, or something.

haikusw avatar Jul 21 '22 20:07 haikusw

I have this fixed. Once my fix for #2375 gets merged into master I'll update my branch fixing this issue and create a PR.

haikusw avatar Dec 25 '22 10:12 haikusw

Season's greetings @haikusw - and thank you so much for the gift of your contribution..! :santa:

Looks like @tjguk has merged the things needed for your fix for this issue. If I'm honest, I think the original reason for setting the dimensions (as you found) is lost in the mists of time. Your solution sounds like a good one. :+1:

ntoll avatar Dec 25 '22 16:12 ntoll

Thank you. I've merged the updated master into my fix branch for this and tested and it resolves the issue. make check all comes up clean and so I've created PR #2377. Cheers.

haikusw avatar Dec 25 '22 22:12 haikusw