Commit Graph

17016 Commits

Author SHA1 Message Date
Matthias Clasen
0b5f12975f Consistently allow -1 to mean 'append' in tree models
Both GtkListStore and GtkTreeStore had a few methods that allowed
-1 to mean 'append' when specified as a position, but others that
demanded positive position arguments. Make this consistent by
always allowing -1.
https://bugzilla.gnome.org/show_bug.cgi?id=667808
2012-07-12 08:42:34 -04:00
Emmanuele Bassi
3d7a2d7883 Ensure that XDG_DATA_HOME is created before using it
The recently-used.xbel storage for recently used files is located inside
the $XDG_DATA_HOME directory; there's no actual guarantee that the
directory has been created already, even though it's very highly
probable on any modern distribution. We should create it, along with its
intermediate parents, before constructing the file monitor that we use
to get change notifications.

https://bugzilla.gnome.org/show_bug.cgi?id=671817

https://bugzilla.gnome.org/show_bug.cgi?id=667808
2012-07-12 08:42:33 -04:00
Matthias Clasen
5de021cfdc Revert "level-bar: introduce GtkLevelBar"
This reverts commit 126a2308ca.

Pushed by mistake.
2012-07-11 07:15:34 -04:00
Cosimo Cecchi
126a2308ca level-bar: introduce GtkLevelBar
Similar to CcStrengthBar from gnome-control-center, but more generic and
with thorough CSS styling support.

https://bugzilla.gnome.org/show_bug.cgi?id=677892
2012-07-10 22:41:12 -04:00
Matthias Clasen
f7683b05b1 GtkApplication: Fix unsetting menu models
Pointed out by Zachary Dovel in
http://bugzilla.gnome.org/show_bug.cgi?id=679705
2012-07-10 21:25:58 -04:00
Matthias Clasen
b90f40544f Silence the build
Hide gdbus-codegen behind $(AM_V_GEN) for silence and cleanliness.
2012-07-09 22:12:45 -04:00
Antoine Jacoutot
974212ec82 OpenBSD: use G_N_ELEMENTS instead of nitems
nitems is never guaranteed to be defined in sys/params.h as it is meant
to be defined within a protected ifdef __KERNEL conditional.
Use G_N_ELEMENTS from GLib which is the proper way of doing this.
2012-07-09 18:20:34 +02:00
Benjamin Otte
b900016a05 a11y: Make lockbutton notify about state changes
In particular, ensure that the name of the lockbutton gets updated as
the displayed text of the lockbutton changes.

https://bugzilla.gnome.org/show_bug.cgi?id=677347
2012-07-09 03:12:13 +02:00
Benjamin Otte
58cf6dfaaf a11y: Get lockbutton text directly
Instead of letting the generic button code attempt to find the currently
displayed text, just return the text directly.

https://bugzilla.gnome.org/show_bug.cgi?id=677347
2012-07-09 02:58:22 +02:00
Benjamin Otte
fb1b025cbf a11y: Add separate accessible for GtkLockButton
The accessible doesn't do anything yet, this is just infrastructure
work.
2012-07-09 02:29:16 +02:00
Benjamin Otte
0dbf5db0e1 a11y: Don't mess up if column gets hidden
We were using a function that insisted on visible columns for computing
the potential ID of an invisible column. Not good.

https://bugzilla.gnome.org/show_bug.cgi?id=675990
2012-07-09 01:28:26 +02:00
Cosimo Cecchi
f30eab099b entry: guard for != NULL before unreffing the pixbuf
In gtk_entry_get_icon_pixbuf() we unreference the pixbuf that
_gtk_icon_helper_ensure_pixbuf() gives us back, since the function
doesn't return a reference, and by doing so we're able to return the
reference owned by the cached icon helper.
Since the icon helper method can return NULL though, if no icon
properties have been set on it, guard for != NULL before unreffing the
pixbuf, as that would cause a critical warning.

https://bugzilla.gnome.org/show_bug.cgi?id=679537
2012-07-08 00:34:33 -04:00
Cosimo Cecchi
5dbf3a576a modelmenu: listen for toplevel changes on the attach widget
Right now, when we create a GtkModelMenu for a GMenuModel, we listen to
changes to the menu's attach-widget to detect when a toplevel
GtkApplicationWindow becomes available to fetch actions from it.

This unfortunately breaks this simple code:

  GtkWidget *application_window = gtk_application_window_new();
  GtkWidget *menu_button = gtk_menu_button_new();
  GMenuModel *menu_model = get_menu_model();

  gtk_menu_button_set_menu_model(menu_button, menu_model);
  gtk_container_add(GTK_CONTAINER(application_window), menu_button);

Since GtkMenuButton creates a GtkModelMenu and sets itself as its attach
widget before it's added to a hierarchy containing a
GtkApplicationWindow.

Fix the bug by simply listening for changes in the window hierarchy, and
creating the menu model when the attach widget is added to an
application window.

https://bugzilla.gnome.org/show_bug.cgi?id=679454
2012-07-06 11:14:15 -04:00
Cosimo Cecchi
f81bd6c52d menu: notify attach-widget property when menu is detached
When the menu is detached, the attach-widget property changes value to
NULL, so we should notify a property change, like
gtk_menu_attach_to_widget() does.

https://bugzilla.gnome.org/show_bug.cgi?id=679454
2012-07-06 11:14:15 -04:00
Cosimo Cecchi
f22226b3c9 application: fix double free of app_id
This is fallout from commit 257b42e2f9 -
those fields were already getting freed in
gtk_application_shutdown_x11() and my commit caused crashes on quit
instead.

Thanks to Rico Tzschichholz for reporting the bug and testing this fix.
2012-07-05 16:40:23 -04:00
Cosimo Cecchi
06c8739de4 modelmenu: set the accel group on the GtkMenu
Or the accelerators added for actions in the menu won't be displayed in
the menu items.

https://bugzilla.gnome.org/show_bug.cgi?id=679166
2012-07-05 10:21:55 -04:00
Cosimo Cecchi
598163e526 menubutton: set DROPDOWN_MENU hint on the menu toplevel
So the WM can render the menu shadows correctly, omitting the top side,
in the common case the menu is rendered down from a toolbar.

https://bugzilla.gnome.org/show_bug.cgi?id=679449
2012-07-05 10:16:42 -04:00
Cosimo Cecchi
5a5c33097f gtkstyle: add a gtkstyle-fallback style class for RC colors
As an addition to 1042372670, themes might
want to avoid using the hardcoded GTK defaults for legacy GtkStyle
values. Add a gtkstyle-fallback style class that can be used by themes
to tweak the legacy GtkStyle defaults.

https://bugzilla.gnome.org/show_bug.cgi?id=679092
2012-07-02 10:44:40 -04:00
Cosimo Cecchi
257b42e2f9 application: plug some memory leaks 2012-07-02 10:41:29 -04:00
Cosimo Cecchi
f70fc49ebc docs: fix a number of typos and obsolete references 2012-07-02 10:41:11 -04:00
Cosimo Cecchi
d22624b18e menubutton: don't dereference NULL GdkEvent
Since we explictly call popup_menu with NULL when it's
keyboard-activated, we need to be careful and not access event->device
without checking for event != NULL before.
2012-06-29 18:30:53 -04:00
Ryan Lortie
6e11c3106a GActionMuxer: disconnect group signals on finalize
The signals for the action group were being disconnected when the action
group was explicitly removed from the GActionMuxer but the same was not
being done when it was finalized.

This means that a change in the state of an action group that used to be
associated with a finalized GActionMuxer would result in a crash.  This
would happen for stateful application actions after closing a window.
2012-06-28 23:57:57 -04:00
Alexander Larsson
1042372670 Handle transparent colors better in GtkStyle emulation
We can't expose colors with alpha in the GtkStyle colors, since
GdkColor has no alpha. Currently we throw away alpha completely,
which fails very badly for completely transparent backgrounds,
which now is the default for most widgets, as it typically
end up with black-on-black.

We handle this by falling back on the default/previous colors for
transparent colors. This is is simple and avoids complete failure.

https://bugzilla.gnome.org/show_bug.cgi?id=671437
2012-06-28 21:48:14 +02:00
Alejandro Piñeiro
4cfe2a38bf a11y: remove implementation for [add/remove]_global_event_listener
Since release 2.5.3, ATK provides an implementation for those
methods, so toolkits doesn't need to implement them.
2012-06-28 12:38:11 +02:00
Colin Walters
ed8203e700 build: Drop --without-atk-bridge option
Instead, always build it if and only if X11.  This reduces the set of
supported configurations.

https://bugzilla.gnome.org/show_bug.cgi?id=677491
2012-06-26 13:50:39 -04:00
Matthias Clasen
bcdbfa1a9b Don't export private GtkMountOperationHandler api 2012-06-25 16:26:41 -04:00
Cosimo Cecchi
261d2d96e3 radiobutton: add missing (element-type) annotation for radio groups
The GSLists should specify their element-type in every annotation. We
are missing some.

https://bugzilla.gnome.org/show_bug.cgi?id=677127
2012-06-25 14:49:11 -04:00
Cosimo Cecchi
66a2870bfd menu: add missing (scope async) annotation to gtk_menu_popup()
Or the g-i scanner will emit a warning.

https://bugzilla.gnome.org/show_bug.cgi?id=677127
2012-06-25 14:49:11 -04:00
Cosimo Cecchi
8ff9770c7f widget: silence g-i scanner warning
The parameter should be named the same in the definition and the
declararion.

https://bugzilla.gnome.org/show_bug.cgi?id=677127
2012-06-25 14:49:11 -04:00
Cosimo Cecchi
ec1904c779 fontchooser: silence g-i scanner warning
These parameters should be named the same in the definition and the
declaration.

https://bugzilla.gnome.org/show_bug.cgi?id=677127
2012-06-25 14:49:11 -04:00
Cosimo Cecchi
37bb0ce884 actionable: silence g-i scanner warning
The parameter should be named the same in the definition and the
declararion.

https://bugzilla.gnome.org/show_bug.cgi?id=677127
2012-06-25 14:49:11 -04:00
Cosimo Cecchi
9992026ca6 application: fix a typo in introspection annotation
https://bugzilla.gnome.org/show_bug.cgi?id=677127
2012-06-25 14:49:11 -04:00
Alexander Larsson
6c04296f03 Rename gtk_icon_view_get_cell_area to gtk_icon_view_get_cell_rect
get_cell_area was "conflicting" with the property named "cell-area"
which is something different.
2012-06-25 15:07:13 +02:00
Matthias Clasen
a84effadc2 Cosmetics 2012-06-23 13:08:03 -04:00
Matthias Clasen
cea4b80096 Fix a compiler warning
This was introduced in the previous commit.
2012-06-23 13:07:47 -04:00
Matthias Clasen
3056324570 GtkNotebook: Fix reverse tab order
When using Shift-Tab to move the focus out of page content onto
the tab label, we end up in a situation where both Tab and Shift-Tab
move focus back into the page, which is not really what is expected
when the notebook is part of a dialog.

Instead, arrange things so that using Shift-Tab with focus on a
tab label moves the focus out of the notebook.

http://bugzilla.gnome.org/show_bug.cgi?id=669986
2012-06-23 12:37:20 -04:00
Colin Walters
376783f64f gtkdbusinterfaces: Fix srcdir != builddir 2012-06-23 12:19:06 -04:00
Rico Tzschichholz
e28021b3c1 gtk: add gtkdbusinterfaces.xml to EXTRA_DIST 2012-06-23 17:48:27 +02:00
Matthias Clasen
325cf071d1 GtkNotebook: Maintain invariants during tab dnd
It turns out that we can end up removing a notebook child while
the tab is still 'detached'. Child removal causes
gtk_notebook_remove_tab_label() to be called on the tab label,
but that function did not deal with the eventuality that the tab
label may be a child of the dnd window.

http://bugzilla.gnome.org/show_bug.cgi?id=677943
2012-06-23 10:04:14 -04:00
Chun-wei Fan
887f13cf9f gtk/gtkcsseasevalue.c: Remove C99ism 2012-06-23 12:48:32 +08:00
Chun-wei Fan
1eceadbc25 gtk/Makefile.am: Fix Visual C++ disthook rules
gtkdbusgenerated.c needs to be included in the projects as well.
2012-06-23 12:15:59 +08:00
Colin Walters
71e0e72c69 build: Add --without-atk-bridge, only check for it on X11 platforms
Some builders using gtk3 outside of the GNOME cycle want an option to
avoid linking to atk-bridge-2.0.  Provide that, and at the same time
ensure we're only looking for it on X11 platforms.

https://bugzilla.gnome.org/show_bug.cgi?id=677491
2012-06-22 23:49:24 -04:00
Cosimo Cecchi
44fd03eb47 mountoperation: use the Shell DBus proxy if available
Make GMountOperation look for an owner of org.Gtk.MountOperationHandler
if possible, and use it instead of the GTK-based dialogs.
This allows applications to use the implementation offered by the
desktop shell, if available, through a DBus private interface:
org.Gtk.MountOperationHandler.

https://bugzilla.gnome.org/show_bug.cgi?id=674963
2012-06-22 16:49:05 -04:00
Alexander Larsson
fb91fa2fbd Add gtk_icon_view_get_cell_area
This gets the current cell area of a particular item. Its similar
to gtk_tree_view_get_cell_area().

The code is extracted from gtk_icon_view_set_tooltip_cell which now
just calls the old code.

https://bugzilla.gnome.org/show_bug.cgi?id=678418
2012-06-22 13:50:33 -04:00
Dan Vrátil
4243c3a1e2 Fix a memory leak in GtkImage
https://bugzilla.gnome.org/show_bug.cgi?id=678175
2012-06-20 08:27:01 +02:00
Pavel Holejsovsky
7572325efb GtkImage: fix get_property('stock')
The code was trying to get icon's name instead of icon's stock-id.

https://bugzilla.gnome.org/show_bug.cgi?id=678407
2012-06-19 15:58:11 +02:00
Benjamin Otte
9b47bc5c95 widget: don't call gtk_style_context_set_background if app_paintable
When a widget is app_paintable, its background should not be drawn by
the theme, thus we should not try to override its background again when
style-updated is fired.
This is a bit of a hack, but it fixes gray surfaces observed for DnD
windows with recent GTK+.
2012-06-18 10:33:42 -04:00
Bastien Nocera
50cd57020c gtkmenutoolbutton: Use GtkMenuButton
To implement the drop-down menu.

https://bugzilla.gnome.org/show_bug.cgi?id=668013
2012-06-15 17:24:42 +01:00
Bastien Nocera
9fef2dc0d1 gtkmenubutton: Add menu button widget
As used in Totem and gnome-contacts. The widget
takes either a GtkMenu or a GMenuModel to construct
its menu, and can be given a parent widget to use to
position the drop-down (as used in GtkMenuToolButton).

https://bugzilla.gnome.org/show_bug.cgi?id=668013
2012-06-15 17:24:42 +01:00
Bastien Nocera
ffe1e31a2c gtk: Always load the atk-bridge
Slightly modified by Alejandro Piñeiro

https://bugzilla.gnome.org/show_bug.cgi?id=677491
2012-06-15 17:09:19 +01:00