Fix expose event handling

slava 2006-03-23 21:14:53 +00:00
parent 98d3c78525
commit 0f18151f15
3 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,8 @@ IN: x11
USING: alien arrays errors gadgets hashtables io kernel math
namespaces prettyprint sequences strings threads ;
GENERIC: expose-event ( event window -- )
GENERIC: resize-event ( event window -- )
GENERIC: button-down-event ( event window -- )
@ -45,6 +47,7 @@ GENERIC: client-event ( event window -- )
: handle-event ( event window -- )
over XAnyEvent-type {
{ [ dup Expose = ] [ drop expose-event ] }
{ [ dup ConfigureNotify = ] [ drop resize-event ] }
{ [ dup ButtonPress = ] [ drop button-down-event$ ] }
{ [ dup ButtonRelease = ] [ drop button-up-event$ ] }

View File

@ -10,6 +10,8 @@ strings x11 ;
! The window is an X11 window ID, and the context is a
! GLX context pointer.
M: world expose-event ( event world -- ) nip relayout ;
M: world resize-event ( event world -- )
>r
dup XConfigureEvent-width swap XConfigureEvent-height 0

View File

@ -12,7 +12,8 @@ USING: alien hashtables kernel math namespaces sequences ;
XCreateColormap ;
: event-mask ( -- n )
StructureNotifyMask
ExposureMask
StructureNotifyMask bitor
KeyPressMask bitor
KeyReleaseMask bitor
ButtonPressMask bitor