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.
2005-06-25 Matthias Clasen <mclasen@redhat.com>
Add a GrabBroken event to GDK, and a grab-broken-event
signal to GtkWidget. (#107320, Simon Cooke, initial patch
by John Ehresman)
* gdk/gdkevents.h: Add a GDK_GRAB_BROKEN event type,
define a GdkEventGrabBroken event struct.
* gdk/win32/gdkevents-win32.c (gdk_event_translate):
Generate GrabBroken events in response to WM_KILLFOCUS.
* gdk/x11/gdkmain-x11.c: Generate GrabBroken events
when a grab is broken by the window becoming unviewable,
or by another grab from the same client.
* gtk/gtkwidget.h (GtkWidgetClass): Add grab_broken_event.
* gtk/gtkwidget.c (gtk_widget_event_internal): Translate
GrabBroken events into grab_broken_event signals.
* gtk/gtkmain.c (gtk_main_do_event): Propagate GrabBroken
events.
* gtk/gtkmenushell.c (gtk_menu_shell_grab_broken): Deactivate
the menu when the grab is broken.
* gtk/gtkcolorsel.c (gtk_color_selection_grab_broken): Stop
the color picker if the grab is broken.
* gtk/gtkpaned.c (gtk_paned_grab_broken): Stop the drag if
the grab is broken.
2005-05-02 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkmenushell.c (gtk_menu_shell_set_take_focus):
(gtk_menu_shell_get_take_focus): Fix up the docs a bit.
2005-03-31 Michael Natterer <mitch@gimp.org>
Allow to pop up menus without grabbing the keyboard. Useful for
stuff like virtual keyboards. Fixes bug #159890
* gtk/gtk.symbols
* gtk/gtkmenushell.[ch]: added boolean property "take-focus"
and public API gtk_menu_shell_set/get_take_focus().
* gtk/gtkmenu.c (gtk_menu_popup)
(popup_grab_on_window): don't grab the keyboard if take_focus
is FALSE.
* gtk/gtkmenuitem.c (_gtk_menu_item_popup_submen): propagate the
parent menu_shell's take_focus property to the submenu which is
about to be popped up.
2005-03-20 Matthias Clasen <mclasen@redhat.com>
Make PLT-reduction work with gcc4, and don't include
everything in gdkalias.h:
* gtk/grk.symbols: Group symbols by header and source file.
* gtk/makegtkalias.pl: Protect definitions by the same
preprocessor symbols used to guard the headers. Move
the alias declarations to a separate file which is
produced when calling makegtkalias.pl -def
* gdk/Makefile.am (gtkaliasdef.c): Add a rule to generate
this file.
* gtk/*.c: Include gtkalias.h after the other headers,
include gtkaliasdef.c at the bottom.
* gtk/*.h: Small cleanups.
2005-02-11 Matthias Clasen <mclasen@redhat.com>
Support vertical menubars (#166632):
* gtk/gtkenums.h (GtkPackDirection): New enumeration for pack
directions, with values for left-to-right, right-to-left,
top-to-bottom and bottom-to-top.
* gtk/gtk.symbols:
* gtk/gtkmenubar.h:
* gtk/gtkmenubar.c: Add two properties, pack-direction and
child-pack-direction, which specify how children and
grandchildren of a menubar are packed, with getters and setters.
* gtk/gtkmenubar.c (gtk_menu_bar_set_property):
(gtk_menu_bar_get_property): Implement set_property and get_property.
* gtk/gtkmenubar.c (gtk_menu_bar_size_request):
(gtk_menu_bar_size_allocate): Take pack direction into account.
* gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement
move_current here move all the menubar-specific direction
tweaking from the generic menushell implementation here.
* gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific
direction tweaking from the generic menushell implementation here.
* gtk/gtkmenuitem.c (gtk_menu_item_size_request):
(gtk_menu_bar_size_allocate): Take pack direction into account.
* gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request)
(gtk_image_menu_item_size_allocate):
(gtk_image_menu_item_toggle_size_request): Take child pack
direction into account and pack the image vertically if
necessary.
* gtk/gtkmenushell.c (gtk_menu_shell_real_select_item):
Set the submenu direction to left-right for menuitems in
vertical menubars.
(gtk_real_menu_shell_move_current): Simplify by moving
direction tweaking to menu- and menubar-specific
implementations. Take pack direction into account when
doing fallbacks.
* tests/testmenubars.c: Test menubars in various packing
direction combinations.
* tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2004-12-28 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkmenushell.c (gtk_menu_shell_select_submenu_first):
Return a boolean indicating whether an item in the submenu
was selected.
(gtk_real_menu_shell_move_current): When going in child
direction, don't get stuck at completely insensitive
submenus. (#162055, Billy Biggs)