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, 21 Apr 2014 12:34:18 +0200 Message-ID: <5354F42A.8010605@poczta.onet.pl> References: <5277EA95.4070001@poczta.onet.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040404050209030704010007" X-Trace: ger.gmane.org 1398076524 13127 80.91.229.3 (21 Apr 2014 10:35:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Apr 2014 10:35:24 +0000 (UTC) To: 15801@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 21 12:35:18 2014 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 1WcBZF-0000YB-2Z for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Apr 2014 12:35:17 +0200 Original-Received: from localhost ([::1]:48314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcBZE-0007eI-Me for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Apr 2014 06:35:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcBZ5-0007Se-NB for bug-gnu-emacs@gnu.org; Mon, 21 Apr 2014 06:35:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WcBZ0-0005lk-KQ for bug-gnu-emacs@gnu.org; Mon, 21 Apr 2014 06:35:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcBZ0-0005lC-C1 for bug-gnu-emacs@gnu.org; Mon, 21 Apr 2014 06:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WcBYz-0004Rz-Jn for bug-gnu-emacs@gnu.org; Mon, 21 Apr 2014 06:35:01 -0400 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: Mon, 21 Apr 2014 10:35:01 +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.139807645617002 (code B ref 15801); Mon, 21 Apr 2014 10:35:01 +0000 Original-Received: (at 15801) by debbugs.gnu.org; 21 Apr 2014 10:34:16 +0000 Original-Received: from localhost ([127.0.0.1]:53822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WcBYF-0004Q9-Or for submit@debbugs.gnu.org; Mon, 21 Apr 2014 06:34:16 -0400 Original-Received: from smtpo13.poczta.onet.pl ([213.180.142.144]:37955) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WcBYC-0004Px-GH for 15801@debbugs.gnu.org; Mon, 21 Apr 2014 06:34:14 -0400 Original-Received: from [192.168.17.5] (cj.e-siemianowice.pl [95.215.234.30]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jarekczek@poczta.onet.pl) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 3gC45Z6fhhzYkhq3 for <15801@debbugs.gnu.org>; Mon, 21 Apr 2014 12:34:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poczta.onet.pl; s=2011; t=1398076451; bh=sfcR7snNjjinyjz/vUnDt6/s8GH61ow76se9N9Re97k=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type; b=RbbXMDDRYXHfrN+OWfQwHtzH0u1fRk79LhO33DR6QiffSfZgZ9/vD0NXIwRIZyZ/f t4FCwrVY0OclqrqGsv12Fwy+LdffeDvRNw7g1viloYMFZjOIkbxJjrwWwE5ZdcOZPK UEcENld6bFb3f19ezUw4ymBqAy2lzxp+vKN748fc= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 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:88183 Archived-At: This is a multi-part message in MIME format. --------------040404050209030704010007 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Patch rebased for r117003. --------------040404050209030704010007 Content-Type: text/x-diff; name="scroll_freeze_2_1_r117003.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="scroll_freeze_2_1_r117003.patch" === modified file 'src/ChangeLog' *** src/ChangeLog 2014-04-19 20:32:05 +0000 --- src/ChangeLog 2014-04-21 10:32:13 +0000 *************** *** 2448,2453 **** --- 2448,2459 ---- * alloc.c (Fmemory_limit): Avoid compiler warning. Return 0 always. + 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 Jan Djärv * nsterm.m (updateFrameSize:): Fix GNUstep toolbar not updating. === modified file 'src/keyboard.c' *** src/keyboard.c 2014-04-16 19:43:46 +0000 --- src/keyboard.c 2014-04-21 10:32:13 +0000 *************** *** 7117,7123 **** /* 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) --- 7117,7128 ---- /* 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 2014-04-16 19:43:46 +0000 --- src/xgselect.c 2014-04-21 10:32:13 +0000 *************** *** 28,33 **** --- 28,45 ---- #include #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, *************** *** 47,58 **** bool need_to_dispatch; 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; --- 59,64 ---- *************** *** 136,143 **** if (need_to_dispatch) { int pselect_errno = errno; while (g_main_context_pending (context)) ! g_main_context_dispatch (context); errno = pselect_errno; } --- 142,154 ---- if (need_to_dispatch) { int pselect_errno = errno; + /* 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(); errno = pselect_errno; } --------------040404050209030704010007--