Conversation
Collaborator
|
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.) |
rlepigre
reviewed
Jan 10, 2021
lib/ml_egl.c
Outdated
| { | ||
| CAMLparam1(v) ; | ||
| if(!initialized) | ||
| failwith("Egl.set_motion_notify_callback: not initialized") ; |
Collaborator
There was a problem hiding this comment.
I noticed the error message is wrong here, we should check them all before merging.
Collaborator
There was a problem hiding this comment.
By the way, these functions are all very similar. Maybe we should generate them with a macro.
Owner
Author
|
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.*
|
Owner
Author
|
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.*
|
Owner
Author
|
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.
|
Collaborator
Actually it now works, maybe I did something wrong when testing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cleaning some type for X events, adding focus and entering/leaving window event and
testing these in maze example.