-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleaning and completing callback interface #7
base: master
Are you sure you want to change the base?
Conversation
The leave window event does not seem to work on my machine. When my mouse leaves the window nothing happens (even after I added some debug printing to the callback.) |
lib/ml_egl.c
Outdated
{ | ||
CAMLparam1(v) ; | ||
if(!initialized) | ||
failwith("Egl.set_motion_notify_callback: not initialized") ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed the error message is wrong here, we should check them all before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, these functions are all very similar. Maybe we should generate them with a macro.
Le 21-01-09 16:42:36, Rodolphe Lepigre a écrit :
@rlepigre commented on this pull request.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
In lib/ml_egl.c:
> +void ml_egl_unset_enter_window_callback()
+{
+ CAMLparam0() ;
+ if(!initialized)
+ failwith("Egl.unset_motion_notify_callback: not initialized") ;
+ caml_modify_generational_global_root(&enter_window_callback, default_callback) ;
+ XEventMask = XEventMask & ~EnterWindowMask ;
+ XSelectInput(xdisplay, xwindow, XEventMask);
+ CAMLreturn0 ;
+}
+
+void ml_egl_set_leave_window_callback(value v)
+{
+ CAMLparam1(v) ;
+ if(!initialized)
+ failwith("Egl.set_motion_notify_callback: not initialized") ;
I noticed the error message is wrong here, we should check them all before
merging.
Fixed.
… —
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.*
|
Le 21-01-09 16:40:54, Rodolphe Lepigre a écrit :
The leave window event does not seem to work on my machine. When my mouse
leaves the window nothing happens (even after I added some debug printing to
the callback.)
For me it works on maze, if I leave the window while a key is presses,
the maze stops its movement.
This does not work for you ?
… —
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.*
|
Le 21-01-09 16:43:32, Rodolphe Lepigre a écrit :
@rlepigre commented on this pull request.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
In lib/ml_egl.c:
> +void ml_egl_unset_enter_window_callback()
+{
+ CAMLparam0() ;
+ if(!initialized)
+ failwith("Egl.unset_motion_notify_callback: not initialized") ;
+ caml_modify_generational_global_root(&enter_window_callback, default_callback) ;
+ XEventMask = XEventMask & ~EnterWindowMask ;
+ XSelectInput(xdisplay, xwindow, XEventMask);
+ CAMLreturn0 ;
+}
+
+void ml_egl_set_leave_window_callback(value v)
+{
+ CAMLparam1(v) ;
+ if(!initialized)
+ failwith("Egl.set_motion_notify_callback: not initialized") ;
By the way, these functions are all very similar. Maybe we should generate them
with a macro.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.*
I merged the segfault branch. maze should now print something for
entering and leaving the window. For me it works on my computer with i3.
I may be should try other window manager.
|
Actually it now works, maybe I did something wrong when testing. |
Cleaning some type for X events, adding focus and entering/leaving window event and
testing these in maze example.