mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
app: brute force the session memorized size when showing a window.
The main window height was always bigger than my screen height on startup, overriding my previous session's window size. I could retrace the memorized size being changed when adding the display shell with gimp_image_window_add_shell() in gimp_display_new(), just before showing the window. Unfortunately this happens after we applied the session position/size (in gimp_image_window_session_update() at end of image window construction). I'm not sure why adding the shell increases the size of the window, especially since the window can be manually sized at the expected dimension without any graphical glitch. Maybe we could investigate this, but simply forcing any session managed window to behave as expected upon showing is not a bad move anyway and in this specific case, it works fine.
This commit is contained in:
parent
02d6478c24
commit
8dbd10b3c6
1 changed files with 14 additions and 2 deletions
|
@ -485,6 +485,14 @@ gimp_session_info_dialog_show (GtkWidget *widget,
|
|||
{
|
||||
gtk_window_move (GTK_WINDOW (widget),
|
||||
info->p->x, info->p->y);
|
||||
|
||||
if (gimp_session_info_get_remember_size (info) &&
|
||||
info->p->width > 0 &&
|
||||
info->p->height > 0)
|
||||
{
|
||||
gtk_window_resize (GTK_WINDOW (info->p->widget),
|
||||
info->p->width, info->p->height);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -683,6 +691,10 @@ gimp_session_info_apply_geometry (GimpSessionInfo *info,
|
|||
* dock windows. gtk_window_resize() seems to work fine for all
|
||||
* windows. Leave this comment here until we figured what's
|
||||
* going on...
|
||||
*
|
||||
* XXX If we end up updating this code, also do the same to the
|
||||
* gtk_window_resize() call in gimp_session_info_dialog_show()
|
||||
* signal handler.
|
||||
*/
|
||||
#if 1
|
||||
gtk_window_resize (GTK_WINDOW (info->p->widget),
|
||||
|
@ -736,7 +748,7 @@ gimp_session_info_apply_geometry (GimpSessionInfo *info,
|
|||
* are shown. This is important especially for transient dialogs,
|
||||
* because window managers behave even "smarter" then...
|
||||
*/
|
||||
if (GTK_IS_DIALOG (info->p->widget))
|
||||
if (GTK_IS_WINDOW (info->p->widget))
|
||||
g_signal_connect (info->p->widget, "show",
|
||||
G_CALLBACK (gimp_session_info_dialog_show),
|
||||
info);
|
||||
|
@ -970,7 +982,7 @@ gimp_session_info_set_widget (GimpSessionInfo *info,
|
|||
{
|
||||
g_return_if_fail (GIMP_IS_SESSION_INFO (info));
|
||||
|
||||
if (GTK_IS_DIALOG (info->p->widget))
|
||||
if (GTK_IS_WINDOW (info->p->widget))
|
||||
g_signal_handlers_disconnect_by_func (info->p->widget,
|
||||
gimp_session_info_dialog_show,
|
||||
info);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue