summaryrefslogtreecommitdiffstats
path: root/src/dialogs/find.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialogs/find.cpp')
-rw-r--r--src/dialogs/find.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/dialogs/find.cpp b/src/dialogs/find.cpp
index f3efeed81..257abb138 100644
--- a/src/dialogs/find.cpp
+++ b/src/dialogs/find.cpp
@@ -66,6 +66,8 @@ sp_find_dialog(){
#include "../sp-offset.h"
#include <xml/repr.h>
+#define MIN_ONSCREEN_DISTANCE 50
+
using NR::X;
using NR::Y;
@@ -645,24 +647,24 @@ sp_find_dialog_old (void)
dlg = sp_window_new (title, TRUE);
if (x == -1000 || y == -1000) {
- x = prefs_get_int_attribute (prefs_path, "x", 0);
- y = prefs_get_int_attribute (prefs_path, "y", 0);
+ x = prefs_get_int_attribute (prefs_path, "x", -1000);
+ y = prefs_get_int_attribute (prefs_path, "y", -1000);
}
if (w ==0 || h == 0) {
w = prefs_get_int_attribute (prefs_path, "w", 0);
h = prefs_get_int_attribute (prefs_path, "h", 0);
}
- if (x<0) x=0;
- if (y<0) y=0;
+// if (x<0) x=0;
+// if (y<0) y=0;
- if (x != 0 || y != 0) {
+ if (w && h)
+ gtk_window_resize ((GtkWindow *) dlg, w, h);
+ if (x >= 0 && y >= 0 && (x < (gdk_screen_width()-MIN_ONSCREEN_DISTANCE)) && (y < (gdk_screen_height()-MIN_ONSCREEN_DISTANCE))) {
gtk_window_move ((GtkWindow *) dlg, x, y);
} else {
gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_CENTER);
}
- if (w && h)
- gtk_window_resize ((GtkWindow *) dlg, w, h);
sp_transientize (dlg);
wd.win = dlg;