To: vim-dev@vim.org Subject: Patch 6.2.251 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.251 Problem: GTK: The 'v' flag in 'guioptions' doesn't work. (Steve Hall) Order of buttons is reversed for GTK 2.2.4. Don't always get focus back after handling a dialog. Solution: Make buttons appear vertically when desired. Reverse the order in which buttons are added to a dialog. Move mouse pointer around when the dialog is done and we don't have focus. Files: src/gui_gtk.c *** ../vim-6.2.250/src/gui_gtk.c Fri Feb 6 19:31:57 2004 --- src/gui_gtk.c Mon Feb 9 17:43:19 2004 *************** *** 2025,2030 **** --- 2025,2044 ---- button_string = vim_strsave(button_string); /* must be writable */ if (button_string == NULL) return; + + /* Check 'v' flag in 'guioptions': vertical button placement. */ + if (vim_strchr(p_go, GO_VERTICAL) != NULL) + { + GtkWidget *vbutton_box; + + vbutton_box = gtk_vbutton_box_new(); + gtk_widget_show(vbutton_box); + gtk_box_pack_end(GTK_BOX(GTK_DIALOG(dialog)->vbox), + vbutton_box, TRUE, FALSE, 0); + /* Overrule the "action_area" value, hopefully this works... */ + GTK_DIALOG(dialog)->action_area = vbutton_box; + } + /* * Yes this is ugly, I don't particularly like it either. But doing it * this way has the compelling advantage that translations need not to *************** *** 2037,2044 **** /* * Yes, the buttons are in reversed order to match the GNOME 2 desktop * environment. Don't hit me -- it's all about consistency. */ ! for (index = n_buttons; index > 0; --index) { char *label; char_u *label8; --- 2051,2060 ---- /* * Yes, the buttons are in reversed order to match the GNOME 2 desktop * environment. Don't hit me -- it's all about consistency. + * Well, apparently somebody changed his mind: with GTK 2.2.4 it works the + * other way around... */ ! for (index = 1; index <= n_buttons; ++index) { char *label; char_u *label8; *************** *** 2165,2170 **** --- 2181,2199 ---- CONVERT_FROM_UTF8_FREE(text); } gtk_widget_destroy(dialog); + } + + /* Terrible hack: When the text area still has focus when we remove the + * dialog, somehow gvim loses window focus. This is with "point to type" + * in the KDE 3.1 window manager. Warp the mouse pointer to outside the + * window and back to avoid that. */ + if (!gui.in_focus) + { + int x, y; + + gdk_window_get_pointer(gui.drawarea->window, &x, &y, NULL); + gui_mch_setmouse(-100, -100); + gui_mch_setmouse(x, y); } return response > 0 ? response : 0; *** ../vim-6.2.250/src/version.c Tue Feb 10 19:38:20 2004 --- src/version.c Tue Feb 10 19:39:56 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 251, /**/ -- I AM THANKFUL... ...for the clothes that fit a little too snug because it means I have more than enough to eat. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///