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

window resizable and minimizable set to False ignored #1608

Closed
annetracy opened this issue Oct 9, 2022 · 12 comments
Closed

window resizable and minimizable set to False ignored #1608

annetracy opened this issue Oct 9, 2022 · 12 comments
Labels
bug A crash or error in behavior. linux The issue relates Linux support.

Comments

@annetracy
Copy link
Contributor

Describe the bug
When resizable is set to False, the setting is ignored

` #############################################################
## Load the Main Window

    self.main_window = toga.Window(title='Rotate Video',
                                        size=(634 , 370),
                                        resizeable=False,
                                        on_close=self.close_Rotate_Video)

`

To Reproduce
Create a Toga window using the above code.

Expected behavior
The resize button on the Window Decoration should not be available. Thereby making it impossible to select it.

Screenshots

Environment:

Operating System: Manjaro Linux
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Kernel Version: 5.15.71-1-MANJARO (64-bit)
Graphics Platform: X11

GTK2 V 2.24.33
GTK3 V 3.24.34

Python 3.10.7

toga_core-0.3.0.dev38
toga_gtk-0.3.0.dev38

@annetracy annetracy added the bug A crash or error in behavior. label Oct 9, 2022
@freakboy3742
Copy link
Member

Thanks for the report.

To clarify the report - the window has resizing disabled if you grab the window corners; however, the maximize button on the toolbar hasn't been disabled. The window example demonstrates this functionally.

@freakboy3742 freakboy3742 added linux The issue relates Linux support. up-for-grabs labels Oct 10, 2022
@annetracy
Copy link
Contributor Author

@freakboy3742 "To clarify the report - the window has resizing disabled if you grab the window corners; "

Actually, on my system, the window can be made larger, but not smaller, when you grab any of the window edges, corners, sides, top, bottom.

@freakboy3742
Copy link
Member

@annetracy Interesting - sounds like we've got some odd interactions of the window manager at play here.

The "bigger but not smaller" resize behavior has been reported in the past (#1205); AFAICT, the cause is unrelated to the issue of being able to resize at all. Disabling all resizing almost certainly requires a window-level feature to be disabled; the "allow getting smaller" is a bug in how and when the layout algorithm is evaluating window layout.

@annetracy
Copy link
Contributor Author

OK here's the thing.

in toga_gtk.window.init(...

I added the following line.

self.native.set_resizable(self.interface.resizeable)

the window.init code now reads

` def init(self, interface, title, position, size):
self.interface = interface
self.interface._impl = self

    self._is_closing = False

    self.layout = None

    self.native = self._IMPL_CLASS()
    self.native._impl = self

    self.native.connect("delete-event", self.gtk_delete_event)
    self.native.set_default_size(size[0], size[1])

    self.set_title(title)
    self.set_position(position)

    # Set the window deletable/closeable.
    self.native.set_deletable(self.interface.closeable)
    
    self.native.set_resizable(self.interface.resizeable) ## I added this line ##

    self.toolbar_native = None
    self.toolbar_items = None`

The window now functions as I expected... see in the bug report.

@freakboy3742
Copy link
Member

Yup - that's not surprising at all. Most of the time, when there's something fundamental like "resize" not being honoured, it's literally a case of an API endpoint not being hooked up.

Care to try your hand at turning this into a PR?

@annetracy
Copy link
Contributor Author

I would if I knew what a PR was

@annetracy
Copy link
Contributor Author

Ah! Pull Request

@annetracy
Copy link
Contributor Author

I hope I've done that right.

I've edited the file using the create fork method in the browser.

@freakboy3742
Copy link
Member

@annetracy In the case of this feature, the in-browser editor is sufficient, because the fix only requires a change to a single file. If you're planning to make a larger contribution (e.g., something that requires editing more than one file), you'll need to become familiar with Github's contribution workflow.

@freakboy3742
Copy link
Member

Fixed by #1609.

@annetracy
Copy link
Contributor Author

Thanks... in the meantime I'm working my way through understanding the whole clone to local, Pull commit to my remote, thing. It way, way different from what I was used to in my working life.

@freakboy3742
Copy link
Member

It's definitely a different way of looking at development, and there's a learning curve. All I can say is that the effort is worth it. Pretty much all Open Source development uses some variation on that theme. Even if you're not contributing to Open Source projects, having good version control and pull request handling can radically change how you view development of your own private projects.

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

No branches or pull requests

1 participant