Robustify tracking of pointer grab window.

Fri Mar  1 18:39:44 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/{gdkevents-x11.c,gdkmain-x11.c,gdkprivate-x11.h,
        gdkwindow-x11.c}: Robustify tracking of pointer grab window.

        * gdk/x11/gdkmain-x11.c: Keep track of current keyboard
        grab window.

        * gdk/x11/gdkmain-x11.c (gdk_pointer_grab_info_libgtk_only,
        gdk_keyboard_grab_info_libgtk_only): Private libgtk => libgtk
        API for finding out current grab information.

        * gtk/gtkmain.c (rewrite_event_for_grabs): Rewrite events
        so that the effective behavior of owner_events = TRUE is changed
        to "deliver events to same window group normally" instead
        of "deliver events to same application normally. #69934

        * gtk/gtkrange.c: Use an explicit gtk_grab_add() so that
        it works within the GtkList combo, where there is a
        owner_events = FALSE gdk_pointer_grab() already in effect.
        (#65006, reported by Damon Chaplin)
This commit is contained in:
Owen Taylor
2002-03-02 20:37:07 +00:00
committed by Owen Taylor
parent dfe5724765
commit b54e5f4ca1
13 changed files with 470 additions and 16 deletions

View File

@ -1048,6 +1048,8 @@ range_grab_add (GtkRange *range,
{
/* we don't actually gtk_grab, since a button is down */
gtk_grab_add (GTK_WIDGET (range));
range->layout->grab_location = location;
range->layout->grab_button = button;
@ -1058,6 +1060,8 @@ range_grab_add (GtkRange *range,
static void
range_grab_remove (GtkRange *range)
{
gtk_grab_remove (GTK_WIDGET (range));
range->layout->grab_location = MOUSE_OUTSIDE;
range->layout->grab_button = 0;
@ -1305,8 +1309,18 @@ gtk_range_button_release (GtkWidget *widget,
{
GtkRange *range = GTK_RANGE (widget);
range->layout->mouse_x = event->x;
range->layout->mouse_y = event->y;
if (event->window == range->event_window)
{
range->layout->mouse_x = event->x;
range->layout->mouse_y = event->y;
}
else
{
gdk_window_get_pointer (range->event_window,
&range->layout->mouse_x,
&range->layout->mouse_y,
NULL);
}
if (range->layout->grab_button == event->button)
{
@ -1318,7 +1332,7 @@ gtk_range_button_release (GtkWidget *widget,
gtk_range_remove_step_timer (range);
if (grab_location == MOUSE_SLIDER)
update_slider_position (range, event->x, event->y);
update_slider_position (range, range->layout->mouse_x, range->layout->mouse_y);
/* Flush any pending discontinuous/delayed updates */
gtk_range_update_value (range);