From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17323 invoked by alias); 18 Sep 2002 20:50:57 -0000 Mailing-List: contact insight-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sources.redhat.com Received: (qmail 17314 invoked from network); 18 Sep 2002 20:50:56 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 18 Sep 2002 20:50:56 -0000 Received: from redhat.com (totem.toronto.redhat.com [172.16.14.242]) by touchme.toronto.redhat.com (Postfix) with ESMTP id ECE96B8831; Wed, 18 Sep 2002 16:50:55 -0400 (EDT) Message-ID: <3D88E72F.3040406@redhat.com> Date: Wed, 18 Sep 2002 13:50:00 -0000 From: Fernando Nasser Organization: Red Hat , Inc. - Toronto User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: insight@sources.redhat.com, "Martin M. Hunt" Subject: Modal Dialogs lose grab when comboboxes are used Content-Type: multipart/mixed; boundary="------------040107040708030608070907" X-SW-Source: 2002-q3/txt/msg00168.txt.bz2 This is a multi-part message in MIME format. --------------040107040708030608070907 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1245 This happened in another application and I just checked and we also suffer from the same problem. When we create a modal dialog we usually have a local grab that prevents the user to meddle with the main window (and others) before we dismiss the modal one. We use this for preferences, target selection, attaching a target... things that we cannot proceed before they are settled. The problem is that if these dialogs have a combobox and the combobox is expanded, a global grab is used by the combobox so that it is unposted regardless of where in the desktop you click (Tk menus do the same). Unfortunately once you grab the focus, any previous grab is lost (unless you take care of saving and restoring it, what the combobox doesn't seem to be doing). This problem is common to the iwidgets:combobox and our own libgui combobox. I have a possible fix to libgui that seems to solve our problem. Maybe Martin can double check that for us. Here is the CL (patch attached): * library/combobox.tcl (build): New variable to save grabs. (widgetProc): Save and restore previous grabs. -- Fernando Nasser Red Hat - Toronto E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9 --------------040107040708030608070907 Content-Type: text/plain; name="COMBOBOX.PATCH" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="COMBOBOX.PATCH" Content-length: 1518 Index: library/combobox.tcl =================================================================== RCS file: /cvs/src/src/libgui/library/combobox.tcl,v retrieving revision 1.2 diff -c -p -r1.2 combobox.tcl *** library/combobox.tcl 8 Sep 2001 22:34:46 -0000 1.2 --- library/combobox.tcl 18 Sep 2002 20:40:49 -0000 *************** proc ::combobox::build {w args } { *** 106,111 **** --- 106,112 ---- variable options variable oldValue variable ignoreTrace + variable grablist variable this array set widgets {} *************** proc ::combobox::doInternalWidgetCommand *** 677,682 **** --- 678,684 ---- proc ::combobox::widgetProc {w command args} { upvar ::combobox::${w}::widgets widgets upvar ::combobox::${w}::options options + upvar ::combobox::${w}::grablist grablist # this is just shorthand notation... set doWidgetCommand \ *************** proc ::combobox::widgetProc {w command a *** 787,792 **** --- 789,795 ---- # *gasp* do a global grab!!! Mom always told not to # do things like this... :-) + set grablist [grab current] grab -global $widgets(this) # fake the listbox into thinking it has focus *************** proc ::combobox::widgetProc {w command a *** 802,807 **** --- 805,813 ---- } # hides the listbox grab release $widgets(this) + foreach grabitem $grablist { + grab set $grabitem + } $widgets(button) configure -relief raised wm withdraw $widgets(popup) --------------040107040708030608070907--