1
0
Fork 0
forked from Miroirs/x49gp

disable making buttons look clicked when using keyboard. Not syre how to re-implement it without using the private GtkButton->in_button field

This commit is contained in:
Gwenhael Le Moine 2024-10-24 15:41:27 +02:00
parent e1f34098c4
commit d8f623938f
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -2375,8 +2375,8 @@ static void x49gp_release_single_button( x49gp_ui_button_t* button, x49gp_ui_but
gtkbutton = GTK_BUTTON( button->button );
if ( button != cause )
gtkbutton->in_button = false;
/* if ( button != cause ) */
/* gtkbutton->in_button = false; */
gtk_button_released( gtkbutton );
key = button->key;
@ -2530,7 +2530,7 @@ static gboolean x49gp_ui_key_event( GtkWidget* widget, GdkEventKey* event, gpoin
x49gp_ui_t* ui = x49gp->ui;
x49gp_ui_button_t* button;
GdkEventButton bev;
gboolean save_in;
/* gboolean save_in; */
int index;
guint keyval;
@ -2804,21 +2804,21 @@ static gboolean x49gp_ui_key_event( GtkWidget* widget, GdkEventKey* event, gpoin
bev.button = 1;
bev.state = event->state;
save_in = GTK_BUTTON( button->button )->in_button;
/* save_in = GTK_BUTTON( button->button )->in_button; */
switch ( event->type ) {
case GDK_KEY_PRESS:
bev.type = GDK_BUTTON_PRESS;
x49gp_ui_button_press( button->button, &bev, button );
GTK_BUTTON( button->button )->in_button = true;
/* GTK_BUTTON( button->button )->in_button = true; */
gtk_button_pressed( GTK_BUTTON( button->button ) );
GTK_BUTTON( button->button )->in_button = save_in;
/* GTK_BUTTON( button->button )->in_button = save_in; */
break;
case GDK_KEY_RELEASE:
bev.type = GDK_BUTTON_RELEASE;
GTK_BUTTON( button->button )->in_button = true;
/* GTK_BUTTON( button->button )->in_button = true; */
gtk_button_released( GTK_BUTTON( button->button ) );
GTK_BUTTON( button->button )->in_button = save_in;
/* GTK_BUTTON( button->button )->in_button = save_in; */
x49gp_ui_button_release( button->button, &bev, button );
break;
default: