@@ -5,7 +5,8 @@ HWND hwnd;
55LRESULT CALLBACK
66window_proc (HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam )
77{
8- UINT width , height ;
8+ RECT windowRect ;
9+ UINT windowState ;
910 PAINTSTRUCT ps ;
1011 HDC hdc ;
1112 Request * req ;
@@ -26,14 +27,36 @@ window_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
2627
2728 EndPaint (hwnd , & ps );
2829 return 0 ;
30+ case WM_MOVE :
31+ if (GetClientRect (hwnd , & windowRect )) {
32+ npWin .x = windowRect .left ;
33+ npWin .y = windowRect .top ;
34+ }
35+
36+ pluginFuncs .setwindow (& npp , & npWin );
37+ /* Let DefWindowProc handle the rest. */
38+ break ;
2939 case WM_SIZE :
30- width = LOWORD (lParam );
31- height = HIWORD (lParam );
40+ windowState = wParam ;
41+
42+ npWin .clipRect .top = 0 ;
43+ npWin .clipRect .left = 0 ;
44+
45+ if (windowState == SIZE_MINIMIZED ) {
46+ npWin .clipRect .right = 0 ;
47+ npWin .clipRect .bottom = 0 ;
48+ } else {
49+ if (GetClientRect (hwnd , & windowRect )) {
50+ npWin .width = windowRect .right - windowRect .left ;
51+ npWin .height = windowRect .bottom - windowRect .top ;
52+ npWin .clipRect .right = npWin .width ;
53+ npWin .clipRect .bottom = npWin .height ;
54+ }
55+ }
3256
33- npWin .width = npWin .clipRect .right = width ;
34- npWin .height = npWin .clipRect .bottom = height ;
3557 pluginFuncs .setwindow (& npp , & npWin );
36- return 0 ;
58+ /* Let DefWindowProc handle the rest. */
59+ break ;
3760 }
3861
3962 if (uMsg == ioMsg ) {
0 commit comments