| To: vim-dev@vim.org |
| Subject: patch 7.1.069 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.1.069 |
| Problem: GTK GUI: When using confirm() without a default button there still |
| is a default choice. |
| Solution: Ignore Enter and Space when there is no default button. (Chris |
| Lubinski) |
| Files: src/gui_gtk.c |
| |
| |
| |
| |
| |
| *** 1630,1640 **** |
| */ |
| /*ARGSUSED*/ |
| static int |
| ! dlg_key_press_event(GtkWidget * widget, GdkEventKey * event, CancelData *data) |
| { |
| ! /* Ignore hitting Enter when there is no default button. */ |
| ! if (data->ignore_enter && event->keyval == GDK_Return) |
| return TRUE; |
| |
| if (event->keyval != GDK_Escape && event->keyval != GDK_Return) |
| return FALSE; |
| --- 1630,1643 ---- |
| */ |
| /*ARGSUSED*/ |
| static int |
| ! dlg_key_press_event(GtkWidget *widget, GdkEventKey *event, CancelData *data) |
| { |
| ! /* Ignore hitting Enter (or Space) when there is no default button. */ |
| ! if (data->ignore_enter && (event->keyval == GDK_Return |
| ! || event->keyval == ' ')) |
| return TRUE; |
| + else /* A different key was pressed, return to normal behavior */ |
| + data->ignore_enter = FALSE; |
| |
| if (event->keyval != GDK_Escape && event->keyval != GDK_Return) |
| return FALSE; |
| |
| *** 2223,2228 **** |
| --- 2226,2238 ---- |
| dialog_key_press_event_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) |
| { |
| DialogInfo *di = (DialogInfo *)data; |
| + |
| + /* Ignore hitting Enter (or Space) when there is no default button. */ |
| + if (di->ignore_enter && (event->keyval == GDK_Return |
| + || event->keyval == ' ')) |
| + return TRUE; |
| + else /* A different key was pressed, return to normal behavior */ |
| + di->ignore_enter = FALSE; |
| |
| /* Close the dialog when hitting "Esc". */ |
| if (event->keyval == GDK_Escape) |
| |
| |
| |
| *** 668,669 **** |
| --- 668,671 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 69, |
| /**/ |
| |
| -- |
| hundred-and-one symptoms of being an internet addict: |
| 148. You find it easier to dial-up the National Weather Service |
| Weather/your_town/now.html than to simply look out the window. |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ download, build and distribute -- http://www.A-A-P.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |