From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13789 invoked by alias); 10 Dec 2012 19:01:59 -0000 Received: (qmail 13771 invoked by uid 22791); 10 Dec 2012 19:01:56 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from a.mx.secunet.com (HELO a.mx.secunet.com) (195.81.216.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Dec 2012 19:01:51 +0000 Received: from localhost (alg1 [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id C2CE01A0079 for ; Mon, 10 Dec 2012 20:01:32 +0100 (CET) Received: from mail-srv1.secumail.de (unknown [10.53.40.200]) by a.mx.secunet.com (Postfix) with ESMTP id F20B11A0078 for ; Mon, 10 Dec 2012 20:01:30 +0100 (CET) Received: from [172.16.48.43] ([172.16.48.43]) by mail-srv1.secumail.de over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 10 Dec 2012 20:01:46 +0100 Message-ID: <50C6318E.1020608@secunet.com> Date: Mon, 10 Dec 2012 19:01:00 -0000 From: Heiko Bihr User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: cygwin-xfree@cygwin.com Subject: Excess MotionNotify events to a minimized window in multiwindow mode Content-Type: multipart/mixed; boundary="------------030203050107040903090309" 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: 2012-12/txt/msg00007.txt.bz2 --------------030203050107040903090309 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 1187 Hi, I think, there is a problem with mouse polling in multiwindow mode (XWin.exe :0 -multiwindow) in Cygwin/X 1.13. If a window gets maximized and then minimized, it will receive motion notify events, whenever the user moves the mouse cursor over the screen. To reproduce the problem, please follow these steps: 1) start XWin.exe in -multiwindow mode 2) start xev 3) maximize xev window 4) minimize xev window 5) move mouse cursor around and watch xev output You will see lots of MotionNotify events from all over the screen. X.org does not show this behaviour and I think, Cygwin/X should not either. The problem is caused by the WIN_POLLING_MOUSE_TIMER_ID, which doesn't get stopped, when the user minimizes a window. I made a small patch against Cygwin/X 1.13.0-1 which will stop the WIN_POLLING_MOUSE_TIMER_ID, whenever the user minimizes a window. If the user changes the window's size again, and the timer was stopped, it will be started again. The patch introduces a new flag in s_pScreenPriv to remember the state of the timer. Regards Heiko Bihr -- Dipl.-Inform. Heiko Bihr Senior Consultant, Software Development Business Unit Government secunet Security Networks AG --------------030203050107040903090309 Content-Type: text/plain; charset=windows-1252; name="cygwin-x-motion-notify.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cygwin-x-motion-notify.patch" Content-length: 3023 diff -ur xserver-cygwin-1.13.0-1.orig/hw/xwin/win.h xserver-cygwin-1.13.0-1/hw/xwin/win.h --- xserver-cygwin-1.13.0-1.orig/hw/xwin/win.h 2012-12-10 15:19:42.093750000 +0100 +++ xserver-cygwin-1.13.0-1/hw/xwin/win.h 2012-12-10 15:27:40.031250000 +0100 @@ -595,6 +595,9 @@ UnrealizeFontPtr UnrealizeFont; #endif + /* mouse polling */ + BOOL bMousePollingTimerStoppedWhileMinimized; + } winPrivScreenRec; #ifdef XWIN_MULTIWINDOWEXTWM diff -ur xserver-cygwin-1.13.0-1.orig/hw/xwin/winmultiwindowwndproc.c xserver-cygwin-1.13.0-1/hw/xwin/winmultiwindowwndproc.c --- xserver-cygwin-1.13.0-1.orig/hw/xwin/winmultiwindowwndproc.c 2012-12-10 15:19:42.140625000 +0100 +++ xserver-cygwin-1.13.0-1/hw/xwin/winmultiwindowwndproc.c 2012-12-10 15:26:50.359375000 +0100 @@ -415,6 +415,22 @@ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) XMING_SIGNATURE); + /* + * Initialize variables for mouse polling in s_pScreenPriv. + * Need to initialize s_pSreenPriv first, as WIN_WINDOW_PROP + * was read before we set it in WM_CREATE + */ + if ((pWin = GetProp (hwnd, WIN_WINDOW_PROP)) != NULL) + { + /* Get a pointer to our window privates */ + pWinPriv = winGetWindowPriv(pWin); + + /* Get pointers to our screen privates and screen info */ + s_pScreenPriv = pWinPriv->pScreenPriv; + + s_pScreenPriv->bMousePollingTimerStoppedWhileMinimized = FALSE; + } + return 0; case WM_INIT_SYS_MENU: @@ -1007,6 +1023,27 @@ return 0; case WM_SIZE: + if(wParam == SIZE_MINIMIZED) + { + /* Kill the timer used to poll mouse events, if window gets minimized */ + if (g_uipMousePollingTimerID != 0) + { + KillTimer (s_pScreenPriv->hwndScreen, WIN_POLLING_MOUSE_TIMER_ID); + g_uipMousePollingTimerID = 0; + s_pScreenPriv->bMousePollingTimerStoppedWhileMinimized = TRUE; + } + } + else + { + /* If timer was killed on minimize, restart it */ + if(s_pScreenPriv->bMousePollingTimerStoppedWhileMinimized == TRUE) + { + s_pScreenPriv->bMousePollingTimerStoppedWhileMinimized = FALSE; + winStartMousePolling(s_pScreenPriv); + } + } + + /* see dix/window.c */ #if CYGWINDOWING_DEBUG { diff -ur xserver-cygwin-1.13.0-1.orig/hw/xwin/winwndproc.c xserver-cygwin-1.13.0-1/hw/xwin/winwndproc.c --- xserver-cygwin-1.13.0-1.orig/hw/xwin/winwndproc.c 2012-12-10 15:19:42.187500000 +0100 +++ xserver-cygwin-1.13.0-1/hw/xwin/winwndproc.c 2012-12-10 15:20:52.703125000 +0100 @@ -139,6 +139,10 @@ winInitNotifyIcon(s_pScreenPriv); } + + /* initialize variables for mouse polling in s_pScreenPriv */ + s_pScreenPriv->bMousePollingTimerStoppedWhileMinimized = FALSE; + return 0; case WM_DISPLAYCHANGE: --------------030203050107040903090309 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/ --------------030203050107040903090309--