Commit Graph

178 Commits

Author SHA1 Message Date
Ryan Lortie
a37ddbe74b menu binding docs: Link to insert_action_group()
It's pretty useless to make a menu without actions behind it and people
who are using gtk_menu_shell_bind_model() directly are probably not
interested in doing it the GtkApplicationWindow way (so they won't get
the "app" and "win" groups for free).  People are going to need to call
gtk_widget_insert_action_group(), so mention this in the docs to help
them along.
2013-04-18 07:11:15 -04:00
Ryan Lortie
5617b58420 Introduce GtkMenuTracker
GtkMenuTracker folds a nested structure of sections in a GMenuModel into
a single linear menu, which it expresses to its user by means of 'insert
item at position' and 'remove item at position' callbacks.

The logic for where to insert separators and how to handle action
namespaces is contained within the tracker, removing the need to have
this logic duplicated in the 3 or 4 places that consume GMenuModel.

In comparison with the previous code, the tracker no longer completely
destroys and rebuilds menus every time a single change occurs.  As a
result, the new gtkmenu testcase now runs in approximately 3 seconds
instead of ~60 before.

https://bugzilla.gnome.org/show_bug.cgi?id=696468
2013-04-01 16:45:19 -04:00
Benjamin Otte
d20ac0acf9 menushell: Remove unused header 2013-03-28 23:18:58 +01:00
Alexander Larsson
3d4cd4db3e Add gtk_widget_(un)register_window
This replaces the previously hardcoded calls to gdk_window_set_user_data,
and also lets us track which windows are a part of a widget. Old code
should continue working as is, but new features that require the
windows may not work perfectly.

We need this for the transparent widget support to work, as we need
to specially mark the windows of child widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=687842
2013-02-07 11:11:37 +01:00
Benjamin Otte
f770e9ac1e menushell: Remove unused variable
Introduced in 531d0dc32a. Welcome to the
club of people not using -Werror Stéphane.
2012-12-17 17:21:07 +01:00
Stéphane Démurget
531d0dc32a gtkmenushell: Fix an endless loop on focus cycle
This is a simple fallout from sealing gtkmenushell, which only appears
when F10 or Shift-F10 is used in a submenu.

https://bugzilla.gnome.org/show_bug.cgi?id=690266
2012-12-17 16:02:54 +01:00
Matthias Clasen
ce6f43a522 Don't check the same crossing mode twice
This was broken since commit b2aaa94 in 2008. Its commit message
clearly states that the intention was to check for GTK_GRAB,
GTK_UNGRAB and STATE_CHANGED. Lets do that, then.

This was found by Coverity.
2012-11-29 23:10:34 -05:00
Carlos Garnacho
24e9a19abe menushell: Remove gtk-touchscreen-mode usage
This usage in a keybinding signal is hardly related to touchscreens,
so just remove it.
2012-03-01 16:25:23 -05:00
Carlos Garnacho
5139617b91 menus: Handle item selection for touch devices dynamically
Instead of using gtk-touchscreen-mode, the behavior changes depending
on the source device in use.
2012-03-01 16:25:22 -05:00
Rob Bradford
7cc3eb04ec menu: Deactivate the menu if the GdkWindow is withdrawn
If the display server or GDK hides the window - fire the "deactivate" signal
to ensure that the internal state is consistent.

This patch also ensures that the "deactivate" signal will not be fired for a
menu that is not active.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=670881
2012-02-29 12:18:30 +00:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Benjamin Otte
b526375e8f gtk: Fix compiler warnings from include fixes 2011-11-16 04:31:06 +01:00
Rico Tzschichholz
4a43c062ac Fix some implicit declaration warnings
There were some includes of gtkmain.h missing
2011-11-11 13:06:56 +01:00
Matthias Clasen
068e1f0390 Move wholly deprecated files to a subdirectory
Also install their headers to a subdirectory.
2011-11-01 23:51:18 -04:00
Matthias Clasen
8370052180 Don't use *DISABLE_DEPRECATED guards
Instead define GDK_DISABLE_DEPRECATION_WARNINGS where appropriate.
2011-11-01 22:35:57 -04:00
Michael Natterer
5c4f2ef0c1 gtk: move _gtk_modules_has_mixed_deps() to gtkmodlesprivate.h
and remove gtkmainprivate.h completely.
2011-10-23 13:57:07 +02:00
Benjamin Otte
b13544171a menu: Deprecate GtkTearoffMenuItem 2011-10-01 05:59:04 +02:00
Ryan Lortie
05aeaeef9e Signalify (already existing) GtkMenuShell.insert()
gtk_menu_shell_insert() is a virtual function that was being directly
invoked from the class vtable.

Turn it into a proper signal and emit it in the usual way.

https://bugzilla.gnome.org/show_bug.cgi?id=656565
2011-08-25 09:48:12 -04:00
Benjamin Otte
c0df6f9622 menushell: Use GtkMenuShellAccessible as a11y object
Previously it was only used by GtkMenuBar, and that's a naming mismatch.
2011-07-18 18:30:49 +02:00
Matthias Clasen
dd73be389b Fix commit 5f55c42047
Make gtk_menu_shell_activate static and don't use it
outside gtkmenushell.c
2011-04-17 23:15:06 -04:00
Matthias Clasen
b097729d5a Don't leak a list when activating keybindings
Patch by Rui Matos,
https://bugzilla.gnome.org/show_bug.cgi?id=647790
2011-04-14 20:22:18 -04:00
Matthias Clasen
5f55c42047 GtkMenuShell: always 'activate' menu shells
Failing to do so can leave us with a stuck grab in some cases.
https://bugzilla.gnome.org/show_bug.cgi?id=554057
2011-04-13 13:28:46 -04:00
Pavel Holejsovsky
2f0d40335b [GI] Add missing (transfer) annotations 2011-01-20 13:57:18 +01:00
Matthias Clasen
06864ba656 Move GtkMenuShell docs inline 2011-01-14 16:59:29 -05:00
Carlos Garnacho
26db0b7276 Make GtkMenu(Shell) use GtkStyleContext
The default CSS has also been modified to theme these sensibly
2011-01-12 20:55:36 +01:00
Matthias Clasen
b123bc41fd Move docs for gtkmain inline
At the same time, introduce a gtkmainprivate.h header
and various other cleanups.

Based on a patch by Tadej Borovšak.
https://bugzilla.gnome.org/show_bug.cgi?id=617471
2011-01-04 17:32:12 -05:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Matthias Clasen
b5c6904c2f Drop explicit includes of gdkkeysyms.h
These are no longer needed. At the same time, port gtkimcontextsimpleseqs.h
to use the new GDK_KEY_ symbols.
2011-01-04 12:21:41 -05:00
Matthias Clasen
9dee9a84d0 Removed sealed members from GtkMenuItem 2010-12-26 22:58:57 -05:00
Matthias Clasen
ca493cd20d Fix a few warnings 2010-12-23 22:11:50 -05:00
Matthias Clasen
7650482e46 Add sufficient API to make gail work
The accessible implementations should really be folded into
gtk proper. Until that happens, we need some more guts exposed...
2010-12-23 20:11:38 -05:00
Matthias Clasen
2ed81aa57c Remove sealed members from GtkMenuShell 2010-12-23 18:21:53 -05:00
Matthias Clasen
c5b020e628 Remove sealed members from GtkMenu 2010-12-23 15:51:20 -05:00
Tristan Van Berkom
6716e7c3f1 Fixed GtkMenuShell to deactivate itself at dispose time
Since GdkDevice stuff, it seems that destroying an active
menu doesnt get rid of all the device grabery, this fixes
bug 635693.
2010-11-25 14:08:55 +09:00
Michael Natterer
fb5dd9f72f Move all GdkDevice members to private and add one missing accessor 2010-11-23 20:25:13 +01:00
Matthias Clasen
f53ad33994 Remove GtkObject completely 2010-09-26 22:18:19 -04:00
Benjamin Otte
e8a6bad00b gtk: Don't set colormap anymore when creating GDK windows
Colormaps are about to be removed, so not using them sounds like an
awesome idea.
2010-09-26 15:11:31 +02:00
Matthias Clasen
1dcd209cdd Fix a few dubious return values in return_if_fail calls
These were pointed out in bug 623958.
2010-09-19 01:58:46 -04:00
Matthias Clasen
3bd93e5bfd Remove GtkItem
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
2010-09-08 23:38:09 -04:00
Colin Walters
913cdf3be7 GDK: Prefix key names with KEY_
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.
2010-09-08 18:51:44 -04:00
Matthias Clasen
af8539bf11 Move deprectated menu enumerations to a private header
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.
2010-08-28 21:24:11 -04:00
Javier Jardón
03842616fb gtk/gtkmenushell.c: use accessor functions to access GtkWidget 2010-08-22 22:56:09 +02:00
Matthias Clasen
7491e9e97a Allow windows to be dragged by clicking on empty areas
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.
2010-07-16 01:15:47 -04:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Carlos Garnacho
c5a4bd0578 GtkMenuShell: Store device on GTK+ device grab.
gtk_menu_shell_deactivate() needs to know the device to end the
GTK+ grab.
2010-06-16 15:04:27 +02:00
Carlos Garnacho
404f4c5d40 GtkMenuShell: take a single device for grabs.
The other device will always be the associated device.
2010-06-16 15:04:27 +02:00
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Matthias Clasen
6ad8909e3c Make menu scrolling work with auto mnemonics
The menu scrolling code is not robust against menu repositioning so
we have avoid causing unnecessary recalculations of labels in parent
menuitems.
2010-03-17 21:18:31 -04:00
Matthias Clasen
a085bb1f0b Improve the behaviour of automatic mnemonics
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.
2010-03-14 16:11:48 -04:00
Javier Jardón
32b9aeaadd Don't use GTK_WIDGET_STATE in internal code anymore
Use gtk_widget_get/set_state() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-09 02:40:17 +01:00