start retext in a smaller window than default

Asked by dgm on 2014-10-30

I am running retext on an old eee pc 701 SD under crunchbang (debian). The eee has a smaller than usual display. When I start retext the edit window is bigger than the screen meaning it cannot be resized as you can't access the buttons to do this.

An option to set the window size from either the command line or config file would be useful. Currently you appear to be able to save the window geometry, but not set it.

Question information

Language:
English Edit question
Status:
Solved
For:
ReText Edit question
Assignee:
No assignee Edit question
Solved by:
Dmitry Shachnev
Solved:
2014-11-15
Last query:
2014-11-15
Last reply:
2014-11-14
Dmitry Shachnev (mitya57) said : #1

First, enable automatic saving of the geomtry, if you haven't done that already:

mkdir -p "$HOME/.config/ReText project/"
echo "saveWindowGeometry=true" >> "$HOME/.config/ReText project/ReText.conf"

You can move the window using Alt + left mouse button (until the corner is visible), then resize it, and then the position will be saved.

Also, you can open ReText/window.py, find a line that calls resize() (line 38 for me), and change that to a different version. Then the geometry will be saved, and you will be able to change that file back to distro shipped version.

If the above didn't work for some reason, then on most window manager Super + Up Arrow usually maximizes the window. In maximized state, ReText should fit in your screen.

dgm (doug-moncur) said : #2

I have created ~/.config/ReText project and added the setWindowGeometry=
true line as you suggest

The Alt-left mouse button trick does not work with OpenBox on the Eee, but
the super+uparrow trick does, giving me a usable screen size.

That's the good news. The bad news is that the window geometry is either
not saved correctly, or is ignored as the application always starts up with
an oversize screen. However, the super+uparrow trick does give me a
workaround, so we're a bit further forward.

I've not had time to look at the underlying python code so I hav't yet
tried modifying the argument to resize()

-dgm

On 31 October 2014 23:16, Dmitry Shachnev <
<email address hidden>> wrote:

> Your question #256446 on ReText changed:
> https://answers.launchpad.net/retext/+question/256446
>
> Status: Open => Answered
>
> Dmitry Shachnev proposed the following answer:
> First, enable automatic saving of the geomtry, if you haven't done that
> already:
>
> mkdir -p "$HOME/.config/ReText project/"
> echo "saveWindowGeometry=true" >> "$HOME/.config/ReText
> project/ReText.conf"
>
> You can move the window using Alt + left mouse button (until the corner
> is visible), then resize it, and then the position will be saved.
>
> Also, you can open ReText/window.py, find a line that calls resize()
> (line 38 for me), and change that to a different version. Then the
> geometry will be saved, and you will be able to change that file back to
> distro shipped version.
>
> If the above didn't work for some reason, then on most window manager
> Super + Up Arrow usually maximizes the window. In maximized state,
> ReText should fit in your screen.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/retext/+question/256446/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/retext/+question/256446
>
> You received this question notification because you asked the question.
>

--
LPO Box 8186, ANU, Acton ACT 0200, Australia
+61 2 6100 8417 :: http://about.me/doug.moncur

Dmitry Shachnev (mitya57) said : #3

Qt doesn't save any state for maximized windows, unfortunately.

Try to put this line to your ~/.config/ReText project/ReText.conf (firstly remove existing windowGeometry line):

windowGeometry=@ByteArray(\x1\xd9\xd0\xcb\0\x1\0\0\0\0\0\0\0\0\0\x18\0\0\x1\x91\0\0\x1`\0\0\0\x1\0\0\0\x34\0\0\x1\x90\0\0\x1_\0\0\0\0\0\0)

This will set the size to 400x300px and move the window to top-left corner.

dgm (doug-moncur) said : #4

Hi,

Tried that, afraid it didn't work, no difference to previously

-Doug
On 05/11/2014 2:56 AM, "Dmitry Shachnev" <
<email address hidden>> wrote:

> Your question #256446 on ReText changed:
> https://answers.launchpad.net/retext/+question/256446
>
> Dmitry Shachnev proposed the following answer:
> Qt doesn't save any state for maximized windows, unfortunately.
>
> Try to put this line to your ~/.config/ReText project/ReText.conf
> (firstly remove existing windowGeometry line):
>
>
> windowGeometry=@ByteArray(\x1\xd9\xd0\xcb\0\x1\0\0\0\0\0\0\0\0\0\x18\0\0\x1\x91\0\0\x1`\0\0\0\x1\0\0\0\x34\0\0\x1\x90\0\0\x1_\0\0\0\0\0\0)
>
> This will set the size to 400x300px and move the window to top-left
> corner.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/retext/+question/256446/+confirm?answer_id=2
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/retext/+question/256446
>
> You received this question notification because you asked the question.
>

dgm (dgm-acm) said : #5

Hi,

rather more detail on what I did:

1) Replaced the previous ReText.conf with a file containing only the suggested line

2) Opened Retext - still produced oversize window

3) checked ReText configuration wiki - windowGeometry is not listed as a value but saveWindowGeometry is

4) edited ReText.cof so line read 'saveWindowGeometry.=....'

5) Restarted ReText - still produced oversize window

Dmitry Shachnev (mitya57) said : #6

You need both lines:

saveWindowGeometry=true
windowGeometry=@ByteArray(\x1\xd9\xd0\xcb\0\x1\0\0\0\0\0\0\0\0\0\x18\0\0\x1\x91\0\0\x1`\0\0\0\x1\0\0\0\x34\0\0\x1\x90\0\0\x1_\0\0\0\0\0\0)

dgm (dgm-acm) said : #7

still doesn't work I'm afraid - my ReText.conf file reads:

[General]
saveWindowGeometry=true
windowGeometry=@ByteArray(\x1\xd9\xd0\xcb\0\x1\0\0\0\0\0\0\0\0\0\x18\0\0\x1\x91\0\0\x1`\0\0\0\x1\0\0\0\x34\0\0\x1\x90\0\0\x1_\0\0\0\0\0\0)
recentFileList=/home/dgm/20141107_web_science.mkd

I'v also tried it with saveWindoGeometry=@ByteArray( ...

and that makes no difference

dgm (dgm-acm) said : #8

Hi,

I've tried your suggested fix on a standard Ubuntu box and it works as you would expect.

I suspect that the problem is due to the fact that the Eee pc I am using is using the debian derived crunchbang (crunchbang.org) with open box as a window manager

dgm (dgm-acm) said : #9

Hi,

I've done a little more testing and built myself a lubuntu vm and a crunchbang vm on my main machine.

On the lubuntu vm with lxde as a window manager the suggested fix works just fine. On crunchbang with open box it fails just as it does on the Eee.

This suggests that it's a problem with OpenBox (or possibly crunchbang) rather than one caused by the Eee hardware.

As this problem only affects people with small screen devices it's probably not widespread. I have a viable workaround, so I'm happy if you decide to close the problem and leave this as it is

Best Dmitry Shachnev (mitya57) said : #10

Committed a fix for small screens into upstream repository, will be in next major release (5.1).

dgm (dgm-acm) said : #11

sounds good, look forward to it