From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jarek Czekalski Newsgroups: gmane.emacs.bugs Subject: bug#15801: 24.3.50; bar scrolling freezes gtk emacs Date: Mon, 09 Dec 2013 00:29:51 +0100 Message-ID: <52A500EF.2090409@poczta.onet.pl> References: <5277EA95.4070001@poczta.onet.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000000080705030606060100" X-Trace: ger.gmane.org 1386545416 27461 80.91.229.3 (8 Dec 2013 23:30:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Dec 2013 23:30:16 +0000 (UTC) To: 15801@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 09 00:30:20 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Vpnnk-0007yI-Ea for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Dec 2013 00:30:16 +0100 Original-Received: from localhost ([::1]:41212 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vpnnj-0008U7-N4 for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Dec 2013 18:30:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vpnnc-0008U1-Ku for bug-gnu-emacs@gnu.org; Sun, 08 Dec 2013 18:30:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VpnnX-0002aA-LR for bug-gnu-emacs@gnu.org; Sun, 08 Dec 2013 18:30:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpnnX-0002ZM-EL for bug-gnu-emacs@gnu.org; Sun, 08 Dec 2013 18:30:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VpnnW-0003PU-Db for bug-gnu-emacs@gnu.org; Sun, 08 Dec 2013 18:30:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <5277EA95.4070001@poczta.onet.pl> Resent-From: Jarek Czekalski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Dec 2013 23:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15801 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15801-submit@debbugs.gnu.org id=B15801.138654534213002 (code B ref 15801); Sun, 08 Dec 2013 23:30:02 +0000 Original-Received: (at 15801) by debbugs.gnu.org; 8 Dec 2013 23:29:02 +0000 Original-Received: from localhost ([127.0.0.1]:38896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VpnmW-0003NM-KT for submit@debbugs.gnu.org; Sun, 08 Dec 2013 18:29:01 -0500 Original-Received: from smtpo56.poczta.onet.pl ([213.180.142.187]:41076) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VpnmT-0003N8-C5 for 15801@debbugs.gnu.org; Sun, 08 Dec 2013 18:28:58 -0500 Original-Received: from [192.168.17.5] (cj.e-siemianowice.pl [95.215.234.30]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jarekczek@poczta.onet.pl) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 3dd3dM4Zk0zZCwwJ for <15801@debbugs.gnu.org>; Mon, 9 Dec 2013 00:28:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poczta.onet.pl; s=2011; t=1386545335; bh=zL23TwnXLGjXsSQ6fIbGwJmEdob7layXL/0lKnDJ+HU=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type; b=MegnMLk4gy3x1U3bJPM6ryRjForrCAVghipKPNVg1UyMl0iqBqa2pHODj4+fS5jdR HgrDpJQuQZqSx5otr6h3TWf1oP4y5k3LZAas0jXwo6nhRY8QUxLfBAXfEIeg7il/gQ 4UFc2Ai43hxDh4+Mr8IQcshTgnLp4kaNiou1stEs= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:81633 Archived-At: This is a multi-part message in MIME format. --------------000000080705030606060100 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Fixing compilation warning in the patch, missing include blockinput.h. --------------000000080705030606060100 Content-Type: text/plain; charset=ISO-8859-1; name="scroll_freeze_2_1.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="scroll_freeze_2_1.txt" === modified file 'src/ChangeLog' *** src/ChangeLog 2013-12-08 08:05:36 +0000 --- src/ChangeLog 2013-12-08 16:00:41 +0000 *************** *** 1,3 **** --- 1,9 ---- + 2013-12-08 Jarek Czekalski + + Fix freezing with scroll bars of GTK3 Toolkit (Bug#15801). + * keyboard.c: A comment to unblock_input. + * xgselect.c: Prevent Glib main loop recursion. + 2013-12-08 Paul Eggert Use libcrypto's checksum implementations if available, for speed. === modified file 'src/keyboard.c' *** src/keyboard.c 2013-12-07 23:04:10 +0000 --- src/keyboard.c 2013-12-08 15:20:00 +0000 *************** unblock_input_to (int level) *** 7118,7124 **** /* End critical section. If doing signal-driven input, and a signal came in when input was ! blocked, reinvoke the signal handler now to deal with it. */ void unblock_input (void) --- 7118,7129 ---- /* End critical section. If doing signal-driven input, and a signal came in when input was ! blocked, reinvoke the signal handler now to deal with it. ! ! It will also process queued input, if it was not read before. ! When a longer code sequence does not use block/unblock input ! at all, the whole input gathered up to the next call to ! unblock_input will be processed inside that call. */ void unblock_input (void) === modified file 'src/xgselect.c' *** src/xgselect.c 2013-08-27 19:36:28 +0000 --- src/xgselect.c 2013-12-08 22:54:04 +0000 *************** along with GNU Emacs. If not, see #include #include "frame.h" + #include "blockinput.h" + + /* xg_select is a pselect replacement. Why do we need a separate function? + 1. Timeouts. Glib and Gtk rely on timer events. If we did pselect + with a greater timeout then the one scheduled by Glib, we would + not allow Glib to process its timer events. We want Glib to + work smoothly, so we need to reduce our timeout to match Glib. + 2. Descriptors. Glib may listen to more file descriptors than we do. + So we add Glib descriptors to our pselect pool, but we don't change + the value returned by the function. The return value matches only + the descriptors passed as arguments, making it compatible with + plain pselect. */ int xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds, *************** xg_select (int fds_lim, fd_set *rfds, fd *** 45,56 **** int i, nfds, tmo_in_millisec; USE_SAFE_ALLOCA; - /* Do not try to optimize with an initial check with g_main_context_pending - and a call to pselect if it returns false. If Gdk has a timeout for 0.01 - second, and Emacs has a timeout for 1 second, g_main_context_pending will - return false, but the timeout will be 1 second, thus missing the gdk - timeout with a lot. */ - context = g_main_context_default (); if (rfds) all_rfds = *rfds; --- 57,62 ---- *************** xg_select (int fds_lim, fd_set *rfds, fd *** 132,139 **** --- 138,150 ---- #ifdef USE_GTK if (retval == 0) #endif + /* Prevent g_main_dispatch recursion, that would occur without + block_input wrapper, because event handlers call + unblock_input. Event loop recursion was causing Bug#15801. */ + block_input(); while (g_main_context_pending (context)) g_main_context_dispatch (context); + unblock_input(); /* To not have to recalculate timeout, return like this. */ if (retval == 0) --------------000000080705030606060100--