Open GoogleCodeExporter opened 8 years ago
here is a diff...
$ diff winmain.c winmainx.c
765a766
> " -x, --center Open window in center of screen\n"
780c781
< static const char short_opts[] = "+:HVuec:o:p:s:w:t:i:l:h:";
---
> static const char short_opts[] = "+:HVeuxc:o:p:s:w:t:i:l:h:";
787a789
> {"center", no_argument, 0, 'x'},
868a871
> bool center = false;
901a905
> when 'x': center = true;
1060a1065,1075
>
> if (center) {
> static RECT ss;
> get_fullscreen_rect(&ss);
> SetWindowPos(wnd, null,
> (ss.right - (term_width + extra_width + 2 * PADDING))/2,
> (ss.bottom - (term_height + extra_height + 2 * PADDING))/2,
> term_width + extra_width + 2 * PADDING,
> term_height + extra_height + 2 * PADDING,
> SWP_NOZORDER);
> }
Original comment by akt...@gmail.com
on 6 Aug 2010 at 4:08
Good work, but no, I wouldn't want to add this as a separate option. However, I
could imagine adding it as a special argument to the --position option, along
with support for the four edges, so you could say something like
'--position=right,top' or '-position=centre,centre'.
I'm not really convinced that this is necessary though, because the existing
--position functionality already supports these use cases; it's just that it
might require a bit of experimentation to find the right coordinates.
Original comment by andy.koppe
on 6 Aug 2010 at 5:24
I agree that adding to the existing -p option is better, my current c skills
would not let me go there without actually looking something up! This was for
a script that gets kicked off after an install, so who knows what res screen it
would run on, and folks wanted it centered like the installer that came before
it.
Original comment by akt...@gmail.com
on 6 Aug 2010 at 12:31
Thanks, that's a valid new use case (although perhaps not a very common one).
Original comment by andy.koppe
on 7 Aug 2010 at 6:02
Implemented, see https://github.com/mintty/mintty/issues/208
Original comment by towom...@googlemail.com
on 30 Jul 2015 at 3:40
Original issue reported on code.google.com by
akt...@gmail.com
on 6 Aug 2010 at 4:06Attachments: