mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Make new windows the same size as the active one. Fix #341968.
New main windows appear very small, so set their size to the one of the currently active window. If that is in a maximized state, maximize the new windows too. However, do not try to position them. BP git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15569 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
8c2acba5e2
commit
65c05daf58
@ -1894,8 +1894,18 @@ GncMainWindow *
|
||||
gnc_main_window_new (void)
|
||||
{
|
||||
GncMainWindow *window;
|
||||
gncUIWidget old_window;
|
||||
|
||||
window = g_object_new (GNC_TYPE_MAIN_WINDOW, NULL);
|
||||
old_window = gnc_ui_get_toplevel();
|
||||
if (old_window) {
|
||||
gint width, height;
|
||||
gtk_window_get_size (GTK_WINDOW (old_window), &width, &height);
|
||||
gtk_window_resize (GTK_WINDOW (window), width, height);
|
||||
if ((gdk_window_get_state((GTK_WIDGET(old_window))->window)
|
||||
& GDK_WINDOW_STATE_MAXIMIZED) != 0)
|
||||
gtk_window_maximize (GTK_WINDOW (window));
|
||||
}
|
||||
active_windows = g_list_append (active_windows, window);
|
||||
gnc_main_window_update_all_menu_items();
|
||||
return window;
|
||||
@ -3381,15 +3391,19 @@ gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window)
|
||||
* *
|
||||
************************************************************/
|
||||
|
||||
/** Get a pointer to a top level window... any top level window. This
|
||||
* function just returns a pointer to the first window.
|
||||
/** Get a pointer to the first active top level window or NULL
|
||||
* if there is none.
|
||||
*
|
||||
* @return A pointer to a GtkWindow object. */
|
||||
gncUIWidget
|
||||
gnc_ui_get_toplevel (void)
|
||||
{
|
||||
if (active_windows)
|
||||
return active_windows->data;
|
||||
GList *window;
|
||||
|
||||
for (window=active_windows; window; window=window->next)
|
||||
if (gtk_window_is_active (GTK_WINDOW (window->data)))
|
||||
return window->data;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user