* Source/win32/WIN32Server.m: Added better logging on Window create and destroy errors.

Added a secondary call to get current mouse position if the first call fails.	
* Source/win32/w32_text_focus.m: Cast parameter to appropriate (HWND) type.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@31718 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Jonathan Gillaspie 2010-12-08 22:59:05 +00:00
parent 282a590ad5
commit 15f3adb397
3 changed files with 25 additions and 8 deletions

View file

@ -1,3 +1,9 @@
2010-12-08 Jonathan Gillaspie <jonathan.gillaspie@testplant.com>
* Source/win32/WIN32Server.m: Added better logging on Window create and destroy errors.
Added a secondary call to get current mouse position if the first call fails.
* Source/win32/w32_text_focus.m: Cast parameter to appropriate (HWND) type.
2010-11-18 Eric Wasylishen <ewasylishen@gmail.com>
* Source/winlib/WIN32FontInfo.m:

View file

@ -925,8 +925,11 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
(HMENU)NULL,
hinstance,
(void*)type);
NSDebugLLog(@"WTrace", @" num/handle: %d", hwnd);
NSDebugLLog(@"WCTrace", @" num/handle: %d", hwnd);
if (!hwnd) {
NSLog(@"CreateWindowEx Failed %d", GetLastError());
}
SetLayeredWindowAttributes(hwnd, 0, 255, LWA_ALPHA);
[self _setWindowOwnedByServer: (int)hwnd];
@ -935,8 +938,10 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
- (void) termwindow: (int) winNum
{
NSDebugLLog(@"WTrace", @"termwindow: %d", winNum);
DestroyWindow((HWND)winNum);
NSDebugLLog(@"WCTrace", @"termwindow: %d", winNum);
if (!DestroyWindow((HWND)winNum)) {
NSLog(@"DestroyWindow Failed %d", GetLastError());
}
}
- (void) stylewindow: (unsigned int)style : (int) winNum
@ -1545,9 +1550,15 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg,
POINT p;
if (!GetCursorPos(&p))
{
NSLog(@"GetCursorPos failed with %d", GetLastError());
return NSZeroPoint;
{
// Try using cursorInfo which should work in more situations
CURSORINFO cursorInfo;
cursorInfo.cbSize = sizeof(CURSORINFO);
if (!GetCursorInfo(&cursorInfo)) {
NSLog(@"GetCursorInfo failed with %d", GetLastError());
return NSZeroPoint;
}
p = cursorInfo.ptScreenPos;
}
return MSScreenPointToGS(p.x, p.y);

View file

@ -76,7 +76,7 @@
NSEvent *ev;
// Remember the now focused window
currentFocus = wParam;
currentFocus = (HWND) wParam;
ev = [NSEvent otherEventWithType: NSAppKitDefined
location: NSMakePoint(0, 0)