Skip to content

Conversation

afh
Copy link

@afh afh commented Apr 25, 2021

I noticed that for gut-metal drawterm ignores the -g geometry option and always places the drawterm window in the center of the screen at ¾ of the screen size.

The changes in this PR set the position and size of the drawterm window according to the -g geometry option and defaulting to the existing behaviour when the -g option has not been given.

@jxy
Copy link
Collaborator

jxy commented Apr 26, 2021

Thanks. I guess you want it to be the same as X11. In this case, what would happen if I give the following: width, width-off, widthxheight-off, xheight, xheight-off, -off, -off-off, ...

@afh
Copy link
Author

afh commented Apr 26, 2021

Great feedback @jxy, I went ahead and added ParseGeom.c from Xenocara to handle the parsing of the geometry string.

To answer your question when given:

  • width: drawterm's width is width and the height is calculated from the given width using the golden ration (1.61833), x and y are 0
  • width-off: drawterm's width is width and the height is calculated from the given width using the golden ration (1.61833), x is off and y is 0
  • widthxheight-off: drawterm's width is width and the height is height , x is off and y is 0
  • xheight: drawterm's height is height and the width is calculated from the given height using the golden ration (1.61833), x and y are 0
  • xheight-off: drawterm's height is height and the width is calculated from the given height using the golden ration (1.61833), x is off and y is 0
  • -off: drawterm's width is ¾ of the screen width and the height ¾ of the screen height, x is off and y is 0
  • -xoff-yoff: drawterm's width is ¾ of the screen width and the height ¾ of the screen height, x is xoff and y is off

@afh
Copy link
Author

afh commented May 14, 2021

@jxy Mind having another look at the latest changes to this PR?

@jxy
Copy link
Collaborator

jxy commented May 18, 2021

Just to make sure, is the geometry passed in for the frame rectangle? Do we still need config.h?

@afh
Copy link
Author

afh commented May 19, 2021

Thanks for the feedback @jxy.

I'm not sure I entirely understand your question about the frame rectangle, could you rephrase please?
To answer what I think you asked:
Yes, If drawterm is run with the -g 1200x900+50-100 option then the resulting drawterm window on macOS will be 1200 points wide 900 points high and it is placed 50 points from the top of the screen and 100 points from the right of the screen.

The changes in this PR do not contain config.h file. If on the other hand you refer to the inclusion of config.h in ParseGeom.c:30f, then no that isn't needed. Ideally it would be possible to include ParseGeom.c without any modifications, but if that creates problems with a config.h that may be generated when building drawterm, then I think it's a good idea to remove it.

@jxy
Copy link
Collaborator

jxy commented May 19, 2021

Right, it is specified as the window size and location, but not the content size, which would be smaller. If it's what this parameter is supposed to do, it's fine.

There's no point in leaving unused code in there, so perhaps just remove the whole ifdef.

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