How do I tell Leo to start up its main window at a specific window geometry?

55 views
Skip to first unread message

Paul Jackson

unread,
Jul 17, 2019, 6:01:59 AM7/17/19
to leo-editor
I would like Leo to startup with its main window at a specific location (upper left corner at <x,y> == <245, 162>, size of <hor,ver> == <2315, 1276>).

How do I do that?

I am seeing various potentially relevant variables and names in the code, documentation, settings and command line arguments,  such as

fixedwindow
fixed_window
fixedWindow
fixedWindowPosition
fixedWindowPositionData
windowPosition
--window-size=...
--session-restore
--session-save

including a comment in the change history for some release in 2018 that I vaguely recall reading that some of the above no longer mattered, and the above apparent conflicting naming of the {fixedwindow, fixed_window, fixedWindow} boolean that apparently must be True to enable the {fixedWindowPosition, fixedWindowPositionData} setting, and another comment that EKR was unsure whether the {--session-save, --session-restore} worked.

The only variation of this that I have half-way working in a command line argument of "--window-size=1276x2315", but that leaves the window in the wrong position, way too far to the left and down.

I am running the following version of Leo on Gentoo Linux, xfce, openrc, ...:
  Leo 6.0-b1, master branch, build 445dfa149e 2019-06-18 09:45:56 -0500

I suspect that some of the {fixedwindow, fixed_window, fixedWindow} name variants are typos or obsolete names ... but that's just a guess. 

Thanks!

Chris George

unread,
Jul 17, 2019, 9:46:52 AM7/17/19
to leo-e...@googlegroups.com
I use KDE Neon and I just tell the window manager what I want. Leo has nothing to do with it.

YMMV with xfce.

Chris

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/a03140f0-603f-40ff-b05b-c52505e09066%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul Jackson

unread,
Jul 17, 2019, 10:30:01 AM7/17/19
to leo-editor


On Wednesday, July 17, 2019 at 8:46:52 AM UTC-5, Chris George wrote:
I use KDE Neon and I just tell the window manager what I want. Leo has nothing to do with it.

That does not surprise me.  I had also spent some time trying to figure out how to
tell xfce my desired window position/size ... that saga is obviously not Leo's concern.

However when I saw the following sundry settings in the Leo code I thought
that Leo could manage this.  What do these do ... and why the variant
spellings of fixed[_Ww]*indow?

fixedwindow
fixed_window
fixedWindow
fixedWindowPosition
fixedWindowPositionData
windowPosition
--window-size=...
--session-restore
--session-save

Thanks for replying.

Chris George

unread,
Jul 17, 2019, 11:33:28 AM7/17/19
to leo-editor
I think Edward might have to answer that question.

I know that --session-restore and --session-save have both been deprecated as Leo now uses dockwidgets by default and also saves sessions by default.

The window position stuff could be legacy from wx. I don't know.


Chris

Paul Jackson

unread,
Jul 17, 2019, 4:05:33 PM7/17/19
to leo-editor
On Wednesday, July 17, 2019 at 10:33:28 AM UTC-5, Chris George wrote:

    >> I think Edward might have to answer that question.

Sounds likely, yes.

It seems that the X11 window system, that underlies most of the popular Linux windows managers (including xfce) has tools for handling window state.

So the following fussy, fragile, and inscrutable one line command, using archaic and arcane xdotool and wmctrl X11 tools, happens to place my Leo window exactly what I want:

leo & xdotool search --sync --onlyvisible --name leo ; xdotool windowmove $(wmctrl -l -p -G -x | awk '/launchLeo.py/ && $6 > 2000 { print $1 }') 232 107

where "leo" is a binary compiled from the following C code:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#define __unused__ __attribute__((unused))
int main(int argc __unused__, char **argv __unused__)
{
    setenv
("PYTHONPATH", "/usr/lib64/python3.6/site-packages", 1);
    execl
("/usr/bin/python3", "python3", "/home/some_masked_subdir/leo/leo-editor/launchLeo.py", "--window-size=1276x2315", NULL);
    fprintf
(stderr, "exec failed: ");
    perror
("/usr/bin/python3 /home/some_masked_subdir/leo-editor/launchLeo.py");
   
exit(1);
}

All of which is proof that Perl hackers do not have an exclusive patent on "write once, read never" one liners.

Thanks, Chris, for the reminder that it probably wasn't Leo itself that endeavored to manage the placement of its window.  That sufficiently renewed my focus on potential solutions using xfce, or in my case, the underlying X11 tools.

Edward K. Ream

unread,
Jul 24, 2019, 11:48:49 AM7/24/19
to leo-editor
On Wed, Jul 17, 2019 at 5:02 AM Paul Jackson wrote:

I would like Leo to startup with its main window at a specific location.

I have just created #1263 for this. It will go into Leo 6.0 only if the required changes are straightforward.

Edward
Reply all
Reply to author
Forward
0 new messages