Applied first part of WIN32 patch by MA Garcias.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@19285 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2004-05-11 23:30:31 +00:00
parent 305b8d6074
commit bd0bd21d94
4 changed files with 20 additions and 9 deletions

View file

@ -1,3 +1,13 @@
2004-05-12 Fred Kiefer <FredKiefer@gmx.de>
* Headers/win32/WIN32Geometry.h: (GSWindowOriginToMS) corrected computation.
* Source/win32/WIN32Server.m (-orderwindow:::) Removed obsolte
"return" in non-NSWindowOut case and use flag SWP_NOACTIVATE.
(-placewindow::, -movewindow::) Don't use flag SWP_NOREDRAW.
Patch by MA Garcias <lists@tragnarion.com>.
* Source/win32/WIN32ServerEvent.m Corrected definition of the
GET_X_LPARAM and GET_Y_LPARAM macros.
2004-03-30 01:49 Alexander Malmberg <alexander@malmberg.org> 2004-03-30 01:49 Alexander Malmberg <alexander@malmberg.org>
* Source/x11/XGGLFormat.m (-initWithAttributes:): Fix handling of * Source/x11/XGGLFormat.m (-initWithAttributes:): Fix handling of

View file

@ -125,7 +125,7 @@ POINT GSWindowOriginToMS(HWND hwnd, NSPoint p)
h = rect.bottom - rect.top; h = rect.bottom - rect.top;
p1.x = p.x; p1.x = p.x;
p1.y = screen_height - p.y + h; p1.y = screen_height - p.y - h;
return p1; return p1;
} }

View file

@ -157,6 +157,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
return NO; return NO;
} }
// FIXME: The following methods wont work for multiple screens
/* Screen information */ /* Screen information */
- (NSSize) resolutionForScreen: (int)screen - (NSSize) resolutionForScreen: (int)screen
{ {
@ -428,10 +429,10 @@ DWORD windowStyleForGSStyle(unsigned int style)
if (op != NSWindowOut) if (op != NSWindowOut)
{ {
int flag = SW_SHOW; int flag = SW_SHOW;
if (IsIconic((HWND)winNum)) if (IsIconic((HWND)winNum))
flag = SW_RESTORE; flag = SW_RESTORE;
ShowWindow((HWND)winNum, flag); ShowWindow((HWND)winNum, flag);
return;
} }
switch (op) switch (op)
@ -444,7 +445,7 @@ DWORD windowStyleForGSStyle(unsigned int style)
if (otherWin == 0) if (otherWin == 0)
otherWin = (int)HWND_BOTTOM; otherWin = (int)HWND_BOTTOM;
SetWindowPos((HWND)winNum, (HWND)otherWin, 0, 0, 0, 0, SetWindowPos((HWND)winNum, (HWND)otherWin, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE); SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
break; break;
case NSWindowAbove: case NSWindowAbove:
if (otherWin <= 0) if (otherWin <= 0)
@ -455,7 +456,7 @@ DWORD windowStyleForGSStyle(unsigned int style)
winNum = (int)HWND_TOP; winNum = (int)HWND_TOP;
} }
SetWindowPos((HWND) otherWin, (HWND)winNum, 0, 0, 0, 0, SetWindowPos((HWND) otherWin, (HWND)winNum, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE); SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
break; break;
} }
} }
@ -469,7 +470,7 @@ DWORD windowStyleForGSStyle(unsigned int style)
p = GSWindowOriginToMS((HWND)winNum, loc); p = GSWindowOriginToMS((HWND)winNum, loc);
SetWindowPos((HWND)winNum, NULL, p.x, p.y, 0, 0, SetWindowPos((HWND)winNum, NULL, p.x, p.y, 0, 0,
SWP_NOZORDER | SWP_NOSIZE | SWP_NOREDRAW); SWP_NOZORDER | SWP_NOSIZE);
} }
- (void) placewindow: (NSRect)frame : (int) winNum - (void) placewindow: (NSRect)frame : (int) winNum
@ -484,7 +485,7 @@ DWORD windowStyleForGSStyle(unsigned int style)
GetWindowRect((HWND)winNum, &r2); GetWindowRect((HWND)winNum, &r2);
SetWindowPos((HWND)winNum, NULL, r.left, r.top, r.right - r.left, r.bottom - r.top, SetWindowPos((HWND)winNum, NULL, r.left, r.top, r.right - r.left, r.bottom - r.top,
SWP_NOZORDER | SWP_NOREDRAW); SWP_NOZORDER);
if ((win->useHDC) && if ((win->useHDC) &&
(r.right - r.left != r2.right - r2.left) && (r.right - r.left != r2.right - r2.left) &&
@ -613,7 +614,7 @@ DWORD windowStyleForGSStyle(unsigned int style)
- (void) setinputfocus: (int) winNum - (void) setinputfocus: (int) winNum
{ {
NSDebugLLog(@"WTrace", @"setinputfocus: %d", winNum); NSDebugLLog(@"WTrace", @"setinputfocus: %d", winNum);
NSDebugLLog(@"Focus", @"Setting input focus to %d"); NSDebugLLog(@"Focus", @"Setting input focus to %d", winNum);
if (winNum == 0) if (winNum == 0)
{ {
NSDebugLLog(@"Focus", @" invalid focus window"); NSDebugLLog(@"Focus", @" invalid focus window");

View file

@ -48,10 +48,10 @@
here is almost correct, but will fail for multi monitor systems here is almost correct, but will fail for multi monitor systems
*/ */
#ifndef GET_X_LPARAM #ifndef GET_X_LPARAM
#define GET_X_LPARAM(p) LOWORD(p) #define GET_X_LPARAM(p) ((int)(short)LOWORD(p))
#endif #endif
#ifndef GET_Y_LPARAM #ifndef GET_Y_LPARAM
#define GET_Y_LPARAM(p) HIWORD(p) #define GET_Y_LPARAM(p) ((int)(short)HIWORD(p))
#endif #endif
static NSEvent *process_key_event(HWND hwnd, WPARAM wParam, LPARAM lParam, static NSEvent *process_key_event(HWND hwnd, WPARAM wParam, LPARAM lParam,