GNOME Bugzilla – Bug 333826
The bookmarks manager should center on screen
Last modified: 2016-09-28 16:27:12 UTC
Currently, when I open my bookmark manager either by using the menu items, toolbar buttons or CTRL+B the window appears on the top left corner of my screen. It would be nice to have it centered either on my screen, or on my browser window. Other information:
I'm afraid this is not possible by default, because the window manager decides where to put the window initially. It would be centered automatically if the window were a child window of the browser, but it isn't and it shouldn't be one either.
Doesn't matter what it technically should be. The user experience should be smooth. Isn't it possible to give a window manager gtk hint to let it center on parent? Or is this a metacity feature/bug.
I don't see any 'centre' hint in gtk...
Shouldn't it work just like the 'Add bookmark' dialog? Or is that another kind of window, besides from the manager not being a dialog.
Bah, found it, gtk_window_set_position :)
Ah, http://developer.gnome.org/doc/API/2.0/gtk/GtkWindow.html#gtk-window-set-position. chpe: I can cook a patch for you if you wish. Or are you working on it now.
No, I'm not working on it now.
Created attachment 63256 [details] [review] Proposed patch This patch centers the bookmarks editor on the screen. I'm not sure about wether to use GTK_WIN_POS_CENTER or GTK_WIN_POS_CENTER_ON_SCREEN. The latter seems better, but does it work for non-transient windows?
I think we should use CENTER; CENTER_ON_PARENT makes no sense since the bme has no arent :)
Created attachment 63267 [details] [review] Not finished proposal concept fix This is my first go on adding a center state for ephy-state stuff. It is not finished yet, more windows and dialogs have to be converted. Tell me what you think.
If you made that a flag, EPHY_STATE_WINDOW_INITIALLY_CENTRED or so, you'd save converting all callers of ephy_state_add_window that don't need this...
I made a patch for this, using a flag as you suggested, and it works fine for me. Are there any other window that need to be positioned in the center of the screen, so that i can include them in the patch?
Created attachment 92119 [details] [review] proposed fix using flags
So when you show the bookmarks editor, then move it, quit ephy, start again, show bme; is it centered or at the position you moved it to? The history window (src/ephy-history-window.c) could be treated the same way.
Created attachment 92140 [details] [review] added history-window If i quit and restart epiphany, it is centered again; if i just close the bookmarks editor after having moved and/or resized, and then show it again without closing ephy, it is at the position i left it, and with the same size. Is it the expected behaviour?
I think it would be annoying to always have to move the bme out of the center after starting ephy...
Maybe i don't understand the problem, but b-m-e is not started along with epiphany each time i open it. I can't even manage to find a program in gnome that after a restart remembers the position and size of a subwindow. As i already said, maybe i'm misunderstanding the problem.
Well I don't require remembering the exact position, but I think it would be annoying to have it _always_ centered when I first use it in a session, instead of letting the window manager place it where it fits... Maybe this bug is just WONTFIX ?
I do not agree with WONTFIX on this. I think the program looks better and is more usable with those windows appearing centered rather than in the upper left corner. Also, without this, at least on my system, if i move the bookmark window and restart epiphany, it will always appear on the upper left corner (same way it will always appear centered with the patch, which i perfer). Thanks!
Created attachment 92262 [details] [review] fixed typo removed an "ALWAYS" that should not be there
I still don't think CENTER should be saved in the state. EPHY_STATE_WINDOW_INITIALLY_CENTERED should just set the window hint, and the window manager will take care of it, won't it?
I can't find a suitable hint other than GDK_WINDOW_TYPE_HINT_NORMAL (that obviously does not center the window, as it is the default one) for this window, so the only solution I can think is to use gtk_window_set_position () as in my last attempt.
Maybe we just shouldn't save the window position at all? That way the window manager will always place it where it's convenient / where there's space available. (We should still save size and state of course.)
(In reply to comment #23) > Maybe we just shouldn't save the window position at all? That way the window > manager will always place it where it's convenient / where there's space > available. (We should still save size and state of course.) If that means that the wm will place the window preferably not on top of the Epiphany window, then it doesn't solve this bug. It's good when the relation browser <-> bookmarks window is as clear as possible.
Created attachment 140283 [details] [review] patch for window-commands.c Attached a git patch, it sets the transient window of the bookmarks editor and then set his position to GTK_WIN_POS_CENTER_ON_PARENT.
Comment on attachment 140283 [details] [review] patch for window-commands.c Attached a git patch, it sets the transient window of the bookmarks editor and then set his position to GTK_WIN_POS_CENTER_ON_PARENT.
this patch was applied?
This bug was reported against a version which is not supported any more. Developers are no longer working on this version so there will not be any bug fixes for it. Can you please check again if the issue you reported here still happens in a recent version of GNOME and update this report by adding a comment and adjusting the 'Version' field? Again thank you for reporting this and sorry that it could not be fixed for the version you originally used here. Without feedback this report will be closed as INCOMPLETE after 6 weeks.
In 3.4, the Bookmarks window still appears in the top left when I press Ctrl+B.
We have way more problems with this dialog than the fact that it is uncentered, but I'm fine with centering it. The window-commands.c patch looked best to me, but it doesn't apply nowadays.