summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e6735ae)
raw | patch | inline | side by side (parent: e6735ae)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 26 Nov 2006 00:32:36 +0000 (00:32 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 26 Nov 2006 00:32:36 +0000 (00:32 +0000) |
To do: copy this to non-gtkmm dialogs
src/ui/dialog/dialog.cpp | patch | blob | history |
index 074ee0d36528bc93b353ccb545caf7178a98c544..8fb04a91f8ab317f2548d3b956922b658a0d9b31 100644 (file)
--- a/src/ui/dialog/dialog.cpp
+++ b/src/ui/dialog/dialog.cpp
#include "interface.h"
#include "verbs.h"
+
+#define MIN_ONSCREEN_DISTANCE 50
+
+
+
namespace Inkscape {
namespace UI {
namespace Dialog {
// g_print ("read %d %d %d %d\n", x, y, w, h);
- if (x<0) x=0;
- if (y<0) y=0;
-
// If there are stored height and width values for the dialog,
// resize the window to match; otherwise we leave it at its default
if (w != 0 && h != 0) {
resize (w, h);
}
-
+
// If there are stored values for where the dialog should be
// located, then restore the dialog to that position.
- if (x != -1000 && y != -1000) {
+ // also check if (x,y) is actually onscreen with the current screen dimensions
+ if ( (x >= 0) && (y >= 0) && (x < (gdk_screen_width()-MIN_ONSCREEN_DISTANCE)) && (y < (gdk_screen_height()-MIN_ONSCREEN_DISTANCE)) ) {
move(x, y);
} else {
// ...otherwise just put it in the middle of the screen