With the demise of GtkList and GtkTree, it has GtkMenuItem as sole
derived class, and is not really adding any value as a separate class.
Its few useful features have been merged into GtkMenuItem.
Bug 629104
The keysyms create a lot of potential namespace conflicts for
C, and are especially problematic for introspection, where we take
constants into the namespace, so GDK_Display conflicts with GdkDisplay.
For C application compatiblity, add gdkkeysyms-compat.h which uses
the old names.
Just one user in GTK+ continues to use gdkkeysyms-compat.h, which is
the gtkimcontextsimple.c, since porting that requires porting more
custom Perl code.
The GtkSubmenuDirection and GtkSubmenuPlacement enumerations
have been deprecated as public API for a while, but are still used
internally in the menu code. Move them to a private header. This
also prevents to generation of GObject boilerplate for these enums.
Allow windows to be dragged by clicking on empty areas in menubars
and toolbars. This is under theme control, via the GtkWidget::window-dragging
style property. The idea is that it makes sense to turn this on if a
theme makes the window frame and the menubar/toolbar appear visually
contiguous.
The main patch was written by Cody Russell, with a contribution by
Ayan George. See bug 611313.
With this change, key events continue to go to an open menu even
when the pointer is moved over a non-selectable menuitem. The mnemonics
are shown and hidden accordingly.
...and show them in menus when navigating the menu with the keyboard.
This is similar to what other platforms do, and reduces visual clutter.
There is a setting to control this. Most of the work on this patch was
done by Thomas Wood. See bug 588554.
2008-08-08 Cody Russell <bratsche@gnome.org>
* gtk/gtkmenushell.c
* gtk/gtkmenu.c: In enter/leave notify events, check that the crossing
mode is not GTK_GRAB, GTK_UNGRAB, or STATE_CHANGED. Fixes regressions
in menus caused by bug #56070.
svn path=/trunk/; revision=21049
2008-06-30 Cody Russell <bratsche@gnome.org>
* Practically everything changed.
Change all references of GIMP Toolkit (and variations of it)
to GTK+ Toolkit, showing no mercy at all to our beloved
ancestry. (#540529)
svn path=/trunk/; revision=20709
2008-04-08 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current): fix a
touchscreen-mode keynav corner case: when navigating to the parent
menu, make sure we don't close two menus at the same time in case
the deepest open menu has no selectable items.
svn path=/trunk/; revision=19981
2008-02-12 Matthias Clasen <mclasen@redhat.com>
* gtk/*.c: Unify the handling of various "Enter" keysyms
all over the place. (#515047, Christian Persch)
svn path=/trunk/; revision=19528
2007-05-25 Michael Natterer <mitch@imendio.com>
Merge fix from maemo-gtk:
* gtk/gtkmenushell.c (gtk_menu_shell_enter_notify): open submenus
also if the menu item we're entering is already selected. Also, it
makes no sense to forward the event to the parent menu shell if we
are entering a menu item of *this* menu shell.
svn path=/trunk/; revision=17911
2007-04-30 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenushell.c (gtk_menu_shell_enter_notify): pop up the
submenu explicitely only in touchscreen mode since otherwise
selecting the item already pops up the submenu. Restores the
drag-selection timeout (spotted by Søren Sandmann, #128968).
svn path=/trunk/; revision=17735
2007-04-27 Michael Natterer <mitch@imendio.com>
Merged heavily modified patch from maemo-gtk which enables opening
and closing submenus on click, and introduces some usability
changes when gtk-touchscreen-mode is enabled (bug #128968):
* gtk/gtkmenushell.c (struct GtkMenuShellPrivate): added boolean
"activated_submenu" to indicate that the current mouse operation
(click or drag) has opened a submenu.
(gtk_menu_shell_button_press): pop up submenus without delay
and record the fact in "activated_submenu".
(gtk_menu_shell_button_release): if a submenu was explicitely
opened, or not opened by this release's button_press, or enough
time has passed since timeout-opening it, close the submenu here.
(gtk_menu_shell_enter_notify): when entering a menu item with
any mouse button pressed, open its submenu.
(gtk_real_menu_shell_move_current): in touchsreen mode, close the
submenu when moving the focus away from it via keyboard-navigation.
* gtk/gtkmenuitem.[ch] (_gtk_menu_item_popup_submenu): added
parameter "gboolean with_delay" so GtkMenuShell can control this
for the different scenarios of submenu showing.
(_gtk_menu_item_popdown_submenu): new function. also needed by
GtkMenuShell for closing submenus on click.
Renamed internal function gtk_menu_item_select_timeout() to
gtk_menu_item_popup_timeout().
(gtk_menu_item_real_popup_submenu): new utility function which
does the actual popup and records the exact time of the popup when
the menu was timeout-opened (using g_get_current_time()).
(gtk_real_menu_item_select): don't add the popup timeout when in
touchscreen mode.
* gtk/gtkmenu.c (gtk_menu_popup): in touchscreen mode, select the
first item of every opened menu.
svn path=/trunk/; revision=17659
2007-04-02 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current): remove
artifact from the time when type checking casts warned on NULL,
some whitespace cleanup.
svn path=/trunk/; revision=17578
2007-02-15 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenushell.c: remove two antique function typedefs that
are probably obsolete for ages.
svn path=/trunk/; revision=17297
2007-02-05 Michael Natterer <mitch@imendio.com>
* gtk/gtksettings.c: add new boolean settings gtk-enable-accels
and gtk-enable-mnemonics which enable/disable accelerators and
mnemonics (bug #72375, based on a patch from Tommi Komulainen).
* gtk/gtkwindow.c (gtk_window_activate_key)
* gtk/gtkmenushell.c (gtk_menu_shell_key_press): don't invoke them
if the resp. setting is FALSE.
* gtk/gtkaccellabel.c (gtk_accel_label_refetch)
* gtk/gtklabel.c (gtk_label_set_pattern_internal): don't display
them if the setting is FALSE.
* gtk/gtklabel.c: added signal connection to the screen's settings
object and traverse all widgets on the screen when the setting
changes. It's slightly ugly to also update GtkAccelLabels here,
but less ugly than connecting and traversing all widgets twice.
svn path=/trunk/; revision=17262
2006-11-16 Michael Natterer <mitch@imendio.com>
Add new infrastructure for notifications of failed keyboard
navigation and navigation with restricted set of keys.
The patch handles configurable beeping, navigating the GUI with
cursor keys only (as in phone environments), and configurable
wrap-around. Fixes bugs #322640, #70986, #318827, #334726, #334742
and #309291.
* gtk/gtksettings.c: added properties gtk-keynav-cursor-only,
gtk-keynav-wrap-around and gtk-error-bell.
* gtk/gtkwidget.[ch]: added new signal "keynav-failed" and public
API to emit it. Added New function gtk_widget_error_bell() which
looks at the gtk-error-bell setting and calls gdk_window_beep()
accordingly.
* gtk/gtk.symbols: add the new widget symbols.
* gtk/gtkcellrendereraccel.c
* gtk/gtkimcontextsimple.c
* gtk/gtkmenu.c
* gtk/gtknotebook.c: use gtk_widget_error_bell() or look at the
gtk-error-bell setting instead of calling gdk_display_beep()
unconditionally.
* gtk/gtkcombobox.c
* gtk/gtkentry.c
* gtk/gtkiconview.c
* gtk/gtklabel.c
* gtk/gtkmenushell.c
* gtk/gtkspinbutton.c
* gtk/gtktextview.c
* gtk/gtktreeview.c: call gtk_widget_error_bell() on failed keynav.
* gtk/gtkentry.c
* gtk/gtklabel.c
* gtk/gtkrange.c
* gtk/gtktextview.c: consult gtk_widget_keynav_failed() on failed
cursor navigation and leave the widget if it returns FALSE.
* gtk/gtkmenushell.c
* gtk/gtknotebook.c: only wrap around if gtk-keynav-wrap-around
is TRUE.
* gtk/gtkradiobutton.c: ask gtk_widget_keynav_failed() to decide
whether to to wrap-around, and don't select active items on cursor
navigation if gtk-keynav-cursor-only is TRUE. Should look at
gtk-keynav-wrap-around too, will look into that.
2005-09-01 Matthias Clasen <mclasen@redhat.com>
* gdk/*.c: Intern some more strings.
* gtk/gtkintl.h:
* gtk/*.c: Define an I_() macro and use it instead of the
bulky g_intern_static_string().
2005-08-31 Matthias Clasen <mclasen@redhat.com>
* gdk/Makefile.am:
* gtk/Makefile.am: Intern type names in code generated by
glib-mkenums, too.
* gtk/*.c:
* gdk/x11/*.c:
* gdk/*.c: Intern type names before registering the type to avoid
unnecessary copies.
2005-06-27 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkmenushell.c (gtk_menu_shell_grab_broken): Ignore
GrabBroken events which are caused by overgrabbing inside
the application; menus rely on these for their operation.
* gdk/gdkevents.h (struct _GdkEventGrabBroken): Add a
grab_window field.
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Set
grab_window to NULL when generating GrabBroken events for
WM_KILLFOCUS messages.
* gdk/x11/gdkmain-x11.c (_gdk_xgrab_check_unmap)
(_gdk_xgrab_check_destroy): Set grab_window to NULL when
generating GrabBroken events when the grab window becomes
unviewable or is destroyed.
* gdk/x11/gdkmain-x11.c (gdk_pointer_grab, gdk_keyboard_grab):
Generate GrabBroken events when overriding a grab inside
the application. In this case, set grab_window to the new
grab_window.