Fix expose event handling
parent
98d3c78525
commit
0f18151f15
|
|
@ -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$ ] }
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue