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

Add parameter to disable windows resizing #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

barnas-michal
Copy link

Add "-R" parameter which disables resizing of windows after moving them

Comment on lines +39 to +42
if args.no_resize:
new_window_geometry.w = window_geometry.w
new_window_geometry.h = window_geometry.h

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot test it for the moment. Can you elaborate a little bit on what you try to do ?
If you want to keep the initial size of the window, why not use initial_window_geometry instead of window_geometry.
Actually, I don’t remember the difference between these both variables. Do we need 2 different ones or can we use the same ?

Anyway, instead of overriding the new_window_geometry fields, I would recommend something like:

Suggested change
if args.no_resize:
new_window_geometry.w = window_geometry.w
new_window_geometry.h = window_geometry.h
if args.no_resize:
win.geometry = initial_window_geometry
else:
new_window_geometry = relative_geometry.build_absolute(new_screen)
_logger.debug("New window geometry: %s", new_window_geometry)
win.geometry = new_window_geometry

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build_relative and build_absolute calculates the position as percentage to the container, so I wanted to leave the change of the position, so the window will be in the proportional part of the other screen, but with unchanged size. It's mostly for terminal, because moving it repeatedly between monitors, shrinks it with every move. It's because the xfce terminal has size limitation to the multiplies of the font size.
However if you think that leaving also the position makes more sense, I can change that with your suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants