From 9dee3433c178a82c64e8133e2940677f2389c0a7 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Thu, 12 Sep 2024 10:17:42 +0100 Subject: [PATCH] Remove Windows ifdef for VK_DECIMAL There was Windows specific ifdef code for the setting of the event keyval property to GDK_KEY_KP_Decimal in five locations which is now redundant. The requirement for this was fixed in Gtk version 3.17.2 https://gitlab.gnome.org/GNOME/gtk/-/commit/578043f97e891e423648c9f70ddf1d185f4615c4 --- gnucash/gnome-utils/gnc-amount-edit.c | 5 ----- gnucash/gnome/gnc-budget-view.c | 6 ------ gnucash/register/register-gnome/formulacell-gnome.c | 6 +----- gnucash/register/register-gnome/gnucash-sheet.c | 8 +------- gnucash/register/register-gnome/pricecell-gnome.c | 5 ----- 5 files changed, 2 insertions(+), 28 deletions(-) diff --git a/gnucash/gnome-utils/gnc-amount-edit.c b/gnucash/gnome-utils/gnc-amount-edit.c index 969da4c636a..dedfbeb909f 100644 --- a/gnucash/gnome-utils/gnc-amount-edit.c +++ b/gnucash/gnome-utils/gnc-amount-edit.c @@ -278,11 +278,6 @@ gnc_amount_edit_key_press (GtkWidget *widget, GdkEventKey *event, gpointer user_ gtk_widget_set_tooltip_text (GTK_WIDGET(gae->image), NULL); } -#ifdef G_OS_WIN32 - /* gdk never sends GDK_KEY_KP_Decimal on win32. See #486658 */ - if (event->hardware_keycode == VK_DECIMAL) - event->keyval = GDK_KEY_KP_Decimal; -#endif if (event->keyval == GDK_KEY_KP_Decimal) { gchar *decimal; diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c index dab47171d0b..311b81306e5 100644 --- a/gnucash/gnome/gnc-budget-view.c +++ b/gnucash/gnome/gnc-budget-view.c @@ -773,12 +773,6 @@ gbv_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data) if (event->type != GDK_KEY_PRESS || !priv->temp_cr) return FALSE; -#ifdef G_OS_WIN32 - /* gdk never sends GDK_KEY_KP_Decimal on win32. See #486658 */ - if (event->hardware_keycode == VK_DECIMAL) - event->keyval = GDK_KEY_KP_Decimal; -#endif - switch (event->keyval) { case GDK_KEY_KP_Decimal: diff --git a/gnucash/register/register-gnome/formulacell-gnome.c b/gnucash/register/register-gnome/formulacell-gnome.c index 74691f34eb1..196d7d2099a 100644 --- a/gnucash/register/register-gnome/formulacell-gnome.c +++ b/gnucash/register/register-gnome/formulacell-gnome.c @@ -71,11 +71,7 @@ gnc_formula_cell_direct_update( BasicCell *bcell, * this after fixing a bug where one copy was kept up to date, and the * other not. So, fix this. */ -#ifdef G_OS_WIN32 - /* gdk never sends GDK_KEY_KP_Decimal on win32. See #486658 */ - if (event->hardware_keycode == VK_DECIMAL) - event->keyval = GDK_KEY_KP_Decimal; -#endif + switch (event->keyval) { case GDK_KEY_Return: diff --git a/gnucash/register/register-gnome/gnucash-sheet.c b/gnucash/register/register-gnome/gnucash-sheet.c index 3590e909c92..1dad75c7d50 100644 --- a/gnucash/register/register-gnome/gnucash-sheet.c +++ b/gnucash/register/register-gnome/gnucash-sheet.c @@ -1876,14 +1876,8 @@ gnucash_sheet_key_press_event (GtkWidget *widget, GdkEventKey *event) sheet = GNUCASH_SHEET(widget); /* bug#60582 comment#27 2 save shift state to enable and - bug#618434 - save keyval to handle GDK_KEY_KP_Decimal event */ -#ifdef G_OS_WIN32 - /* gdk never sends GDK_KEY_KP_Decimal on win32. See #486658 */ - if (event->hardware_keycode == VK_DECIMAL) - event->keyval = GDK_KEY_KP_Decimal; -#endif + sheet->shift_state = event->state & GDK_SHIFT_MASK; sheet->keyval_state = (event->keyval == GDK_KEY_KP_Decimal) ? GDK_KEY_KP_Decimal : 0; diff --git a/gnucash/register/register-gnome/pricecell-gnome.c b/gnucash/register/register-gnome/pricecell-gnome.c index f0c22f8d95a..5392b928dd7 100644 --- a/gnucash/register/register-gnome/pricecell-gnome.c +++ b/gnucash/register/register-gnome/pricecell-gnome.c @@ -60,11 +60,6 @@ gnc_price_cell_direct_update (BasicCell *bcell, is_return = FALSE; -#ifdef G_OS_WIN32 - /* gdk never sends GDK_KEY_KP_Decimal on win32. See #486658 */ - if (event->hardware_keycode == VK_DECIMAL) - event->keyval = GDK_KEY_KP_Decimal; -#endif switch (event->keyval) { case GDK_KEY_Return: