diff -Nurp grx-2.4.6-fjf/include/grx20.h grx-2.4.6-fjf-pg/include/grx20.h --- grx-2.4.6-fjf/include/grx20.h 2003-02-26 23:33:46.000000000 +0100 +++ grx-2.4.6-fjf-pg/include/grx20.h 2004-06-17 16:12:24.000000000 +0200 @@ -1413,7 +1413,10 @@ void GrMoveCursor(GrCursor *cursor,int x #define GR_M_KEYPRESS 0x080 /* other event flag bits */ #define GR_M_POLL 0x100 #define GR_M_NOPAINT 0x200 -#define GR_M_EVENT (GR_M_MOTION | GR_M_KEYPRESS | GR_M_BUTTON_DOWN | GR_M_BUTTON_UP) +#define GR_SIZE_CHANGED 0x400 +#define GR_OS_DRAW_REQUEST 0x800 +#define GR_COMMAND 0x1000 +#define GR_M_EVENT (GR_M_MOTION | GR_M_KEYPRESS | GR_M_BUTTON_DOWN | GR_M_BUTTON_UP | GR_SIZE_CHANGED | GR_OS_DRAW_REQUEST | GR_COMMAND) #define GR_KB_RIGHTSHIFT 0x01 /* Keybd states: right shift key depressed */ #define GR_KB_LEFTSHIFT 0x02 /* left shift key depressed */ diff -Nurp grx-2.4.6-fjf/src/mouse/input.h grx-2.4.6-fjf-pg/src/mouse/input.h --- grx-2.4.6-fjf/src/mouse/input.h 2001-04-01 03:27:02.000000000 +0200 +++ grx-2.4.6-fjf-pg/src/mouse/input.h 2004-06-17 16:12:24.000000000 +0200 @@ -58,7 +58,34 @@ EV.y = MOUINFO->ypos; \ EV.key = KEY; \ EV.kbstat = KBSTAT; \ - EV.buttons = 0; \ + EV.buttons = 0; \ +} while(0) + +#define fill_size_ev(EV,NEWX,NEWY) do { \ + EV.flags = GR_SIZE_CHANGED; \ + EV.x = NEWX; \ + EV.y = NEWY; \ + EV.key = 0; \ + EV.kbstat = 0; \ + EV.buttons = 0; \ +} while(0) + +#define fill_paint_ev(EV,LEFT,TOP,RIGHT,BOTTOM) do { \ + EV.flags = GR_OS_DRAW_REQUEST; \ + EV.x = LEFT; \ + EV.y = TOP; \ + EV.buttons = RIGHT; \ + EV.key = BOTTOM; \ + EV.kbstat = 0; \ +} while(0) + +#define fill_cmd_ev(EV,CMD,KBSTAT) do { \ + EV.flags = GR_COMMAND | (MOUINFO->moved ? GR_M_MOTION : 0); \ + EV.x = MOUINFO->xpos; \ + EV.y = MOUINFO->ypos; \ + EV.key = CMD; \ + EV.kbstat = KBSTAT; \ + EV.buttons = 0; \ } while(0) #define enqueue_event(EV) do { \ diff -Nurp grx-2.4.6-fjf/src/mouse/w32inp.c grx-2.4.6-fjf-pg/src/mouse/w32inp.c --- grx-2.4.6-fjf/src/mouse/w32inp.c 2002-03-08 11:40:30.000000000 +0100 +++ grx-2.4.6-fjf-pg/src/mouse/w32inp.c 2004-06-17 16:12:24.000000000 +0200 @@ -215,6 +215,8 @@ static int DequeueW32Event(GrMouseEvent W32Event evaux; int key; int buttons; + extern int GrCurrentWindowWidth; + extern int GrCurrentWindowHeight; if (_W32EventQueueLength < 1) return 0; @@ -259,6 +261,32 @@ static int DequeueW32Event(GrMouseEvent kbd_lastmod = evaux.kbstat; return 1; + case WM_SIZE: + GrCurrentContext ()->gc_xmax = LOWORD (evaux.lParam); + GrCurrentContext ()->gc_ymax = HIWORD (evaux.lParam); + GrCurrentContext ()->gc_xcliphi = LOWORD (evaux.lParam); + GrCurrentContext ()->gc_ycliphi = HIWORD (evaux.lParam); + GrScreenContext ()->gc_xmax = LOWORD (evaux.lParam); + GrScreenContext ()->gc_ymax = HIWORD (evaux.lParam); + GrScreenContext ()->gc_xcliphi = LOWORD (evaux.lParam); + GrScreenContext ()->gc_ycliphi = HIWORD (evaux.lParam); + GrCurrentWindowWidth = LOWORD (evaux.lParam); + GrCurrentWindowHeight = HIWORD (evaux.lParam); + fill_size_ev ((*ev), LOWORD (evaux.lParam), HIWORD (evaux.lParam)); + return 1; + + case WM_PAINT: + { + RECT *UpdateRect = (RECT *) (evaux.lParam); + fill_paint_ev ((*ev), UpdateRect->left, UpdateRect->top, + UpdateRect->right, UpdateRect->bottom); + return 1; + } + + case WM_COMMAND: + fill_cmd_ev((*ev), evaux.wParam, evaux.kbstat); + return 1; + case WM_LBUTTONDOWN: buttons = GR_M_LEFT | mou_buttons; MOUINFO->xpos = LOWORD(evaux.lParam); @@ -329,6 +357,8 @@ static int DequeueW32Event(GrMouseEvent MOUINFO->xpos = LOWORD(evaux.lParam); MOUINFO->ypos = HIWORD(evaux.lParam); MOUINFO->moved = TRUE; + ev->kbstat = evaux.kbstat; + kbd_lastmod = evaux.kbstat; return -1; default: diff -Nurp grx-2.4.6-fjf/src/vdrivers/vd_win32.c grx-2.4.6-fjf-pg/src/vdrivers/vd_win32.c --- grx-2.4.6-fjf/src/vdrivers/vd_win32.c 2003-04-14 21:49:54.000000000 +0200 +++ grx-2.4.6-fjf-pg/src/vdrivers/vd_win32.c 2004-06-17 16:54:29.000000000 +0200 @@ -95,6 +95,9 @@ static HBITMAP hBmpDIB = NULL; static int maxScreenWidth, maxScreenHeight; static int maxWindowWidth, maxWindowHeight; +int GrCurrentWindowWidth = 0; +int GrCurrentWindowHeight = 0; + HANDLE windowThread = INVALID_HANDLE_VALUE; static HANDLE mainThread = INVALID_HANDLE_VALUE; @@ -176,8 +179,8 @@ static int setmode(GrVideoMode * mp, int Rect.right = mp->width + inipos; Rect.bottom = mp->height + inipos; AdjustWindowRect(&Rect, WS_OVERLAPPEDWINDOW, FALSE); - maxWindowWidth = Rect.right - Rect.left; - maxWindowHeight = Rect.bottom - Rect.top; + GrCurrentWindowWidth = maxWindowWidth = Rect.right - Rect.left; + GrCurrentWindowHeight = maxWindowHeight = Rect.bottom - Rect.top; SetWindowPos(hGRXWnd, NULL, Rect.left, Rect.top, maxWindowWidth, maxWindowHeight, @@ -543,8 +574,12 @@ static LRESULT CALLBACK WndProc(HWND hWn case WM_SYSCHAR: fInsert = FALSE; + + if (GetKeyState (VK_MENU) < 0 + && DefWindowProc (hWnd, uMsg, wParam, lParam) == 0) + return 0; kbstat = convertwin32keystate(); - if (kbstat & GR_KB_ALT) { + if ((kbstat & GR_KB_ALT) != 0 && (wParam & 0xff == 0)) { if (wParam >= 'a' && wParam <= 'z') fInsert = TRUE; if (wParam >= 'A' && wParam <= 'Z') @@ -559,27 +594,24 @@ static LRESULT CALLBACK WndProc(HWND hWn case WM_KEYDOWN: case WM_SYSKEYDOWN: - kbstat = convertwin32keystate(); -/* - if (kbstat & GR_KB_ALT && wParam == VK_F4) - PostMessage(hWnd, WM_CLOSE, 0, 0); -*/ - EnqueueW32Event(uMsg, wParam, lParam, kbstat); - return 0; - case WM_LBUTTONDOWN: case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: case WM_LBUTTONUP: case WM_MBUTTONUP: case WM_RBUTTONUP: - kbstat = convertwin32keystate(); - EnqueueW32Event(uMsg, wParam, lParam, kbstat); - return 0; - case WM_MOUSEMOVE: - kbstat = convertwin32keystate(); - EnqueueW32Event(uMsg, wParam, lParam, kbstat); + case WM_SIZE: + case WM_COMMAND: + if (uMsg == WM_COMMAND && lParam == 1208) + ShowCursor (TRUE); + else if (uMsg == WM_COMMAND && lParam == 1209) + ShowCursor (FALSE); + else + { + kbstat = convertwin32keystate(); + EnqueueW32Event(uMsg, wParam, lParam, kbstat); + } return 0; case WM_PAINT: @@ -589,6 +621,7 @@ static LRESULT CALLBACK WndProc(HWND hWn PAINTSTRUCT ps; if (GetUpdateRect(hWnd, &UpdateRect, FALSE)) { + EnqueueW32Event(uMsg, wParam, (long) &UpdateRect, 0); BeginPaint(hWnd, &ps); hDC = GetDC(hWnd); BitBlt(hDC, @@ -622,7 +655,6 @@ static LRESULT CALLBACK WndProc(HWND hWn case WM_WINDOWPOSCHANGED: case WM_GETDLGCODE: case WM_MOVE: - case WM_SIZE: case WM_SETCURSOR: case WM_HELP: case WM_KEYUP: