Commit b20f2d26 authored by Christian Dywan's avatar Christian Dywan
Browse files

Reset the pressed state of a button when the screen changes

parent a515a01f
......@@ -2137,12 +2137,23 @@ static void
gtk_button_screen_changed (GtkWidget *widget,
GdkScreen *previous_screen)
GtkButton *button;
GtkSettings *settings;
guint show_image_connection;
if (!gtk_widget_has_screen (widget))
button = GTK_BUTTON (widget);
/* If the button is being pressed while the screen changes the
release might never occur, so we reset the state. */
if (button->button_down)
button->button_down = FALSE;
gtk_button_update_state (button);
settings = gtk_widget_get_settings (widget);
show_image_connection =
......@@ -2159,7 +2170,7 @@ gtk_button_screen_changed (GtkWidget *widget,
GUINT_TO_POINTER (show_image_connection));
show_image_change_notify (GTK_BUTTON (widget));
show_image_change_notify (button);
static void
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