mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Do not move windows on restoration that would be offscreen.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14517 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
bdd43b708f
commit
73d62be3a3
@ -1,3 +1,8 @@
|
|||||||
|
2006-07-16 Andreas Köhler <andi5.py@gmx.net>
|
||||||
|
|
||||||
|
* src/gnome-utils/gnc-main-window.c: Do not move windows on
|
||||||
|
restoration that would be offscreen.
|
||||||
|
|
||||||
2006-07-15 Derek Atkins <derek@ihtfp.com>
|
2006-07-15 Derek Atkins <derek@ihtfp.com>
|
||||||
|
|
||||||
* src/business/business-core/gncAddress.[ch]:
|
* src/business/business-core/gncAddress.[ch]:
|
||||||
|
@ -546,24 +546,6 @@ gnc_main_window_restore_window (GncMainWindow *window, GncMainWindowSaveData *da
|
|||||||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
||||||
|
|
||||||
/* Get the window coordinates, etc. */
|
/* Get the window coordinates, etc. */
|
||||||
pos = g_key_file_get_integer_list(data->key_file, window_group,
|
|
||||||
WINDOW_POSITION, &length, &error);
|
|
||||||
if (error) {
|
|
||||||
g_warning("error reading group %s key %s: %s",
|
|
||||||
window_group, WINDOW_POSITION, error->message);
|
|
||||||
g_error_free(error);
|
|
||||||
error = NULL;
|
|
||||||
} else if (length != 2) {
|
|
||||||
g_warning("invalid number of values for group %s key %s",
|
|
||||||
window_group, WINDOW_POSITION);
|
|
||||||
} else {
|
|
||||||
gtk_window_move(GTK_WINDOW(window), pos[0], pos[1]);
|
|
||||||
DEBUG("window (%p) position %dx%d", window, pos[0], pos[1]);
|
|
||||||
}
|
|
||||||
if (pos) {
|
|
||||||
g_free(pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
geom = g_key_file_get_integer_list(data->key_file, window_group,
|
geom = g_key_file_get_integer_list(data->key_file, window_group,
|
||||||
WINDOW_GEOMETRY, &length, &error);
|
WINDOW_GEOMETRY, &length, &error);
|
||||||
if (error) {
|
if (error) {
|
||||||
@ -578,9 +560,35 @@ gnc_main_window_restore_window (GncMainWindow *window, GncMainWindowSaveData *da
|
|||||||
gtk_window_resize(GTK_WINDOW(window), geom[0], geom[1]);
|
gtk_window_resize(GTK_WINDOW(window), geom[0], geom[1]);
|
||||||
DEBUG("window (%p) size %dx%d", window, geom[0], geom[1]);
|
DEBUG("window (%p) size %dx%d", window, geom[0], geom[1]);
|
||||||
}
|
}
|
||||||
|
/* keep the geometry for a test whether the windows position
|
||||||
|
is offscreen */
|
||||||
|
|
||||||
|
pos = g_key_file_get_integer_list(data->key_file, window_group,
|
||||||
|
WINDOW_POSITION, &length, &error);
|
||||||
|
if (error) {
|
||||||
|
g_warning("error reading group %s key %s: %s",
|
||||||
|
window_group, WINDOW_POSITION, error->message);
|
||||||
|
g_error_free(error);
|
||||||
|
error = NULL;
|
||||||
|
} else if (length != 2) {
|
||||||
|
g_warning("invalid number of values for group %s key %s",
|
||||||
|
window_group, WINDOW_POSITION);
|
||||||
|
} else if ((pos[0] + (geom ? geom[0] : 0) < 0) ||
|
||||||
|
(pos[0] > gdk_screen_width()) ||
|
||||||
|
(pos[1] + (geom ? geom[1] : 0) < 0) ||
|
||||||
|
(pos[1] > gdk_screen_height())) {
|
||||||
|
g_debug("position %dx%d, size%dx%d is offscreen; will not move",
|
||||||
|
pos[0], pos[1], geom[0], geom[1]);
|
||||||
|
} else {
|
||||||
|
gtk_window_move(GTK_WINDOW(window), pos[0], pos[1]);
|
||||||
|
DEBUG("window (%p) position %dx%d", window, pos[0], pos[1]);
|
||||||
|
}
|
||||||
if (geom) {
|
if (geom) {
|
||||||
g_free(geom);
|
g_free(geom);
|
||||||
}
|
}
|
||||||
|
if (pos) {
|
||||||
|
g_free(pos);
|
||||||
|
}
|
||||||
|
|
||||||
max = g_key_file_get_boolean(data->key_file, window_group,
|
max = g_key_file_get_boolean(data->key_file, window_group,
|
||||||
WINDOW_MAXIMIZED, &error);
|
WINDOW_MAXIMIZED, &error);
|
||||||
|
Loading…
Reference in New Issue
Block a user