Merge branch 'wip/carlosg/scrollbar-fixes' into 'master'

Scrollbar fixes

Closes #2879

See merge request GNOME/gtk!2216
This commit is contained in:
Matthias Clasen 2020-07-09 15:56:13 +00:00
commit f00d2b30bb
2 changed files with 21 additions and 5 deletions

View File

@ -1874,6 +1874,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
case XI_Leave:
{
XIEnterEvent *xev = (XIEnterEvent *) ev;
GdkModifierType state;
GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("%s notify:\twindow %ld\n\tsubwindow:%ld\n"
@ -1890,6 +1891,18 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
source_device = g_hash_table_lookup (device_manager->id_table,
GUINT_TO_POINTER (xev->sourceid));
state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
/* Ignore normal crossing events while there is an implicit grab.
* We will receive a crossing event with one of the other details if
* the implicit grab were finished (eg. releasing the button outside
* the window triggers a XINotifyUngrab leave).
*/
if (xev->mode == XINotifyNormal &&
(state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK |
GDK_BUTTON4_MASK | GDK_BUTTON5_MASK)))
break;
if (ev->evtype == XI_Enter &&
xev->detail != XINotifyInferior && xev->mode != XINotifyPassiveUngrab &&
GDK_IS_TOPLEVEL (surface))
@ -1916,12 +1929,11 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
device,
source_device,
xev->time,
_gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group),
state,
(double) xev->event_x / scale,
(double) xev->event_y / scale,
translate_crossing_mode (xev->mode),
translate_notify_type (xev->detail));
}
break;
case XI_FocusIn:

View File

@ -1169,10 +1169,13 @@ check_update_scrollbar_proximity (GtkScrolledWindow *sw,
gboolean indicator_close, on_scrollbar, on_other_scrollbar;
indicator_close = coords_close_to_indicator (sw, indicator, x, y);
on_scrollbar = (target == indicator->scrollbar);
on_scrollbar = (target == indicator->scrollbar ||
gtk_widget_is_ancestor (target, indicator->scrollbar));
on_other_scrollbar = (!on_scrollbar &&
(target == priv->hindicator.scrollbar ||
target == priv->vindicator.scrollbar));
target == priv->vindicator.scrollbar ||
gtk_widget_is_ancestor (target, priv->hindicator.scrollbar) ||
gtk_widget_is_ancestor (target, priv->vindicator.scrollbar)));
if (indicator->over_timeout_id)
{
@ -1262,7 +1265,8 @@ captured_motion (GtkEventController *controller,
if (priv->vscrollbar_visible)
indicator_start_fade (&priv->vindicator, 1.0);
if (!target &&
if ((target == priv->child ||
gtk_widget_is_ancestor (target, priv->child)) &&
(state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)) != 0)
{
indicator_set_over (&priv->hindicator, FALSE);