GitLab Commit is coming up on August 3-4. Learn how to innovate together using GitLab, the DevOps platform. Register for free: gitlabcommitvirtual2021.com

Commit 14816c68 authored by Benoît Minisini's avatar Benoît Minisini
Browse files

Fix management of Enter and Leave events.

[GB.GTK]
* BUG: Fix management of Enter and Leave events.

[GB.GTK3]
* BUG: Fix management of Enter and Leave events.
parent ec9b404d
Pipeline #249341637 passed with stage
in 25 minutes and 6 seconds
......@@ -423,12 +423,15 @@ __FOUND_WIDGET:
{
case GDK_ENTER_NOTIFY:
if (event->crossing.detail == GDK_NOTIFY_INFERIOR)
break;
control = find_child(control, (int)event->crossing.x_root, (int)event->crossing.y_root);
if (!control)
goto __HANDLE_EVENT;
#if DEBUG_ENTER_LEAVE
fprintf(stderr, "GDK_ENTER_NOTIFY: %s (%s) %d %d %p %p\n", control->name(), gApplication::_enter ? gApplication::_enter->name() : "ø", (int)event->crossing.x_root, (int)event->crossing.y_root, event->crossing.window, event->crossing.subwindow);
fprintf(stderr, "GDK_ENTER_NOTIFY: %s (%s) %d %d %p [%d] %p\n", control->name(), gApplication::_enter ? gApplication::_enter->name() : "ø", (int)event->crossing.x_root, (int)event->crossing.y_root, event->crossing.window, gdk_window_is_input_only(event->crossing.window), event->crossing.subwindow);
#endif
if (button_grab)
......@@ -469,12 +472,15 @@ __FOUND_WIDGET:
case GDK_LEAVE_NOTIFY:
#if DEBUG_ENTER_LEAVE
fprintf(stderr, "GDK_LEAVE_NOTIFY: %s %p %p\n", control->name(), event->crossing.window, event->crossing.subwindow);
fprintf(stderr, "GDK_LEAVE_NOTIFY: %s (%d %d) %p %p\n", control->name(), event->crossing.mode, event->crossing.detail, event->crossing.window, event->crossing.subwindow);
#endif
if (button_grab)
break;
if (event->crossing.detail == GDK_NOTIFY_INFERIOR)
break;
//control = find_child(control, (int)event->button.x_root, (int)event->button.y_root);
gApplication::_leave = control;
......
......@@ -2639,7 +2639,7 @@ void gControl::emitEnterEvent(bool no_leave)
gContainer *cont;
#if DEBUG_ENTER_LEAVE
fprintf(stderr, "start enter %s\n", name());
fprintf(stderr, "========== START ENTER %s (%d)\n", name(), no_leave);
#endif
if (parent())
......@@ -2671,15 +2671,18 @@ void gControl::emitEnterEvent(bool no_leave)
onEnterEvent();
#endif
if (!no_leave)
setMouse(mouse());
#if DEBUG_ENTER_LEAVE
fprintf(stderr, "end enter %s\n", name());
fprintf(stderr, ">>>>>>>>>> END ENTER %s\n", name());
#endif
setMouse(mouse());
if (gApplication::_ignore_until_next_enter)
{
//fprintf(stderr, "ignore next enter for %s\n", name());
#if DEBUG_ENTER_LEAVE
fprintf(stderr, "ignore next enter for %s\n", name());
#endif
if (gApplication::_ignore_until_next_enter == this)
gApplication::_ignore_until_next_enter = NULL;
return;
......@@ -2698,7 +2701,7 @@ void gControl::emitLeaveEvent()
return;
#if DEBUG_ENTER_LEAVE
fprintf(stderr, "start leave %s\n", name());
fprintf(stderr, "========== START LEAVE %s\n", name());
#endif
if (isContainer())
......@@ -2717,7 +2720,7 @@ void gControl::emitLeaveEvent()
#endif
#if DEBUG_ENTER_LEAVE
fprintf(stderr, "end leave %s\n", name());
fprintf(stderr, ">>>>>>>>>> END LEAVE %s\n", name());
#endif
if (parent()) parent()->setMouse(parent()->mouse());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment