Skip to content

Parsing command line geometry #564

Description

@jholveck

This only affects the command line interface, what you get with python3 -m mss.

In #562 I added the ability to parse X11-style coordinates (WIDTHxHEIGHT+LEFT+TOP) on the command line, in addition to the existing style (TOP,LEFT,WIDTH,HEIGHT). I included that negative LEFT and TOP are handled as insets from the right or bottom edge.

But I forgot that on Windows, negative left and top can be valid coordinates.

I'm deciding what to do, and would like the opinions of @halldorfannar and @BoboTiG . I could see:

  1. Parsing negative LEFT and TOP as insets if given an X11 style geometry, and as negative coordinates with a comma style geometry. Not thrilled about the asymmetry.
  2. Parsing negative LEFT and TOP as negative coordinates always. Not thrilled about breaking with the way that XParseGeometry and all the X programs out there interpret it. But then again, negative values are rare to see in the wild for WIDTH and HEIGHT.
  3. Do one thing on Linux, and another on Windows. Definitely not thrilled with that idea.

I'm sure there are other possibilities.

Either way, I'll need to succinctly document how it's parsed for the --help string.

Any strong opinions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions