From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24174 invoked by alias); 20 Aug 2011 22:11:39 -0000 Received: (qmail 24166 invoked by uid 22791); 20 Aug 2011 22:11:38 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mailout-de.gmx.net (HELO mailout-de.gmx.net) (213.165.64.22) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Sat, 20 Aug 2011 22:11:22 +0000 Received: (qmail invoked by alias); 20 Aug 2011 22:11:20 -0000 Received: from p5B08E997.dip0.t-ipconnect.de (EHLO [192.168.178.47]) [91.8.233.151] by mail.gmx.net (mp032) with SMTP; 21 Aug 2011 00:11:20 +0200 Message-ID: <4E503106.9060605@gmx.de> Date: Sat, 20 Aug 2011 22:11:00 -0000 From: Oliver Schmidt User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 To: cygwin-xfree@cygwin.com Subject: minimize redraw events after resizing/moving windows in multiwindow mode Content-Type: multipart/mixed; boundary="------------060906040606030906060500" X-IsSubscribed: yes Mailing-List: contact cygwin-xfree-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-xfree-owner@cygwin.com Reply-To: cygwin-xfree@cygwin.com Mail-Followup-To: cygwin-xfree@cygwin.com X-SW-Source: 2011-08/txt/msg00048.txt.bz2 --------------060906040606030906060500 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1115 Hi, in multiwindow mode the modal moving/resizing of windows causes a lot of redraw events send to the X clients after the userse releases the mouse button. During the moving/resizing client windows are not redrawn as long as the mouse button is pressed. But all redraw/resizing events are queued and executed step after step after moving/resizing ends. Some clients collect and combine multiple redraw or resizing events, other clients (e.g. xterm) simply execute each redraw or sizing event. The enclosed patch minimizes the events for clients to only one event after the user releases the mouse button to end the moving/resizing. This improves the user experience and reduces strange screen flickerings especially on slow platforms. The enclosed patch modifies winmultiwindowwndproc.c such that the windows events WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE are considered that are send from windows if the modal window resizing/moving begins or ends. Only after WM_EXITSIZEMOVE the redraw/resizing is executed. The patch is against the sources of xserver-cygwin version 1.10.3-1. Best regards, Oliver --------------060906040606030906060500 Content-Type: text/plain; name="patch04.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch04.txt" Content-length: 1928 diff --git a/cygwin/hw/xwin/winmultiwindowwndproc.c b/cygwin/hw/xwin/winmultiwindowwndproc.c index bd84c05..5f536d0 100644 --- a/cygwin/hw/xwin/winmultiwindowwndproc.c +++ b/cygwin/hw/xwin/winmultiwindowwndproc.c @@ -321,6 +321,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message, static Bool s_fTracking = FALSE; Bool needRestack = FALSE; LRESULT ret; + static Bool hasEnteredSizeMove = FALSE; #if CYGDEBUG winDebugWin32Message("winTopLevelWindowProc", hwnd, message, wParam, lParam); @@ -871,7 +872,8 @@ winTopLevelWindowProc (HWND hwnd, UINT message, case WM_MOVE: /* Adjust the X Window to the moved Windows window */ - winAdjustXWindow (pWin, hwnd); + if (!hasEnteredSizeMove) winAdjustXWindow (pWin, hwnd); + /* else: Wait for WM_EXITSIZEMOVE */ return 0; case WM_SHOWWINDOW: @@ -1012,6 +1014,16 @@ winTopLevelWindowProc (HWND hwnd, UINT message, */ break; + case WM_ENTERSIZEMOVE: + hasEnteredSizeMove = TRUE; + return 0; + + case WM_EXITSIZEMOVE: + /* Adjust the X Window to the moved Windows window */ + hasEnteredSizeMove = FALSE; + winAdjustXWindow (pWin, hwnd); + return 0; + case WM_SIZE: /* see dix/window.c */ #if CYGWINDOWING_DEBUG @@ -1036,9 +1048,13 @@ winTopLevelWindowProc (HWND hwnd, UINT message, (int)(GetTickCount ())); } #endif - /* Adjust the X Window to the moved Windows window */ - winAdjustXWindow (pWin, hwnd); - if (wParam == SIZE_MINIMIZED) winReorderWindowsMultiWindow(); + if (!hasEnteredSizeMove) + { + /* Adjust the X Window to the moved Windows window */ + winAdjustXWindow (pWin, hwnd); + if (wParam == SIZE_MINIMIZED) winReorderWindowsMultiWindow(); + } + /* else: wait for WM_EXITSIZEMOVE */ return 0; /* end of WM_SIZE handler */ case WM_STYLECHANGING: --------------060906040606030906060500 Content-Type: text/plain; charset=us-ascii Content-length: 223 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/ --------------060906040606030906060500--