OSDN Git Service
(root)
/
hengband
/
hengband.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6211077
)
For Windows -- Cannot create windows out of sight.
author
dis-
<dis-@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 12 Feb 2013 13:07:16 +0000
(13:07 +0000)
committer
dis-
<dis-@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 12 Feb 2013 13:07:16 +0000
(13:07 +0000)
src/main-win.c
patch
|
blob
|
history
diff --git
a/src/main-win.c
b/src/main-win.c
index
b698e1b
..
9b6eae2
100644
(file)
--- a/
src/main-win.c
+++ b/
src/main-win.c
@@
-1233,8
+1233,10
@@
static void load_prefs_aux(int i)
char sec_name[128];
char tmp[1024];
char sec_name[128];
char tmp[1024];
- int wid, hgt;
-
+ int wid, hgt, posx, posy;
+ int dispx = GetSystemMetrics( SM_CXVIRTUALSCREEN);
+ int dispy = GetSystemMetrics( SM_CYVIRTUALSCREEN);
+
/* Make section name */
sprintf(sec_name, "Term-%d", i);
/* Make section name */
sprintf(sec_name, "Term-%d", i);
@@
-1296,8
+1298,10
@@
static void load_prefs_aux(int i)
}
/* Window position */
}
/* Window position */
- td->pos_x = GetPrivateProfileInt(sec_name, "PositionX", td->pos_x, ini_file);
- td->pos_y = GetPrivateProfileInt(sec_name, "PositionY", td->pos_y, ini_file);
+ posx = GetPrivateProfileInt(sec_name, "PositionX", posx, ini_file);
+ posy = GetPrivateProfileInt(sec_name, "PositionY", posy, ini_file);
+ td->pos_x = MIN(MAX(0, posx), dispx-128);
+ td->pos_y = MIN(MAX(0, posy), dispy-128);
/* Window Z position */
if (i > 0)
/* Window Z position */
if (i > 0)