Skip to content
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

Making a window with certain widgets smaller doesn't work on Ubuntu 18.04 and 20.04 #1205

Closed
rknuus opened this issue Feb 6, 2021 · 5 comments · Fixed by #1794
Closed

Making a window with certain widgets smaller doesn't work on Ubuntu 18.04 and 20.04 #1205

rknuus opened this issue Feb 6, 2021 · 5 comments · Fixed by #1794
Labels
bug A crash or error in behavior. linux The issue relates Linux support.

Comments

@rknuus
Copy link
Contributor

rknuus commented Feb 6, 2021

Description
When resizing a window of an application containing a WebView or a MultilineTextInput widget, making it bigger works, but making it smaller doesn't work. Neither horizontally nor vertically. Note that only a few widgets seem to prevent shrinking, e.g. the window of the hello world tutorial application works fine.

To Reproduce

  1. Set up an Ubuntu 18.04 or 20.04 development environment (e.g. using https://github.com/rknuus/toga-dependency-verification).
  2. Start the browser app of the tutorial.
  3. Resize the window, particularly try to make it smaller.

Expected behavior
The window size changes in both directions.

Environment:

  • Operating System:
    • Ubuntu 18.04 with GTK+ version 3.22.30-1ubuntu4 of libgtk-3-0 and version 2.24-32-1ubuntu1 of libgtk2.0-0
    • Ubuntu 20.04 with GTK+ version 3.24-20-0ubuntu1 of libgtk-3-0 and version 2.24-32-4ubuntu4 of libgtk2.0-0
  • Python version: 3.6.9 on Ubuntu 18.04 resp. 3.8.5 on Ubuntu 20.04
  • Software versions:
    • Toga: 0.3.0.dev26
@rknuus rknuus added the bug A crash or error in behavior. label Feb 6, 2021
@MuhammadMuradG
Copy link
Contributor

MuhammadMuradG commented Mar 9, 2021

Hi, @rknuus,

Thanks for your report. This is not a bug, this behavior is intended, we decided to determine a minimum height and width (=200px) for the webview widget and (=100px) for multilinetextinput widget to add some control in our design and to avoid unexpected behavior.

@freakboy3742, are there any other reasons, could you please mention them?

@rknuus
Copy link
Contributor Author

rknuus commented Mar 10, 2021

Perhaps my problem description was not accurate, my apologies.

I understand that certain widgets have some minimal space requirements. My issue is, that starting from the default size I can make the window bigger, but then I can never make it smaller again, even though the window is now bigger than it was initially, i.e. making it a bit smaller should not violate the minimal space requirements.

@freakboy3742
Copy link
Member

Thanks for the report. I think I've seen this in the past, but wasn't able to narrow down a specific reproduction case.

IIRC it's only an issue on Ubuntu; the underlying problem is that once the geometry is laid out for a window, that is enforcing a minimum size on the window; and the next time it tries to re-evaluate the layout geometry, that minimum size is being enforced on the new layout. This way, a window can continue to get bigger, but can never shrink. If the issue exists on webview and multiline text, that suggests the issue is the way those widgets are re-hinting their size.

@MuhammadMuradG
Copy link
Contributor

MuhammadMuradG commented Mar 14, 2021

Thanks @rknuus and @freakboy3742 for your clarification, I got the problem. I submitted the #1224 PR for solve this issue with some code cleaning for webview widget.

@MuhammadMuradG
Copy link
Contributor

MuhammadMuradG commented Mar 23, 2021

This bug needs some work my #1224 PR will not solve it perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. linux The issue relates Linux support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants