This is the mail archive of the guile-gtk@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdk-window-get-events returns all-events-mask


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]