From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: w32 hourglass cursor Date: Thu, 03 Jul 2014 21:33:18 +0400 Message-ID: <53B593DE.6080008@yandex.ru> References: <53B531D6.4000207@yandex.ru> <53B58540.9070807@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090603020202090004050900" X-Trace: ger.gmane.org 1404408829 26916 80.91.229.3 (3 Jul 2014 17:33:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Jul 2014 17:33:49 +0000 (UTC) Cc: Emacs development discussions To: Dani Moncayo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 03 19:33:42 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X2ktC-0006iF-B5 for ged-emacs-devel@m.gmane.org; Thu, 03 Jul 2014 19:33:42 +0200 Original-Received: from localhost ([::1]:32777 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2ktB-00015G-KS for ged-emacs-devel@m.gmane.org; Thu, 03 Jul 2014 13:33:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2kt2-000150-GE for emacs-devel@gnu.org; Thu, 03 Jul 2014 13:33:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2kst-00045U-0B for emacs-devel@gnu.org; Thu, 03 Jul 2014 13:33:32 -0400 Original-Received: from forward6l.mail.yandex.net ([84.201.143.139]:59206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2kss-00045B-LY for emacs-devel@gnu.org; Thu, 03 Jul 2014 13:33:22 -0400 Original-Received: from smtp4h.mail.yandex.net (smtp4h.mail.yandex.net [84.201.186.21]) by forward6l.mail.yandex.net (Yandex) with ESMTP id BFE4014E0EF5; Thu, 3 Jul 2014 21:33:19 +0400 (MSK) Original-Received: from smtp4h.mail.yandex.net (localhost [127.0.0.1]) by smtp4h.mail.yandex.net (Yandex) with ESMTP id 571D02C3AED; Thu, 3 Jul 2014 21:33:19 +0400 (MSK) Original-Received: from unknown (unknown [37.139.80.10]) by smtp4h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id h3J0IacLrH-XJNmWFYi; Thu, 3 Jul 2014 21:33:19 +0400 (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client certificate not present) X-Yandex-Uniq: 9690cd53-db79-40be-8b94-4015cea1ad66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1404408799; bh=yvTCpP9Z8cudlA/o7mnqqM9jQlawVs1imvBOX2CDcGY=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type; b=XQt8rSuLdF5ooOSF9p9qK/X/iYke/3AVr+q9XtmWjeUhnDWDVWFONYmht+Gn1HdrF aEINuqry6UnaHx65GYUv+/aad3fJ3eaMP0om3OX2v3uh6NTHslAQiJPOHaNvSlyuWA 2o6742ni2Cg7TbmUOJiD4cbvZ1rnI5h1l2O1v1wI= Authentication-Results: smtp4h.mail.yandex.net; dkim=pass header.i=@yandex.ru User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 84.201.143.139 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:172875 Archived-At: This is a multi-part message in MIME format. --------------090603020202090004050900 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 07/03/2014 09:07 PM, Dani Moncayo wrote: > When I move the cursor, its shape change to busy, yes, but when the > execution ends (either by cancelling it with C-g or when it > completes), the shape remains the same (busy). This problem is > specific to the patched binary. Hm.... >> 5) Do M-x new-frame then repeat 1)-4) but move mouse between two frames >> and make sure that you have busy cursor in both of them. > > Here the behavior is equal with or without the patch: the cursor shape > is busy in the original frame (where I started the execution of the > macro) and normal (arrow or I-beam) when I go over the other frame. This is completely different from we have under X where busy cursor is shown on all GUI frames. Could you also please test this stuff (which is mostly borrowed from the relevant X code)? Dmitry --------------090603020202090004050900 Content-Type: text/x-patch; name="w32_hourglass_cursor_2.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="w32_hourglass_cursor_2.patch" =3D=3D=3D modified file 'src/w32fns.c' --- src/w32fns.c 2014-06-29 16:12:08 +0000 +++ src/w32fns.c 2014-07-03 17:25:36 +0000 @@ -89,9 +89,6 @@ extern const char *map_w32_filename (const char *, const char **); extern char * w32_strerror (int error_no); =20 -/* If non-NULL, a handle to a frame where to display the hourglass curso= r. */ -static HWND hourglass_hwnd =3D NULL; - #ifndef IDC_HAND #define IDC_HAND MAKEINTRESOURCE(32649) #endif @@ -233,10 +230,6 @@ extern void syms_of_w32uniscribe (void); extern int uniscribe_available; =20 -/* Function prototypes for hourglass support. */ -static void w32_show_hourglass (struct frame *); -static void w32_hide_hourglass (void); - #ifdef WINDOWSNT /* From w32inevt.c */ extern int faked_key; @@ -5500,95 +5493,62 @@ Busy cursor ***********************************************************************= / =20 -void -w32_note_current_window (void) -{ - struct frame * f =3D SELECTED_FRAME (); - - if (!FRAME_W32_P (f)) - return; - - hourglass_hwnd =3D FRAME_W32_WINDOW (f); -} +/* Display an hourglass cursor. Set the hourglass_p flag in display inf= o + to indicate that an hourglass cursor is shown. */ =20 void show_hourglass (struct atimer *timer) { - struct frame *f; - hourglass_atimer =3D NULL; =20 - block_input (); - f =3D x_window_to_frame (&one_w32_display_info, - hourglass_hwnd); - - if (f) - f->output_data.w32->hourglass_p =3D 0; - else - f =3D SELECTED_FRAME (); - - if (!FRAME_W32_P (f)) - { - unblock_input (); - return; - } - - w32_show_hourglass (f); - unblock_input (); -} - -void -hide_hourglass (void) -{ - block_input (); - w32_hide_hourglass (); - unblock_input (); -} - - -/* Display an hourglass cursor. Set the hourglass_p flag in display inf= o - to indicate that an hourglass cursor is shown. */ - -static void -w32_show_hourglass (struct frame *f) -{ if (!hourglass_shown_p) { - f->output_data.w32->hourglass_p =3D 1; - if (!menubar_in_use && !current_popup_menu) - SetCursor (f->output_data.w32->hourglass_cursor); + Lisp_Oject tail, frame; + + block_input (); + FOR_EACH_FRAME (tail, frame) + { + struct frame *f =3D XFRAME (frame); + + if (FRAME_W32_P (f) && !menubar_in_use && !current_popup_menu) + { + f->output_data.w32->hourglass_p =3D 1; + SetCursor (f->output_data.w32->hourglass_cursor); + } + } + unblock_input (); hourglass_shown_p =3D 1; } } =20 - /* Hide the hourglass cursor on all frames, if it is currently shown. *= / =20 -static void -w32_hide_hourglass (void) +void +hide_hourglass (void) { if (hourglass_shown_p) { - struct frame *f =3D x_window_to_frame (&one_w32_display_info, - hourglass_hwnd); - if (f) - f->output_data.w32->hourglass_p =3D 0; - else - /* If frame was deleted, restore to selected frame's cursor. */ - f =3D SELECTED_FRAME (); - - if (FRAME_W32_P (f)) - SetCursor (f->output_data.w32->current_cursor); - else - /* No cursors on non GUI frames - restore to stock arrow cursor. */ - SetCursor (w32_load_cursor (IDC_ARROW)); - + Lisp_Object tail, frame; + + block_input (); + FOR_EACH_FRAME (tail, frame) + { + struct frame *f =3D XFRAME (frame); + + if (FRAME_W32_P (f)) + { + f->output_data.w32->hourglass_p =3D 0; + SetCursor (f->output_data.w32->current_cursor); + } + else + /* No cursors on non GUI frames - restore to stock arrow cursor. *= / + SetCursor (w32_load_cursor (IDC_ARROW)); + } + unblock_input (); hourglass_shown_p =3D 0; } } =20 - -=0C /***********************************************************************= Tool tips ***********************************************************************= / @@ -8415,9 +8375,6 @@ #endif =20 defsubr (&Sset_message_beep); - - hourglass_hwnd =3D NULL; - defsubr (&Sx_show_tip); defsubr (&Sx_hide_tip); tip_timer =3D Qnil; =3D=3D=3D modified file 'src/xdisp.c' --- src/xdisp.c 2014-07-03 06:00:53 +0000 +++ src/xdisp.c 2014-07-03 17:24:15 +0000 @@ -30683,13 +30683,6 @@ else delay =3D make_timespec (DEFAULT_HOURGLASS_DELAY, 0); =20 -#ifdef HAVE_NTGUI - { - extern void w32_note_current_window (void); - w32_note_current_window (); - } -#endif /* HAVE_NTGUI */ - hourglass_atimer =3D start_atimer (ATIMER_RELATIVE, delay, show_hourglass, NULL); } --------------090603020202090004050900--