Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geometry setting in geany.conf has no effect under Ubuntu 16.04, 64 bit, plain Openbox #1401

Open
Lew-Rockwell-Fan opened this issue Feb 18, 2017 · 8 comments

Comments

@Lew-Rockwell-Fan
Copy link

The geometry line in geany.conf has no effect for me under a minimalistic Ubuntu 16.04, 64 bit, built from the mini.iso up with X started with startx, using plain Openbox as sole DE, if you want to call it that. Nearest thing to a work-around I've come up with is to set it to reopen at the previous geometry. THAT works, but it isn't really the behavior I'd prefer. I'd prefer to set a default geometry and always open at that. If I don't set it to reopen at the previous geometry, it opens at about half the dimensions of my monitor horizontally and vertically. Possibly I could set it to open maximized, but that really isn't what I want either. Here is the present line:
geometry=0;0;1358;713;0;
No matter how I change the numbers, they have no effect.

@elextr
Copy link
Member

elextr commented Feb 18, 2017

You have to edit the geany.conf file in some other editor with Geany closed because that setting is overridden with the current position and size when Geany closes unless you turn off the Menu->Edit->preferences->General->Startup->Save window position and geometry.

@elextr
Copy link
Member

elextr commented Feb 19, 2017

Also note that Blackbox is a stacking window manager, that is it wants to control where windows open, so it may ignore any polite requests Geany makes to return to its saved size and position.

@codebrainz
Copy link
Member

codebrainz commented Feb 19, 2017

Openbox != Blackbox && Stacking == Traditional

But yeah, I'd wager it is the WM taking over placement of the window, there might even be some kind of placement settings for it.

@elextr
Copy link
Member

elextr commented Feb 19, 2017

Oh, OPENbox, my bad, misread :)

Yeah, as I said all Geany can do is politely ask the WM, it can totally ignore that request.

@codebrainz
Copy link
Member

Yeah, for example, from the gtk_window_move() docs:

Asks the window manager to move window to the given position. Window managers are free to ignore this; most window managers ignore requests for initial window positions (instead using a user-defined placement algorithm) and honor requests after the window has already been shown.

@Lew-Rockwell-Fan
Copy link
Author

Lew-Rockwell-Fan commented Feb 26, 2017

Thank you, both. Mea culpa for tardiness in getting back. Mea culpa also for not saying I have turned saving window geometry off. Anyway I tried setting geany's size by hand dragging on the edges (which works fine FOR THAT INSTANCE), closing it, and checking the conf with gedit (WTH are the gedit dev's smoking?? - it looks horrible now and seems to over-ride my WM and appearance settings). Geometry setting in
~/.config/geany/geany.conf
is still:
geometry=0;0;1358;713;0;
I assume this reflects my unchecked save-window-position-and-geometry:
pref_main_save_winpos=false

Geany still opens at about half this size (unless I set it to save position and geom, which works as expected).

Openbox ATM unfortunately, is still unable to set window size. It can set origin position (i.e., the position of the upper left corner) with specific x an y, and it can do that either as a suggestion that can be over-ridden by the app or "forced" which I think can still be over-ridden, but not as easily. Alternately, I think (but I haven't tried it), it can set the position of the center of the window, either in relation to other windows or to the pointer. If Openbox COULD do this it would be great, but it can't. Not yet anyway. More precisely, I should say it doesn't give a user any way to control these things. This has been discussed in the LXDE forum and the openbox mailing list. Presumably, eventually, we'll be able to specify window size for different kinds of windows in ~/.config/openbox/rc.xml, just as we can position and some other attributes, but unless they've changed this since I last looked, it is a feature as yet un-implemented. Anyway, there is nothing in my rc.xml that should affect geany other than this generic stanza at the beginning of that section:

<application name="*">
  <position force="no">
    <x>0</x>
    <y>0</y>
  </position>
  <maximized>no</maximized>
</application>

And all that does is specify the location of the upper left corner, and even that is "force=no" so it should be over-riden by a geometry option to the command or in the config file of an app.

man geany saith:
"Geany supports all generic GTK options, a list is available on the help screen."
From the menu bar Help; Help takes me to a web page with repeats the above sentence.
From CL, "geany --help" doesn't have anything germane; neither does "geany --help-gtk". I even grepped for "geometry" just to be sure I wasn't reading right over it. I coulda sworn there was a generic gtk geometry option, but I haven't found evidence of it.

I tried as command options, all the likely seeming strings like:
geany -geometry=1300x500+0+0
geany --geometry=1760x750+0+0
geany --geometry 1760x750+0+0
geany -geometry 1760x750+0+0
geany -geometry=1760x750+0+0
geany --geometry=1760x750

but they all just return "Geany: Unknown option . . .".

I could use OB to force geany to open maximized, but that isn't really the same as giving it a desired default geometry. I suppose I can wrap geany in a script that zaps the window with wmctrl, but I keep thinking there ought to be a more elegant way to give it a default geometry. Where could the default it seems to act on be coming from? It is the same half-screen size every time, so it must be getting those dimensions from somewhere.

@elextr
Copy link
Member

elextr commented Feb 27, 2017

The GTK2 docs don't actually mention --geometry (nor in the page on X11 options) so I guess thats why it doesn't work.

The position of "Save window position and geometry" in the "Shutdown" section of the dialog is slightly misleading, it not only stops Geany saving it, it also stops it using any value in the file on startup and you will get whatever your WM decides.

@Lew-Rockwell-Fan
Copy link
Author

Lew-Rockwell-Fan commented Mar 1, 2017

The position of "Save window position and geometry" in the "Shutdown" section of the dialog is slightly misleading, it not only stops Geany saving it, it also stops it using any value in the file on startup . . .

Ahhh. Gotcha. Thanks. That's admirably clear, though I had to think about that before I fully saw the implications. So you're saying geany.conf cannot be used to set a default geometry, period. The line that looks like it would do so is, in fact, merely keeping a record of what the geometry WAS the last time geany was closed if the "remember" option is checked, and if the "remember" option is NOT checked, that line does nothing at all. There is therefore no point whatsoever in hand editing it.

If that is how it is intended to work, I suggest at least changing the name of the variable from "geometry" to "saved_geometry", or even to add a comment explaining this in the default geany.conf. Better still would be to replace "geometry" with 2 variables: "saved_geometry" and "default_geometry". So if the present behavior is intended, this is a feature request, or if it is NOT intended, this is a bug report.

. . . and you will get whatever your WM decides.

Ahhh again. Could be. If Openbox is deciding what is, in effect, geany's default geometry then it is doing so rather badly. The failure of Openbox to provide user control of default window sizes (unless you count maximized and iconified), through the rc.xml, has annoyed me before, but usually there is an alternate mechanism either with a config file for the the app or an option in invoking it, or both.

So, if you are confident that the effective window size is coming from OB, it looks like my options are:

  1. Wait for Openbox to enhance rc.xml with window size control
  2. Wait for Geany to enhance geany.conf with a default_geometry variable
  3. Wrap Geany in a script and hit it with wmctrl or something similar
  4. Try another WM

Is that a fair summary?

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 a pull request may close this issue.

3 participants