From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27516 invoked by alias); 3 Mar 2003 23:07:23 -0000 Mailing-List: contact guile-gtk-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: guile-gtk-owner@sources.redhat.com Received: (qmail 27485 invoked from network); 3 Mar 2003 23:07:22 -0000 Received: from unknown (HELO sunny.pacific.net.au) (203.2.228.40) by 172.16.49.205 with SMTP; 3 Mar 2003 23:07:22 -0000 Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h23N7K82005059 for ; Tue, 4 Mar 2003 10:07:20 +1100 (EST) Received: from localhost (ppp105.dyn228.pacific.net.au [203.143.228.105]) by wisma.pacific.net.au with ESMTP id KAA07032 for ; Tue, 4 Mar 2003 10:07:03 +1100 (EST) Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 18pz0R-0000mk-00; Tue, 04 Mar 2003 09:05:59 +1000 To: guile-gtk@sources.redhat.com Subject: gdk-window-get-events returns all-events-mask From: Kevin Ryde Mail-Copies-To: never Date: Mon, 03 Mar 2003 23:07:00 -0000 Message-ID: <87bs0s9hka.fsf@zip.com.au> User-Agent: Gnus/5.090013 (Oort Gnus v0.13) Emacs/21.2 (i386-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-q1/txt/msg00013.txt.bz2 I think gdk-window-get-events sometimes returns '(all-events-mask) no matter what the actual mask is. For instance, on a recent i386 debian with a recent cvs guile, (use-modules (gtk gtk) (gtk gdk)) (define wid (gtk-window-new 'toplevel)) (gtk-widget-realize wid) (define win (gtk-widget-window wid)) (gdk-window-set-events win '(enter-notify-mask)) (display (gdk-window-get-events win)) prints '(all-events-mask), where I hoped for '(enter-notify-mask) perhaps plus structure-mask or others added by the window manager. It looks like sgtk_enum_flags_init ended up sorting "all-events-mask" to the start of the literals array, then sgtk_flags2scm thinks it matches "val & info->literals[i].value". I think this might happen only sometimes, since if I'm right sgtk_flags_comp sorts based on the SCM pointer for the symbol, which will make the order somewhat arbitrary. Clearly, returning all-events-mask when it's not "all" is incorrect. But I'd think it'd be better not to return it at all, instead return the individual bits, so they can be subtracted from or whatever. Perhaps all-events-mask could be tagged for use only by scm2flags, not flags2scm.