Commit Graph

19010 Commits

Author SHA1 Message Date
Matthias Clasen
1b135b28c0 GtkSearchEntry: improve clear icon implementation
Instead of connecting to our own signal, which is generally
considered somewhat unclean, override the class handler
for the icon-release signal.
2013-07-28 20:21:28 -04:00
Matt Barnes
0e350eeea6 GtkApplication: Do not assert sm_proxy != NULL in inhibit functions
Applications have no way of finding out if a session manager proxy was
successfully created in gtk_application_startup_session_dbus(), so it's not
appropriate for certain public GtkApplication functions to be asserting the
presence of a session manager proxy as if it were a programmer error.

This affects:

   gtk_application_inhibit()
   gtk_application_is_inhibited()

If sm_proxy is NULL, the function should just return silently.

In the case of gtk_application_uninhibit(), the application should only be
calling this if it obtained a valid cookie, which implies the presence of a
session manager proxy.  I noted that with a comment.

https://bugzilla.gnome.org/show_bug.cgi?id=701365
2013-07-28 16:09:58 -04:00
Ryan Lortie
3bb059b6e8 Mention of -rdynamic in GtkBuilder lookup error
We toss a g_warning() if we can't find the user's signal handler.  A good chunk
of the time this will be because they didn't use -rdynamic.  Add a note about
that.
2013-07-27 18:15:17 -04:00
John Ralls
b80625a425 Fix broken quartz build due to deprecation of gtkstock.h 2013-07-27 14:24:53 -07:00
Murray Cumming
ac792f4a06 docs: gtk_icon_theme_lookup_by_gicon_for_scale() is new
It was added in commit 58adb70d43 .
2013-07-27 21:38:48 +02:00
Alexandre Quessy
9fb1eb2a09 fix a typo in a comment in gtkwindow.c 2013-07-27 10:18:35 -04:00
Matthias Clasen
cda60c3c40 Another round of template binding api changes
We rename the gtk_widget_class_bind_template_child{_internal}
macros by appending a _private to their name. Otherwise, it
would be too magic to pass the 'public' names as arguments,
but affect a member of the Private struct. At the same time,

Add two new macros with the old names,
gtk_widget_class_bind_template_child{_internal} that operate
on members of the instance struct.
2013-07-26 16:29:12 -04:00
Matthias Clasen
3358c544da Some documentation fixes
Some incomplete renamings in the doc comments for the
template child macros.
2013-07-26 14:10:37 -04:00
Matthias Clasen
fea23b95d9 One forgotten rename 2013-07-26 13:54:27 -04:00
Emmanuele Bassi
89ae3524a3 Rename the widget template API
The macros and functions are inconsistently named, and are not tied to
the "template" concept - to the point that it seems plausible to use
them without setting the template.

The new naming scheme is as follows:

  gtk_widget_class_bind_template_child_full
  gtk_widget_class_bind_template_callback_full

With the convenience macros:

  gtk_widget_class_bind_template_child
  gtk_widget_class_bind_template_child_internal
  gtk_widget_class_bind_template_callback

https://bugzilla.gnome.org/show_bug.cgi?id=700898
https://bugzilla.gnome.org/show_bug.cgi?id=700896
2013-07-26 13:52:15 -04:00
Matthias Clasen
6f78424b5d Trivial typo fix 2013-07-26 08:48:38 -04:00
Alexander Larsson
a8e84545d1 widget: Use a real offset in gtk_widget_class_automate_child
Using an offset from the struct means you can have children in
both the public and private (via G_PRIVATE_OFFSET) parts of the
instance. It also matches the new private macros nicer.

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

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2013-07-26 08:41:09 -04:00
Martin Stransky
9aab40b801 stylecontext: Clear paths in gtk_render_foo()
This ensures that existing paths are properly cleared and don't cause
spurious renderings.

https://bugzilla.gnome.org/show_bug.cgi?id=694086
2013-07-26 13:33:40 +02:00
Stefano Facchini
8781c6560c infobar: really make the close button hidden by default
https://bugzilla.gnome.org/show_bug.cgi?id=704894
2013-07-26 00:21:19 +02:00
David King
9a0fb23625 action: Improve some deprecation notices
Improve on some of the deprecation notices for GtkAction by linking to
other relevant API, and mentioning when there is no direct replacement.

https://bugzilla.gnome.org/show_bug.cgi?id=704392
2013-07-24 17:30:30 -04:00
William Jon McCann
88771f7b1b Add an optional close button to the info bar
This adds gtk_info_bar_{get,set}_show_close_button.
Similar to the one for the search bar. This can replace Cancel
buttons.

https://bugzilla.gnome.org/show_bug.cgi?id=704274
2013-07-24 17:01:42 -04:00
Owen W. Taylor
c7574bb6c8 Disable frame sync for GtkPlug
Plug windows weren't redrawing properly because the embedded
window was expecting to get messages for each frame from the
compositor, but the compositor doesn't know about embedded
windows. Simply disable frame sync for GtkPlug's GdkWindow -
extending XEMBED to handle frame sync isn't interesting
at this point.

A new API gdk_x11_window_set_frame_sync_enabled() is added
to allow this to be done.

https://bugzilla.gnome.org/show_bug.cgi?id=701613
2013-07-22 18:36:58 -04:00
Simon Feltman
ab13787985 Add gtk_tree_model_rows_reordered_with_length introspectable method
Add introspection friendly version of gtk_tree_model_rows_reordered
with a "_with_length" suffix. This allows language bindings to
safely pass an array with length argument. Use the "Rename to:"
annotation to expose as "gtk_tree_model_rows_reordered".

https://bugzilla.gnome.org/show_bug.cgi?id=684558
2013-07-22 13:39:24 -07:00
Alberto Ruiz
3cda2a787b fontchooser: prevent the scale from showing the value as it is shown in the spinbutton already 2013-07-22 16:06:24 +02:00
Murray Cumming
9ea08fae04 docs: gtk_menu_attach_to_widget()
Add a few more clues about why this is useful,
based on
https://mail.gnome.org/archives/gtk-devel-list/2007-November/msg00176.html
and the reference to it from gtk_menu_new_from_model().
2013-07-22 14:10:53 +02:00
Alberto Ruiz
1859fe8dcf fontchooser: Fix smooth scrolling in the scale and the preview entry 2013-07-21 20:46:30 +02:00
Jehan
0e4d9b7793 gtkdialog - more informative warning when ordering unexisting response_id 2013-07-21 21:42:50 +09:00
Emmanuele Bassi
18cf2a0806 Restore gtkimagemenuitem.c
It got lost in commit 0aa57d26b5 and it
broke the build.
2013-07-20 10:47:44 +01:00
Matthias Clasen
b49f966e1f Clean up includes in gtk/deprecated/
Purely cosmetic.
2013-07-19 22:48:12 -04:00
Matthias Clasen
2f1fa7cdc3 Drop some unnecessary includes
Drop includes of deprecated headers where they are
no longer needed.
2013-07-19 22:32:23 -04:00
Matthias Clasen
0aa57d26b5 Move wholly deprecated classes to gtk/deprecated/
We've recently a number of classes wholly. For these cases,
move the headers and sources to gtk/deprecated/ and adjust
Makefiles and includes accordingly.

Affected classes:
GtkAction
GtkActionGroup
GtkActivatable
GtkIconFactory
GtkImageMenuItem
GtkRadioAction
GtkRecentAction
GtkStock
GtkToggleAction
GtkUIManager
2013-07-19 21:39:47 -04:00
Chun-wei Fan
d7b6827856 gtk/gtkrecentchooser.c: Avoid C99isms
Declare variables at the top to the block.

G_GNUC_BEGIN_IGNORE_DEPRECATIONS and G_GNUC_END_IGNORE_DEPRECATIONS with
a ';' at the end is still considered a statement, even if these macros
expand to nothing, which C89 compilers don't really like (oddly speaking)-
but this is life.
2013-07-19 18:38:27 +08:00
William Jon McCann
6f7b0cac94 Deprecate tear off menus 2013-07-18 12:16:02 -04:00
William Jon McCann
2378bff415 Use proper quotation marks
As per https://wiki.gnome.org/GnomeOS/Design/Whiteboards/Typography
2013-07-17 22:37:50 -04:00
William Jon McCann
a4332e7f69 Set reasonable minimum size for the file chooser
At small sizes it just looks broken.
2013-07-17 20:48:59 -04:00
William Jon McCann
94ebe21068 Add a bit of margin on the statusbar
So that the text doesn't touch the side of the window. And it
looks much cleaner.
2013-07-17 20:48:59 -04:00
William Jon McCann
31a2cea4b1 Fix infobar docs to not mention type colors
The theme may not use colors to distinguish the info bar
message types.
2013-07-15 13:19:55 -04:00
William Jon McCann
168f425df0 Make the info bar action area border the same as the internal spacing
Using a consistent spacing feels much more polished.
2013-07-15 13:19:55 -04:00
William Jon McCann
75c8be6b66 Make info bar action area horizontal
A vertical action area causes the info bar to be imposingly large.
This defeats the whole point of the info bar which is to be
unobtrusive. Not to mention it is impossible to make it look
and feel good.
2013-07-15 13:19:55 -04:00
Sébastien Wilmet
68f44c4e90 GtkSearchEntry: fix search_entry_clear_cb()
When the icon-release signal is emitted on a GtkSearchEntry, the
contents is now cleared only if it's for the secondary icon. The primary
icon can be used for another purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=704164
2013-07-15 12:27:21 +02:00
William Jon McCann
4b5a389e88 Deprecate and ignore gtk-entry-password-hint-timeout
This feature offers a number of benefits related to providing
feedback to the user when the password is masked. Some experts have
argued that password masking is harmful. I tend to agree with this
setting providing a better and more moderate solution. Some agree:
https://www.schneier.com/blog/archives/2009/07/the_pros_and_co.html

In order to further lessen the impact I've only enabled the feature
on the primary display since the likelyhood of a non-primary display
being visible by others is higher.
2013-07-11 17:08:15 -04:00
William Jon McCann
dae6afc847 Deprecate and ignore timeout-expand setting 2013-07-11 17:08:15 -04:00
William Jon McCann
57fc8763e9 Deprecate and ignore the timeout-initial and timeout-repeat settings 2013-07-11 17:08:15 -04:00
Jasper St. Pierre
dbe5ea6d32 Ignore extract-strings 2013-07-11 13:13:00 -04:00
Colin Walters
fe8de4ca1b Delete gtk/extract-strings binary from source
It was accidentally committed to git.
2013-07-09 23:24:19 -04:00
Matthias Clasen
3247058a30 Revert the private macro change for GtkToolButton
There was a reason that GtkToolButton was not using the
G_DEFINE_TYPE macros - we need the klass argument to get
the proper button type at init time.
2013-07-09 19:33:31 -04:00
William Jon McCann
6218fb45be Deprecate and hardcode gtk-recent-files-limit
The GtkRecentChooser already has a property that can be used
to set this on a per widget basis and the recent manager already
has a max-age limit.
2013-07-09 09:38:52 -04:00
Matthias Clasen
d0a2e06c7d places sidedbar: deal with lack of symbolics
Use g_themed_icon_new_with_default_fallbacks, so we don't end up
without icons when the theme doesn't have symbolic icons.

https://bugzilla.gnome.org/show_bug.cgi?id=703606
2013-07-09 07:12:18 -04:00
Kjell Ahlstedt
4d86472b92 Continue the deprecation of GtkIconSet
Deprecate gtk_icon_set_render_icon_surface() and gtk_image_get_icon_set(),
which take parameters of the deprecated GtkIconSet.

https://bugzilla.gnome.org/show_bug.cgi?id=703616
2013-07-09 06:54:27 -04:00
Kjell Ahlstedt
16c08ae135 Fix some inconsistent deprecations
Some functions had only a deprecation comment in the .c file, or only a
deprecation annotation in the .h file. Add the missing parts.

https://bugzilla.gnome.org/show_bug.cgi?id=703616
2013-07-09 06:54:26 -04:00
aakash
fc6e725d2f gtkrecentmanager: Avoid confusion between the meta-data and the actual resource.
Fixed the documentation to clarify that gtk_recent_info_get_visited
and gtk_recent_info_get_modified are actually about the recent info
meta-data rather than the resource itself.

https://bugzilla.gnome.org/show_bug.cgi?id=703827
2013-07-09 06:51:45 -04:00
Emmanuele Bassi
84186ef11b deprecated: Use the new macros for adding instance private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
Emmanuele Bassi
365919d5f6 a11y: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:28:49 +01:00
Bastien Nocera
dbee6e1b56 GtkSearchBar: Don't show a close button by default
And mention in which cases we should show one in the documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=703656
2013-07-09 09:17:01 +02:00
Daiki Ueno
837a0d3e40 textlayout: avoid double-free when adding preedit color
In add_preedit_attrs, don't free foreground/background colors already
set in the underlying text attributes (style).  They will be free'd by
release_style.

https://bugzilla.gnome.org/show_bug.cgi?id=703533
2013-07-09 13:21:17 +09:00
Matthias Clasen
50c3eb9acc Fix the small text for text in GtkAboutDialog
The conversion from gtk_widget_override_font to a GtkTextTag
in fbbb66ae7d was defective.

https://bugzilla.gnome.org/show_bug.cgi?id=701119
2013-07-08 21:46:43 -04:00
William Jon McCann
72c3879893 Add missing G_PARAM_DEPRECATED to stock deprecations 2013-07-08 15:39:55 -04:00
William Jon McCann
aeb878a859 Add missing G_PARAM_DEPRECATED to gtksettings 2013-07-08 15:28:25 -04:00
William Jon McCann
7b66956e63 Deprecate and hardcode default toolbar icon size setting
Toolbar icon size can still be changed on a per-widget basis as
needed by the application developer.
2013-07-08 15:02:28 -04:00
William Jon McCann
425e977bb6 Deprecate and hardcode default toolbar style setting
Toolbar style can still be changed on a per-widget basis as
needed by the application developer.
2013-07-08 15:02:28 -04:00
William Jon McCann
e61c124509 Deprecate and hardcode values for gtk-tooltip* timeouts 2013-07-08 15:02:28 -04:00
William Jon McCann
c9bfd12d2f Deprecate and hardcode the value of visible-focus setting
Just use the default value of AUTOMATIC and make it just work.
2013-07-08 15:01:33 -04:00
Matthias Clasen
e5b51050c6 csd: Fix up close buttons
Must pass the window as first argument to the signal handler.
2013-07-06 23:11:19 -04:00
Matthias Clasen
c0c752fab1 Cosmetics 2013-07-06 23:11:19 -04:00
Matthias Clasen
ffadfbf322 Don't prematurely mark window as realized
Other code assumes that the widget has a window if it is realized.
Since we might trigger such code indirectly from gtk_window_realize,
don't mark the window as realized before we've registered its window.
2013-07-05 17:15:31 -04:00
Matthias Clasen
6bcf8a2584 Cosmetic cleanups
Avoid some unnecessary casts.
2013-07-05 15:53:30 -04:00
Matthias Clasen
3982532145 csd: hide invisible borders when tiled or fullscreen
This is the expected behavior, and matches what mutter does.
2013-07-05 15:53:30 -04:00
Matthias Clasen
776111fadf csd: fix a resizing artifacts when unmaximizing
When using Super-up/down to maximize and unmaximize a csd window,
the titlebar and content was not picking up the window borders.
2013-07-05 15:53:30 -04:00
Matthias Clasen
c2196e596f csd: no border when fullscreen
The was a missing fullscreen check in get_decoration_size was causing
the window background to have a transparent border when fullscreen.
2013-07-05 15:53:30 -04:00
Kalev Lember
5d121a8aaa GtkListBox: Add g_return_if_fail checks to public row functions 2013-07-04 16:00:30 +02:00
Kalev Lember
b46d583f87 GtkListBox: Add a function for getting the index of a row
https://bugzilla.gnome.org/show_bug.cgi?id=703618
2013-07-04 15:19:47 +02:00
Kalev Lember
a5d2565b7e GtkListBox: Remove a double semicolon 2013-07-04 14:03:06 +02:00
Alexander Larsson
e12d3cea47 stack: Use normal opacity groups rather than weird ones in GtkWidget
Since we now do all drawing propagation on the cairo_t (rather than
exposing multiple independent times on the GdkWindows) we no longer
need the opacity 0.999 hack.
2013-07-04 13:30:51 +02:00
Alexander Larsson
5f245374ed widget: Remove some leftover code
The norender stuff is not used anymore
2013-07-04 13:16:05 +02:00
Alexander Larsson
9e4af0b746 widget: Don't crash if setting alpha on non-realized widget.
https://bugzilla.gnome.org/show_bug.cgi?id=703154
2013-07-04 13:10:58 +02:00
Bastien Nocera
fa6a137478 GtkSearchBar: Fix automatic entry connection
Adding an entry to the search bar didn't automatically connect
the signals as expected as the code was in the wrong branch.

https://bugzilla.gnome.org/show_bug.cgi?id=703406
2013-07-04 12:52:30 +02:00
Matthias Clasen
4eac681eba Avoid deprecation warning
There was one overlooked use of GTK_STOCK_MISSING_IMAGE.
2013-07-03 19:52:11 -04:00
Alexander Larsson
eac7dce160 File chooser: Convert icons to using cairo_surface_t 2013-07-03 14:39:26 +02:00
Alexander Larsson
b6b24148fb GtkCellRendererPixbuf: Add surface property 2013-07-03 14:39:26 +02:00
Alexander Larsson
31fc70721e GtkImage: Add new_from_surface() and set_from_surface() 2013-07-03 14:39:26 +02:00
Alexander Larsson
031e1a98a0 GtkIconHelper: Convert to using cairo surfaces as base and support scales
We render the source into a cairo_surface_t so that we can render it
with cairo directly, rather than having to convert it from a pixbuf
every time. We also specify the target window when creating the cairo
surface so that rendering can be faster.

Using cairo surfaces also allows us to seamlessly support window scales.

We also add a GTK_IMAGE_SURFACE source type.
2013-07-03 14:39:26 +02:00
Alexander Larsson
635ae9bd91 icon factory: Add gtk_icon_set_render_icon_surface
Support scales when falling back to loading icons from the
icon theme.

In order to actually render scaled icons we add
gtk_icon_set_render_icon_surface which renders to a cairo_surface_t
which includes whatever scaling you need for scaled icons.
2013-07-03 14:39:26 +02:00
Alexander Larsson
91a268f00e stylecontext: add gtk_render_icon_surface
This draws an icon from a cairo_surface. We want to use this more rather
than render_icon as this means we can skip the pixbuf to surface
conversion (including allocation and alpha premultiplication) at
render time, plus we can use create_similar_image which may allow
faster rendering.
2013-07-03 14:39:26 +02:00
Alexander Larsson
1d0bb3e010 GtkIconTheme: Add helpers to load to cairo_surface_t
Right now this just uses the pixbuf load code and converts
it to a surface. In the future we could cache the pattern
to allow reusing the surface.
2013-07-03 14:39:26 +02:00
Carlos Garnacho
58adb70d43 icontheme: Add support for high resolution icons
An optional OutputScale integer key has been added to index.theme
subdirs description, so icon themes may provide icons that are
more suitable to render at a (typically 2x) integer upscaled
resolution. This way it is possible to make eg. a 16x16@2x icon has a
real size of 32x32, but contains a similar level of detail to the
16x16 icon so things don't look any more cluttered on high-dpi
screens.

The pixbuf lookup has changed so it prefers a minimal scale change
that yields the minimal real size difference, so if looking up for
a 16x16 icon at 2x, it would first prefer 16x16@2x, then 32x32, and
then any other icon that's closest to match

There is now *_for_scale() variants for all GtkIconTheme ways
to directly or indirectly fetch a GdkPixbuf.

This is based on code by Carlos Garnacho with changes by Alexander
Larsson
2013-07-03 14:39:26 +02:00
Alexander Larsson
07519abcde CellRendererPixbuf: Set the window on the icon helper
This lets us get scaled icons if needed.
2013-07-03 14:39:26 +02:00
Alexander Larsson
41a6780f22 spinbutton: set the window on the icon helper 2013-07-03 14:39:26 +02:00
Alexander Larsson
f258e757bd entry: Set the window on the icon helper 2013-07-03 14:39:26 +02:00
Alexander Larsson
e042ffa71e GtkImage: Set the window on the gtkiconhelper 2013-07-03 14:39:26 +02:00
Alexander Larsson
5d8fd4ee24 GtkIconHelper: Add set_window()
This is a hint on where the icon will be drawn. It
will allow us to pre-allocate cairo surfaces for the right
target.
2013-07-03 14:39:25 +02:00
Alexander Larsson
48ff7d026e CSS: Add -gtk-scaled(image1,image2,...) support for hidpi assets 2013-07-03 14:39:25 +02:00
Alexander Larsson
af2c40bd54 css: Add a scale argument to css-value compute vfunc
We need to be able to compute different GtkCssImage values
depending on the scale, and we need this at compute time so that
we don't need to read any images other than the scale in used (to
e.g. calculate the image size). GtkStyleProviderPrivate is shared
for all style contexts, so its not right.
2013-07-03 14:39:25 +02:00
Alexander Larsson
38e1748df8 GtkWidget: Propagate scale to GtkStyleContext 2013-07-03 14:39:25 +02:00
Alexander Larsson
4cc1fe5bf5 GtkStyleContext: Add gtk_style_context_get/set_scale 2013-07-03 14:39:25 +02:00
Alexander Larsson
6cc5d29792 Use gdk_cairo_surface_create_from_pixbuf when possible 2013-07-03 14:39:25 +02:00
Alexander Larsson
ae43f9facb Add GDK_DPI_SCALE env var
This is very useful for hidpi where the dpi is scaled to make
non-dpi aware apps larger. In that case a dpi aware gtk+ using
GDK_SCALE will be getting huge fonts. You can the set GDK_DPI_SCALE
to compensate for this.
2013-07-03 14:39:25 +02:00
Alexander Larsson
c9b52d8820 pixel-cache: Refresh pixel cache on window scale factor changes. 2013-07-03 14:34:13 +02:00
Alexander Larsson
6bf32999b1 widget: Track when the window scale factor changes and notify
The scale-factor property on the widgets will be notified, and the
scale will change on the style property, causing us to pick up
new css assets.
2013-07-03 14:34:13 +02:00
Michael Natterer
c0ea0b5aad gtk: add gtk_widget_get_scale_factor() 2013-07-03 14:34:13 +02:00
Alexander Larsson
2a81d6f396 listbox: Use new private model, remove priv pointer 2013-07-02 13:44:17 +02:00
Alexander Larsson
06a808cf2a stack: Use new private model, remove priv pointer 2013-07-02 13:43:20 +02:00
Alexander Larsson
09d22284f7 revealer: Use new private model, remove priv pointer 2013-07-02 13:42:43 +02:00
William Jon McCann
a9e82cd46a Deprecate and ignore gtk-enable-tooltips setting
It is enabled by default except on touch input devices.
2013-06-30 14:28:02 -04:00
William Jon McCann
7ca327c9bb Deprecate the unused gtk-file-chooser-backend setting 2013-06-30 13:44:24 -04:00
William Jon McCann
c6ca2374cc Deprecate and ignore gtk-im-status-style and gtk-im-preedit-style 2013-06-30 12:57:44 -04:00
William Jon McCann
d1817e7a5d Add deprecation warnings to GTK_STOCK macros 2013-06-30 12:33:22 -04:00
William Jon McCann
4d6f9d280f Add xpadding around the image in message dialogs 2013-06-30 11:19:50 -04:00
William Jon McCann
c96a1c4980 Deprecate GtkAction and GtkUIManager
It is recommended to use GAction et al and GtkBuilder.
2013-06-30 11:19:50 -04:00
Sébastien Wilmet
158451b1ab textiter: better document "tag" functions
https://bugzilla.gnome.org/show_bug.cgi?id=703313
2013-06-30 10:38:25 +02:00
Matthias Clasen
587fb5efa1 GtkSearchBar: formatting trivia 2013-06-30 00:50:29 -04:00
Matthias Clasen
c6daaa16c9 GtkHeaderBar: documentation improvements
Add some more information about title allocation.
2013-06-30 00:27:45 -04:00
Matthias Clasen
328f221b5c csd: Improve window button handling
Group the buttons on each side in a box, and give them different
style classes, so themes can differentiate (this is partially a
workaround for limitations in our css selectors). The boxes also
let us add a margin below the buttons, without affecting the
allocation of the buttons themselves.
2013-06-29 19:00:40 -04:00
Matthias Clasen
534a7a9397 csd: use the correct icon name for close button
The icon is called window-close-symbolic.
2013-06-29 19:00:40 -04:00
Matthias Clasen
da55c86d3f csd: Use a dedicated style class for window buttons
This allows themes to differentiate between regular buttons
in a title bar, and window buttons.
2013-06-29 19:00:39 -04:00
Matthias Clasen
cacac4f85b csd: Improve the window title
Manually create the label, so that we can set its margins.
2013-06-29 19:00:39 -04:00
Sébastien Wilmet
f0a481d97b textiter: doc precision for forward_search() and backward_search()
https://bugzilla.gnome.org/show_bug.cgi?id=703313
2013-06-29 17:01:58 +02:00
Matthias Clasen
c73b48f28a Add a gtk_window_close function
This is useful when adding close buttons in custom titlebars.
2013-06-28 22:19:15 -04:00
Matthias Clasen
f3f6d1a249 Fix the build
We have to uglify the deprecation messages to make gtk-doc
handle them. The get turned into XML attributes, and there
is no automatic quoting to protect quotes in the text.
2013-06-28 06:50:57 -04:00
William Jon McCann
b86588e9f5 Deprecate GtkImageMenuItem
Use GtkMenuItem for menus with only text or GMenu for those
with icons for "nouns" and just text for "verbs".
2013-06-27 18:48:46 -04:00
William Jon McCann
d741b7b873 Deprecate the gtk stock functions 2013-06-27 17:51:38 -04:00
William Jon McCann
a02f2c4291 Make ignored settings be set to false by default 2013-06-27 17:02:58 -04:00
Emilio Pozuelo Monfort
f19c3896d0 menushell: don't activate a menu entry when opening a big menu
If a menu is opened and it doesn't fit entirely below or above
the menu bar, gtk+ will place it on top. The button release will
then activate the popup item that happens to appear under the
cursor. Avoid this by ignoring release events if they originated
in the parent menu bar and the duration of the press was too short.

https://bugzilla.gnome.org/show_bug.cgi?id=703069
2013-06-27 20:20:53 +02:00
Emanuele Aina
4eddc00911 docs: Add GtkListBox functions to their section and fix links
https://bugzilla.gnome.org/show_bug.cgi?id=702981
2013-06-27 16:28:40 +02:00
William Jon McCann
6e028767d0 Fix default value of scrolled window placement-set property
To make the testsuite happy.
2013-06-26 22:07:00 -04:00
William Jon McCann
fbbcb5c01b Disable primary paste by default 2013-06-26 21:41:45 -04:00
William Jon McCann
aef9dca9d5 Deprecate GtkIconFactory, GtkIconSet, GtkIconSource
We want to use GtkIconTheme instead. It is worth noting that
the parts that remain undeprecated are GtkIconSize and gtk_icon_size_lookup.
2013-06-26 20:02:27 -04:00
William Jon McCann
88177d8bd1 Don't use a GtkIconSet to pick the logo image
Just use the first pixbuf in the default list.
2013-06-26 18:48:03 -04:00
William Jon McCann
e779e04bc2 Deprecate and ignore gtk-icon-sizes setting
We don't have icons rendered at arbitrary sizes and we have better
APIs that aren't restricted to GtkIconSizes.
2013-06-26 18:04:27 -04:00
William Jon McCann
b101d465be Deprecate and ignore gtk-keynav-cursor-only and gtk-keynav-wrap-around 2013-06-26 15:33:10 -04:00
William Jon McCann
b26c74e5da Deprecate and ignore gtk-menu-bar-accel setting
Use 'F10' by default.
2013-06-26 14:21:44 -04:00
William Jon McCann
76936193d5 Deprecate and ignore gtk-menu popup and popdown delay settings
Just pick good defaults. The a11y team confirmed that they don't
rely on them.
2013-06-26 14:08:37 -04:00
William Jon McCann
e7b5be93b1 Deprecate and ignore gtk-scrolled-window-placement
Just use GTK_CORNER_TOP_LEFT and allow it to be changed with
gtk_scrolled_window_set_placement().
2013-06-26 13:06:12 -04:00
William Jon McCann
aa78c888eb Deprecate and ignore gtk-fallback-icon-theme
The standard icon themes have built in fallbacks.
2013-06-26 12:47:43 -04:00
William Jon McCann
b2e666bf8f Deprecate and ignore the cursor blink settings
And hardcode them to reasonable values.
2013-06-26 12:32:31 -04:00
William Jon McCann
2d79334bb0 Deprecate and ignore gtk-can-change-accels
It is disabled by default
2013-06-26 12:00:42 -04:00
William Jon McCann
7cfa7e6b72 Mark gtk-color-palette as deprecated
It is only used by the deprecated color selector widget.
2013-06-26 11:47:32 -04:00
William Jon McCann
7e3a494fac Deprecate and ignore gtk-enable-mnemonics and gtk-auto-mnemonics" properties
They are both enabled by default.
2013-06-26 11:16:12 -04:00
William Jon McCann
e8147d15f7 Deprecate and ignore gtk-menu-images setting
GtkImageMenuItem images can still be enabled selectively by the app author
using the always-show-image property on the item.
2013-06-26 10:53:09 -04:00
Benjamin Otte
7bd7bcec0d settings Deprecate properties
Deprecate the properties that were brought back from the dead in the
last patch.
2013-06-26 15:51:31 +02:00
Benjamin Otte
5b7b86c231 Revert "Remove the show-unicode-menu and show-input-method-menu settings"
Removing object properties is too much of an API break, even for
properties we don't expect to be used outside of GTK itself.

This reverts commit 8b811b623c.
2013-06-26 15:51:31 +02:00
William Jon McCann
65c31629c3 Deprecate and ignore gtk-button-images setting
Button images can still be enabled selectively by the app author
using the always-use-image property on the button.
2013-06-26 09:15:22 -04:00
William Jon McCann
d7260d4ee9 Fix a couple documentation warnings 2013-06-25 19:05:32 -04:00
William Jon McCann
424e1d0059 Start deprecating some GtkStock API 2013-06-25 19:05:32 -04:00
William Jon McCann
0091fc3543 Make the testsuite happy that get gets the default value 2013-06-25 12:39:20 -04:00
William Jon McCann
6e22c4cfde Fix some regressions from stock migration 2013-06-25 12:39:19 -04:00
Sébastien Wilmet
67d1183ac9 Document GtkTextSearchFlags
Move the doc about the flags from gtk_text_iter_forward_search() to the
enum.

https://bugzilla.gnome.org/show_bug.cgi?id=390048
2013-06-25 13:21:08 +02:00
William Jon McCann
02c793f24a Start migrating internals away from GtkStock 2013-06-24 22:20:49 -04:00
William Jon McCann
2b571f41e2 Remove more discontinued ChangeLogs
They are all in git.
2013-06-24 19:53:08 -04:00
Ryan Lortie
c79a21e1dd menu model: set separator label conditionally
When creating separators we were binding the "label" property on the
tracker to the "label" property on the GtkSeparatorMenuItem.

This was problematic for two reasons.

First, it was pointless.  The section header label will never change.

Second, it was causing problems: doing the binding caused the value to
be initially synced up, even if it was NULL.  Doing this caused
GtkMenuItem to create a GtkAccelLabel and add it as a child, which
prevented the separator from being shown normally.

Change the code a bit so that we just call gtk_menu_item_set_label()
when creating the item, if we find the label to be non-NULL.

Also, show() the separator item at first.  GtkMenu manages visibility of
separators internally, but it seems "more correct" to show it ourselves
at first.
2013-06-24 18:05:27 -04:00
Ryan Lortie
d498e9b588 GtkMenuTracker: fix leak when creating submenus 2013-06-24 18:05:27 -04:00
Benjamin Otte
830691bdce treeview: Ensure we first validate the visible area when validating
This invariant stopped being guaranteed when we moved the visible area
validation from a high priority idle to a tick callback.

Fixes redrawing bugs like row expanding sometimes not having any visual
effect.
2013-06-24 20:19:11 +02:00
Benjamin Otte
2008148303 treeview: Reorder code
This just moves a function and is in preparation for the next commit.
2013-06-24 20:19:05 +02:00
Benjamin Otte
f54e37a23b treeview: Actually remove presize handler when we presize
Avoids multiple calls to it.
2013-06-24 20:19:05 +02:00
Sébastien Wilmet
ea4e88df86 textiter: bug fix in forward_search() and backward_search()
When the search is case sensitive, g_utf8_normalize() is not called, so
the skip_decomp argument of the function forward_chars_with_skipping()
must be FALSE.

To verify that, when searching "éb", the count parameter of
forward_chars_with_skipping() have a different value:
- case sensitive: count = 2
- case insensitive: count = 3 (g_utf8_normalize() has been called)

The commit adds unit tests that didn't pass before, and that now pass
(without known regression, obviously).

https://bugzilla.gnome.org/show_bug.cgi?id=702977
2013-06-24 20:14:39 +02:00
William Jon McCann
99fa59c961 Add missing allow-none annotations 2013-06-24 13:46:56 -04:00
Ryan Lortie
1107935d2b GMenuModel -> GtkMenu binding: show submenu items
In the non-submenu case we bind the 'visibility' attribute to the
tracker, which takes care of showing the item.  In the submenu case, we
don't bind all of the properties, so we miss this one.

Deal with it by just show()ing the submenu item.

https://bugzilla.gnome.org/show_bug.cgi?id=702332
2013-06-22 09:35:59 -04:00
Federico Mena Quintero
32e75adf6a GtkFileChooserButton: Also emit 'file-set' when changing the selection through the combo box
https://bugzilla.gnome.org/show_bug.cgi?id=696498
2013-06-21 19:14:36 -05:00
Federico Mena Quintero
9162589b5a GtkFileChooserEntry: don't inline-complete if the entry doesn't have the focus
When the file chooser changes directories, it tells the GtkFileChooserEntry to
change its base folder (i.e. the folder from which relative pathnames are resolved).
GtkFileChooserEntry then starts loading a GtkFileSystemModel asynchronously.
In the finished_loading_cb(), however, it would always ask the GtkEntryCompletion
to insert the completion prefix, since that finished_loading_cb() is what is also used
while the user is typing *in the entry*.

But when the entry doesn't have the focus (e.g. the user changed directories by double-clicking
on the file list in the file chooser), there's no reason to insert completions at all.

https://bugzilla.gnome.org/show_bug.cgi?id=672271
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-06-21 18:35:28 -05:00
William Jon McCann
1b3f9df361 Remove rest of gtk-show-input-method-menu and gtk-show-unicode-menu
They are no longer used.
2013-06-21 08:59:32 -04:00
Jonh Wendell
c27ddc66c5 GtkEntry: ellipsize placeholder text
The placeholder string is truncated when there's no
room for it in entry's width.

So, by ellipsizing it, the user can notice the text
was truncated so that they can workaround that by,
for example, maximizing the window.

https://bugzilla.gnome.org/show_bug.cgi?id=702763
2013-06-21 09:29:15 -03:00
Benjamin Otte
8623d73c11 filechooser: Actually return a value 2013-06-21 02:59:23 +02:00
Benjamin Otte
5c61e457c8 treeview: Remove duplicate function 2013-06-21 02:59:23 +02:00
Sébastien Wilmet
08d49fdd58 Fix gtk_text_iter_forward_to_tag_toggle() for end iter
The function must return TRUE only if there is a tag toggle _after_ the
iter, not _at_ the iter. So for the end iter, the function must always
return FALSE.

Add also unit tests for gtk_text_iter_forward_to_tag_toggle().

https://bugzilla.gnome.org/show_bug.cgi?id=691266
2013-06-20 20:22:56 +02:00
Timothy Arceri
555e0a785d filechooser: Fix misleading documentation for gtk_file_chooser_set_preview_widget()
https://bugzilla.gnome.org/show_bug.cgi?id=701174
2013-06-20 12:29:02 -05:00
Sébastien Wilmet
38d78f48b5 Improve doc of gtk_text_iter_forward_search()
It was not possible to know if the @limit was for @match_start or
@match_end. It was documented for backward_search(), but not for
forward_search().

https://bugzilla.gnome.org/show_bug.cgi?id=390048
2013-06-20 12:39:24 +02:00
Claudio Saavedra
0540edcf9c gtkfilechooserbutton: fix documentation typo
https://bugzilla.gnome.org/show_bug.cgi?id=702695
2013-06-20 11:48:51 +03:00
Jonh Wendell
84b4910b39 filechooser: Add gtk_file_chooser_get_current_name()
Currently you can only set the current filename, but not
get it. It's useful to be able to get it in save
dialogs, where the user has typed the desired filename
and you are not in a real directory (recent used, for
example).

https://bugzilla.gnome.org/show_bug.cgi?id=702497
2013-06-19 13:37:35 -05:00
Alexander Larsson
159cccfe7b IconTheme: Move changed emission to an idle
By delaying the emission to an idle we avoid a lot of tricky
reentrancy issues. For instance, a normal gtk_icon_theme_choose_icon()
call could in very rare cases (when a user updated an icon theme) emit
a signal which could affect the icon currently being looked up.  This
kind of reentrancy is very hard to test against, especially when it is
so rare, so we're better of avoiding it.

There is no real value to get the change signal directly anyway. All
it can do is affect which icon is rendered the next frame, and we will
handle the queued emission before rendering. Not to mention that icon
theme change detection is polled anyway, so it is already delayed.

https://bugzilla.gnome.org/show_bug.cgi?id=694755
2013-06-19 11:15:37 +02:00
Alexander Larsson
1ee36713fe IconTheme: Clear caches when reloading theme
When we're reloading the theme in ensure_valid_themes (due to noticing
that a theme dir has changed) we need to also clear the icon cache
as it will not be valid for the new theme.

We already do this in do_theme_change(), but ensure_valid_themes()
was missing this.

https://bugzilla.gnome.org/show_bug.cgi?id=702598
2013-06-19 09:40:19 +02:00
Alexander Larsson
280d606cd4 IconCache: Keep a ref on the GtkIconData
The icon data in GttkIconInfo->data is currently owned by the
IconThemeDir->icon_data hashtable. However, on e.g. a theme change
blow_themes() destroys the dirs and thus the data, meaning any
outstanding GtkIconInfo points to stale data.

We solve this by adding a refcount to GtkIconData and reffing it
from GtkIconInfo.

https://bugzilla.gnome.org/show_bug.cgi?id=702598
2013-06-19 09:40:19 +02:00
Ryan Lortie
7554c15e7b GtkBuilder: add new constructor APIs
Add new APIs gtk_builder_new_from_{file,resource,string}() and encourage
their use over the older _add_from_...() APIs.

https://bugzilla.gnome.org/show_bug.cgi?id=679930
2013-06-18 10:21:27 -04:00
Ryan Lortie
1bc7359123 docs: GtkBuilder: warn about unusual GError use
GtkBuilder returns GError for _add_from_{file,resource,string}(),
implying that the user should be able to recover from these errors.
Mention in the docs that it's unreasonable to try to do this.

https://bugzilla.gnome.org/show_bug.cgi?id=679930
2013-06-18 10:17:34 -04:00
Alexander Larsson
242d0c5d22 Revert "GtkWindow: Move cairo_save/restore from marshaller"
This reverts commit 6c7689506f.

This is not right as we need to save/restore around *each*
callback, not just each emission.
2013-06-18 11:32:18 +02:00
Alexander Larsson
207703155b listbox: handle moving mouse out of widget with button down
Unset active row, etc when mousing out of the widget totally.
2013-06-17 15:15:07 +02:00
Alexander Larsson
3513981e1e listbox: Properly handle double click
We never want to handle GDK_2BUTTON_PRESS like a normal first click.
2013-06-17 15:15:07 +02:00
Alexander Larsson
e4a981eef2 listbox: Rewrite coords from child windows
If button events are from child windows we need to rewrite
the coordinates to our window.
2013-06-17 15:15:07 +02:00
Matthias Clasen
65f0e194e0 Fix a small memory leak 2013-06-15 23:35:25 -04:00
Matthias Clasen
5707e81c81 GtkBuilder: don't leak callbacks
This was noticed while running the testsuite under valgrind.
2013-06-15 23:33:51 -04:00
Matthias Clasen
c9ec4ba5a1 GtkImage: Fix the initial value of icon-size
Since we are pulling the icon-size out of the icon helper now,
we should set its icon-size when constructing it.
2013-06-15 20:23:01 -04:00
Matthias Clasen
87190233ef GtkListBox: cosmetics
Clean up formatting trivia, adjust includes to gtk conventions,
use P_() for properties, etc.
2013-06-15 12:32:59 -04:00
Bastien Nocera
3d11b9b758 GtkSearchBar: Mention we don't handle Ctrl+F for the app
There's probably an expectation from the app developers that
Ctrl+F or similar common shortcuts for starting a search will
be handled by the widget, when this is not the case. Explicitely
mention it in the docs to avoid confusion.

https://bugzilla.gnome.org/show_bug.cgi?id=701523
2013-06-14 19:10:39 +02:00
Bastien Nocera
19c5b37d9d GtkHeaderBar: Fix buildable function names
It's a GtkHeaderBar, not GtkHeader.

https://bugzilla.gnome.org/show_bug.cgi?id=701346
2013-06-14 19:10:39 +02:00
Bastien Nocera
8a45cb5762 GtkHeaderBar: Make labels creation available privately
So it can be reused in subclasses

https://bugzilla.gnome.org/show_bug.cgi?id=701345
2013-06-14 19:10:39 +02:00
Alexander Larsson
264cbc9e35 GtkStack: Switch order on left/right up/down transitions.
When the new child is on the left, scroll right. This makes the
thing look physically "real".
2013-06-13 20:55:05 +02:00
Alexander Larsson
418ac673a3 GtkStack: Fix drawing of sliding
We were not drawing the view window, so the old widget
was clipped for the sliding transitions.
2013-06-13 20:50:41 +02:00
Erick Pérez Castellanos
33a1c4d6e0 GtkStack: Add position-dependent slide transitions
These go left/right or up/down depending on the relative
order of the children being switched between.
2013-06-13 20:33:42 +02:00
Benjamin Otte
0d55d9b96b treeview: Use gtk_adjustment_configure()
... instead of manually setting all the values. Makes for nicer code and
less signal emissions.
2013-06-13 15:31:35 +02:00
Alexander Larsson
61f44628d6 GtkListBox: Consider width of filtered rows
Without this lists keep shrinking in width as they are filtered, whic
looks really bad.
2013-06-13 12:17:08 +02:00
Alexander Larsson
220eb45ef0 GtkListBox: Protect against reentrancy.
Activating a row may destroy the widget, so keep a ref since
we're doing thing to the listbox after emission.
2013-06-13 12:17:08 +02:00
Alexander Larsson
0f93b7f6c4 GtkListBox: minor fix
Move the check inside the existing chech which also checks
for active_row != NULL for extra safety.
2013-06-13 12:17:08 +02:00
Alexander Larsson
1dd0b468a7 GtkListBox: Add style classes for lists and rows 2013-06-13 12:17:07 +02:00
Alexander Larsson
3bb2d15195 GtkListBox: Add getter for activate_on_single_click 2013-06-13 12:17:07 +02:00
Alexander Larsson
90ff262df6 GtkListBox: Rename reXXX to invalidate_XXX
This is lets us later move to a setup where the rows are not
immediately resorted but queued until next layout.
2013-06-13 12:17:07 +02:00
Alexander Larsson
caacce6d44 GtkListBox: Add placeholder widget support 2013-06-13 12:17:07 +02:00
Alexander Larsson
b0b746b2ea GtkListBox: Track the number of visible children 2013-06-13 12:17:07 +02:00
Alexander Larsson
9510b79d78 GtkListBox: Track visible in the row
This is a minor performance improvement, but its mainly to
allow us to track when n_visible_children changes.
2013-06-13 12:17:07 +02:00
Alexander Larsson
217c2bb087 GtkListBox: Open code the update_header calls in add()
Rather than reusing row_visibility_changed. This means
row_visibility_changed really means that the row visibility changed.
2013-06-13 12:17:07 +02:00
Alexander Larsson
1eb729dcd9 GtkListBox: Make reseparate a no-op for hidden lists
We already take care to not track headers when the listbox is hidden,
because that can be very expensive during creation, so we might as
well skip reseparate() too. The only time we don't want to skip it
is when we're about to show the list.
2013-06-13 12:17:07 +02:00
Alexander Larsson
cbf294b27e GtkListBox: Remove some unnecessary code
the unhighlight call already NULLs out drag_highlighted_row
2013-06-13 12:17:07 +02:00
Alexander Larsson
2ba67a0b8b GtkListBox: Fix docs
Removed some cut/paste leftovers
2013-06-13 12:17:07 +02:00
Alexander Larsson
b119b022a7 GtkListBox: Allow unselecting of rows in SINGLE mode 2013-06-13 12:17:07 +02:00
Alexander Larsson
cc4ac1ee70 GtkListBox: Rename separators to headers 2013-06-13 12:17:07 +02:00
Alexander Larsson
4a0b6e5479 GtkListBox: Remove refilter signal
This was added from https://bugzilla.gnome.org/show_bug.cgi?id=691979
where it was wanted in order to get a "all children filtered" kind
of row. However, the solution is not really generic enough, because
filtering can happen for other reasons than a full refilter (i.e. due
to a row change), and the partial fix you can get by counting children
after refilter can be achieved by manually doing it whenever you manually
called refilter anyway.

Its possible we should have some better solution for the "empty state"
though.
2013-06-13 12:17:07 +02:00
Alexander Larsson
c6ac711508 GtkListBox: Add docs 2013-06-13 12:17:07 +02:00
Alexander Larsson
6a77754c77 GtkWidget: Change which states propagate
Historically the following states propagated to children:
  GTK_STATE_FLAG_ACTIVE
  GTK_STATE_FLAG_PRELIGHT
  GTK_STATE_FLAG_SELECTED
  GTK_STATE_FLAG_INSENSITIVE
  GTK_STATE_FLAG_INCONSISTENT
  GTK_STATE_FLAG_BACKDROP

However, several of these are problematic on containers like GtkListBox.
For instance, if a row is ACTIVE or SELECTED then all children (like e.g
a button) inside the row will *also* look active/selected. This is almost
never right. The right way to theme this is to catch e.g. SELECTED on the
container itself and set e.g. the color and let the children inherit
the color instead of the flag.

We now propagate only these flags:
  GTK_STATE_FLAG_INSENSITIVE
  GTK_STATE_FLAG_BACKDROP

Which make sense to be recursive as they really affect every widget
inside the container.

However, this is a CSS theme break, and while most things continue working
as-is some themes may need minor tweaks.
2013-06-13 12:17:07 +02:00
Alexander Larsson
ecff28bb68 GtkListBox: Remove add_to_scrolled()
Now that we automatically set up the focus_vadjustment we only
need the adjustment to handle the page-up/down scroll length correctly.

We use parent_set to automatically pick up the adjustment from a
scrollable (i.e. viewport) parent which makes add_to_scrolled useless, so
it can be removed.
2013-06-13 12:17:07 +02:00
Alexander Larsson
17c559c429 GtkScrollableWindow: Automatically set focus adjustments
When adding with a viewport we automatically set the focus
adjustments on the viewport from the scrolled window, so that
when any child widget gets focused we automatically scroll to it.

This is generally nice, but its particularly important for GtkListBox
where focus changing is how we navigate between rows.

We also ensure that the adjustments are always set before adding the
child to the viewport, which we will need later to pick up the
adjustments on add.
2013-06-13 12:17:06 +02:00
Alexander Larsson
157102aa73 GtkListBox: No need to manually clamp adjustment to focus
Now that we use real widgets for rows the focus_vadjustment is
enough.
2013-06-13 12:17:06 +02:00
Alexander Larsson
932535d444 GtkListBox: Clean up DnD code
Unhighlight rows if they are removed.

Drop the automatic drag motion based auto-scrolling. This is not really
right, as it e.g. hardcodes auto-scroll regions and assumes we're the only
widget inside the scrolled container. Its also imho in the wrong place,
autoscrolling if any should be done on the scrolled-window or viewport.
All the removed code is implementable outside Gtk+ though.
2013-06-13 12:17:06 +02:00
Alexander Larsson
e319867f80 Add GtkListBox
This is basically an import/rename of EggListBox from the row-widget
branch of egg-list-box.
2013-06-13 12:17:06 +02:00
Christian Persch
781b85088f im: Deprecate gtk_im_multicontext_append_menuitems
Bug #701840.
2013-06-09 09:51:55 -04:00
Kalev Lember
a37450110b Fix string allocation handling with GtkBuilder translations
Use g_string_assign to avoid issues with assigning GString's internal
buffer back to the same string. This can happen when no translations are
available and _gtk_builder_parser_translate returns back the same
pointer that was passed in.

This fixes a regression from commit e9f182e37a
that caused GtkComboBoxText <items> from GtkBuilder to show up empty if
no translations are available.

https://bugzilla.gnome.org/show_bug.cgi?id=700629
2013-06-08 10:54:25 +02:00
Matthias Clasen
8b811b623c Remove the show-unicode-menu and show-input-method-menu settings
These are no longer used.
2013-06-07 18:13:47 -04:00
Matthias Clasen
27a15d9a7d GtkTextView: Remove the Unicode and input method menus
Submenus in the context menu are not great, and these two
in particular are not something we want to have there.
2013-06-07 18:13:20 -04:00
Matthias Clasen
4a62d19da7 GtkEntry: Remove the Unicode and input method menus
Submenus in the context menu are not great, and these two
in particular are not something we want to have there.
2013-06-07 18:10:15 -04:00
Bastien Nocera
dbbea8b97e Add GtkSearchBar widget
This widget is a toolbar that will popup automatically when
searches should be started, and dismissed when they are finished.

https://bugzilla.gnome.org/show_bug.cgi?id=700787
2013-05-31 17:09:11 +02:00
Benjamin Otte
63eb47577e API: Deprecate gtk_container_resize_children()
It does ad things and is undocumented, so I'll just silently deprecate
it.
2013-05-30 20:02:30 +02:00
Benjamin Otte
299714dd1a container: Don't use to-be-deprecated API
Instead, do what that API does manually.
2013-05-30 20:02:05 +02:00
Benjamin Otte
4e50596b37 window: Call size_allocate() to allocate a size
Don't call gtk_container_resize_children().

https://bugzilla.gnome.org/show_bug.cgi?id=700185
2013-05-30 19:28:54 +02:00
Timothy Arceri
44cd166447 GtkBookmarksManager: Refactor duplicate set error code and localise error strings
https://bugzilla.gnome.org/show_bug.cgi?id=593079
2013-05-30 10:37:58 -05:00
Xavier Claessens
92823b2201 GtkMenuItem: Take padding into account to position submenu arrow
Since commit a69619edbc, it not
possible anymore for the style to add space between the border
and the arrow.

https://bugzilla.gnome.org/show_bug.cgi?id=700779
2013-05-29 14:53:17 +02:00
Benjamin Otte
0bd76a855c cssimage: Add forgotten line
That line was already missing in the initial commit it seems.
2013-05-28 15:24:04 +02:00
Benjamin Otte
f6c746a99d cssanimation: Use property id here 2013-05-28 15:24:04 +02:00
Benjamin Otte
6bf059e36f treeview: Don't cache the height
Instead, use the correct value all the time.
2013-05-28 15:24:03 +02:00
Chun-wei Fan
da31982379 Fix build on C89 compilers
-Avoid defining variables in the middle of the block
-Include fallback-c89.c in gtkrevealer.c in place of math.h as
 fallback-c89.c includes math.h itself, and is needed for round()
2013-05-28 13:36:54 +08:00
Matthias Clasen
fe2260c53d Fix distclean
extract-strings was left behind.
2013-05-27 18:25:31 -04:00
Matthias Clasen
540c665117 Add gtk_test_widget_wait_for_draw to docs 2013-05-27 14:49:43 -04:00
Matthias Clasen
cbe5a3a590 Add a tiled window state
This information is needed to draw client-side decorations
properly in this state.
https://bugzilla.gnome.org/show_bug.cgi?id=696001
2013-05-27 13:31:28 -04:00
Timothy Arceri
84513df5a7 Fix error_selecting_folder_over_existing_file_dialog() never displaying message
https://bugzilla.gnome.org/show_bug.cgi?id=700864
2013-05-26 00:37:23 -04:00
Timothy Arceri
b940122c4a Handle G_IO_ERROR_FILENAME_TOO_LONG errors when saving
https://bugzilla.gnome.org/show_bug.cgi?id=591969
2013-05-26 00:21:41 -04:00
Timothy Arceri
8f668240de Update gtk_file_chooser_set_do_overwrite_confirmation() documentation to reflect what is actually happening
https://bugzilla.gnome.org/show_bug.cgi?id=360131
2013-05-26 00:17:48 -04:00
Alban Browaeys
b08fe39cd8 GtkPlacesSidebar: do not unref mount
Do not unref mount has we grabbed its pointer without taking
a reference.
Otherwise the following call to g_list_free_full on network_mounts
frees it a second time. Segfault in nautilus ensue.

https://bugzilla.gnome.org/show_bug.cgi?id=700979
2013-05-26 00:03:13 -04:00
Matthias Clasen
fc1ff40296 csd: Fix handling of titlebar height
gtk_widget_get_allocated_height returns the adjusted
allocation, so we can't use it as measure for how much
room to leave when drawing the window background.
2013-05-25 21:02:00 -04:00
Matthias Clasen
80513aa2c7 GtkBox: don't propagate the expand child property
The intention of the expand widget flags was to in fact propagate
legacy expand child properties as well. Due to implementation errors,
this was only happening in some cases, but not in others. To avoid
breaking old code assuming traditional expand flag behavior, this
commit removes all attempts to propagate GtkBox::expand.

This was discussed in
https://bugzilla.gnome.org/show_bug.cgi?id=698656 and
https://bugzilla.gnome.org/show_bug.cgi?id=628902

This patch was written by Tristan Van Berkom.
2013-05-25 14:46:09 -04:00
Matthias Clasen
f83af03579 Avoid shadowing a variable
I don't think this broke anything, but it is just inviting
confusion.
2013-05-25 13:17:57 -04:00
Bastien Nocera
536fc22de4 GtkSearchEntry: Don't wait for timeout when emptying
When the text entry gets cleared, emit the "changed" signal
straight away. This avoids a lag when dismissing a search.

https://bugzilla.gnome.org/show_bug.cgi?id=700787
2013-05-23 20:53:30 +02:00
Bastien Nocera
1bfbfbc50c GtkTreeView: Use GtkEntry private function to remove hack
https://bugzilla.gnome.org/show_bug.cgi?id=700787
2013-05-23 20:53:30 +02:00
Bastien Nocera
ffbe7f6eb6 GtkEntry: Focus the entry without selecting the text
Focusing the text entry without selecting all the text is needed in
some places (GtkTreeView, and some uses of GtkSearchEntry) so
create a private helper to avoid replicating the hacks.

https://bugzilla.gnome.org/show_bug.cgi?id=700787
2013-05-23 20:53:30 +02:00
Federico Mena Quintero
e6dca05445 GtkFileChooser: Only allow creating bookmarks for folders, not files
https://bugzilla.gnome.org/show_bug.cgi?id=561221
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-05-22 17:30:49 -05:00
Federico Mena Quintero
dc2f399dd0 GtkPlacesSidebar: Only create bookmarks for folders, not files
https://bugzilla.gnome.org/show_bug.cgi?id=561221
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-05-22 17:22:28 -05:00
John Ralls
ffd538c802 Bug 667759 - gtkdnd-quartz.c is missing annotations for introspection
Work around this by introspecting gtkclipboard.c and gtkdnd.c instead
of the quartz alternatives.

Note that this is temporary: The implementation of GdkSelection
will make the quartz alternatives unnecessary. See bug 571582.
2013-05-20 15:44:18 -07:00
John Ralls
af1499c371 Bug 691921 - GTK+ built on Leopard references [NSMenu removellItems]
Test it with respondsToSelector, and if it isn't available delete the
items one at a time.
2013-05-20 15:17:47 -07:00
Luc Pionchon
b634d8de47 typo
https://bugzilla.gnome.org/show_bug.cgi?id=699289
2013-05-19 21:24:01 -04:00
Luc Pionchon
0e08ff19ba Add doc to set markup and accelerator on a MenuItem.
https://bugzilla.gnome.org/show_bug.cgi?id=699289
2013-05-19 21:24:01 -04:00
Matthias Clasen
58d155d1e6 Fix drawing of treeview grid lines
In the presence of invisible columns, the grid line drawing
code was malfunctioning.

https://bugzilla.gnome.org/show_bug.cgi?id=700578
2013-05-18 19:21:54 -04:00
Bastien Nocera
41b07bdc96 GtkSwitch: Don't handle events from extra mouse buttons
Also use GDK_EVENT_{STOP,PROPAGATE} to make return
values clearer.

https://bugzilla.gnome.org/show_bug.cgi?id=696640
2013-05-18 14:49:55 +02:00
Bastien Nocera
7d54fc14bf GtkButton: Don't suppress unhandled mouse events
Mouse events that we do not handle should bubble up to the parent
widget, so they can be handled there, instead of disappearing inside
the button. Also use GDK_EVENT_{STOP,PROPAGATE} to make return
values clearer.

https://bugzilla.gnome.org/show_bug.cgi?id=696640
2013-05-18 14:49:55 +02:00
Benjamin Otte
b3b1c672ee treeview: Use tick callback
instead of a timer for the presize callback.
2013-05-17 20:49:52 +02:00
Benjamin Otte
6f9dc0ffd7 treeview: Store editable position differently
Instead of storing the rect in the bin window, store the row and column
the editable belongs to and compute the rect lazily. This way, we don't
need to keep the rect up to date.

Fixes /TreeView/scrolling/new-row-mixed/path-500 test.
2013-05-17 20:49:52 +02:00
Benjamin Otte
5c7528c591 treeview: Remove unused function 2013-05-17 20:49:52 +02:00
Benjamin Otte
8616dbbad3 API: Add gtk_test_widget_wait_for_draw ()
See docs and following commits for what it's supposed to do. Let's hope
it fixes the flakiness in tests.
2013-05-17 20:49:52 +02:00
Bastien Nocera
51e238653d GtkSearchEntry: Delay the changed signal by default
Emit the "changed" signal after 150 msecs, so that searching
through big lists, or doing online searches feels more responsive.

This is something already done in various applications to make
search-as-you type more responsive (gnome-shell, gnome-documents,
gnome-control-center, etc.). The 150 msecs is the value currently
used by gnome-shell, so keep it (invisibly) consistent.

https://bugzilla.gnome.org/show_bug.cgi?id=700229
2013-05-17 19:45:46 +02:00
Benjamin Otte
bdfb55c945 build: Move gtk/tests to testsuite/gtk 2013-05-15 15:37:16 +02:00
Benjamin Otte
ac8f7f0703 tests: Include gtk/ directory from toplevel 2013-05-15 15:33:24 +02:00
Benjamin Otte
06a8fac3e9 tests: Use testing API instead of duplicating it 2013-05-15 15:33:24 +02:00
Benjamin Otte
772470fb9d tests: Use absolute paths to unrelated files 2013-05-15 15:33:24 +02:00
Alexander Larsson
c3973e8468 GtkContainer: Propagate draws in GdkWindow order
Now that we're not drawing the GdkWindows by themeselves we need to
propagate into children in the same order as the windows were painted
otherwise apps can't rely on stacking order to overlay children.

This is still not 100% the same as the old behaviour, because we're
treating all windows that are part of a window at the same time (to allow
e.g. opacity groups), and we're only looking at order for the main
windows of a widget. However, this fixes at least the ordering
of the gnome-boxes fullscreen overlay toolbar.

https://bugzilla.gnome.org/show_bug.cgi?id=699970
2013-05-15 12:47:05 +02:00
Jasper St. Pierre
7793f21d2a gtkmenutrackeritem: Simplify the submenu opening API
Instead of making clients inspect the submenu action and decide what
to do based upon that, always request the submenu open and let the
tracker decide what to do.
2013-05-13 16:33:43 -04:00
Jasper St. Pierre
2024384e0a Add some usage docs for the new private copy/paste APIs 2013-05-13 16:33:43 -04:00
Ryan Lortie
a4276a6c79 add GtkMenuTrackerItem
Add a new class, GtkMenuTrackerItem that represents a menu item, to be
used with GtkMenuTracker.

GtkMenuTracker's insert callback now works in terms of this new type
(instead of passing reference to the model and an index to the item).

GtkMenuShell now handles all of the binding tasks internally, mostly
through the use of property bindings.  Having bindings for the label and
visibility attributes, in partiular, will help with supporting upcoming
extensions to GMenuModel.

GtkModelMenu has been reduced to a helper class that has nothing to do
with GMenuModel.  It represents something closer to an "ideal" API for
GtkMenuItem if we didn't have compatibility concerns (eg: not emitting
"activate" when setting toggle state, no separate subclasses per menu
item type, supporting icons, etc.) Improvements to GtkMenuItem could
eventually shrink the size of this class or remove the need for it
entirely.

Some GtkActionHelper functionality has been duplicated in
GtkMenuTracker, which is suboptimal.  The duplication exists so that
other codebases (such as Unity and gnome-shell) can reuse the
GtkMenuTracker code, whereas GtkActionHelper is very much tied to
GtkWidget.  Supporting binding arbitrary GtkWidgets to actions vs.
supporting the full range of GMenuModel features for menu items turns
out to be two overlapping but not entirely similar problems.  Some of
the duplication (such as roles) can be removed from GtkActionHelper once
Gtk's internal Mac OS menubar support is ported to GtkMenuTracker.

The intent to reuse the code outside of Gtk is also the reason for the
unusual treatment of the enum type introduced in this comment.

This adds no new "public" API to the Gtk library, other than types that
we cannot make private due to GType limitations.
2013-05-13 16:33:43 -04:00
Ryan Lortie
03235bf027 action stuff: Change include style
The shell wants to transplant our GtkActionObserver/GtkActionObservable
code now as well, so change to ""-style #includes there.
2013-05-13 16:33:42 -04:00
Jasper St. Pierre
6030ba4803 action stuff: Introspection fixes 2013-05-13 16:33:42 -04:00
Jasper St. Pierre
8ad384f3dc action stuff: Remove G_GNUC_INTERNAL 2013-05-13 16:33:42 -04:00
Ryan Lortie
6c49cd0ea6 action stuff: stop abusing GLib's namespace
Rename our internal GActionMuxer, GActionObserver and GActionObservable
classes and interfaces to have names in our own namespace.

These classes were originally intended for GIO but turned out to be too
special-purpose to be useful there, so we never made them public API but
have just been copying them around (without bothering to properly rename
them).  Now that other people will be copying them out of Gtk, it's even
more important to prevent this namespace abuse from spreading further.
2013-05-13 16:33:42 -04:00
Ryan Lortie
58481ffabf tests: make GtkMenu test more flexible
We were using gtk_menu_item_get_label() from a testcase to determine the
label associated with a menu item.  Future changes to GtkModelMenuItem
will cause this to stop working, so try a bit harder to find a label
inside of the item.
2013-05-13 16:33:42 -04:00
Hib Eris
914099dce1 Build extract-strings tool for build system
This fixes cross compiling where build system != host system.

https://bugzilla.gnome.org/show_bug.cgi?id=699690
2013-05-13 17:07:46 +02:00
Joe Pea
67c8ebc5d5 GtkPlacesSidebar: Fixed tooltip capitalization
Use sentence capitalization for the tooltip on the file system disk under Devices.
https://bugzilla.gnome.org/show_bug.cgi?id=698933
2013-05-13 05:47:05 -04:00
Bastien Nocera
98d33803fb Fix accels added after the window was shown not working
GtkApplicationWindow would only update its list of captured accels
when realizing the window. This meant that keyboard shortcuts added
after the window was realised (for example, added by plugins) would
be non-functional.

Solve this by updating our accels every time the accel map changes,
not only when realizing the window.

https://bugzilla.gnome.org/show_bug.cgi?id=700079
2013-05-13 08:57:06 +02:00
Matthias Clasen
9289156889 Improve wording of filechooser context menu
Use header captialization, and shorten the labels a bit.
https://bugzilla.gnome.org/show_bug.cgi?id=698361
2013-05-12 22:25:54 -04:00
Matthias Clasen
c6fec489ac Improve sensitivity handling in filechooser context menu
Items that act on the selection should not be sensitive if the
selection is empty. This was already the case for the 'Copy file
location' item, but not for the 'Add bookmark' and 'Visit file'
items.
https://bugzilla.gnome.org/show_bug.cgi?id=699104
2013-05-12 22:17:15 -04:00
Carlos Garnacho
a33f0ff839 Find tooltip/dnd widget running through container children in inverse order
Usually, educated GtkContainers' forall() implementation returns children
in an order that's safe for the default draw() implementation in GtkContainer.
So for widgets with some stacking notions (eg. GtkOverlay),
_gtk_widget_find_at_coords() needs to recurse within containers in reverse
order so it finds the topmost widget.

As this function is used in both tooltips and DnD code, this improves behavior
of "floating" widgets wrt those two. This could for example be seen in the
"Transparent" GTK+ demo, where dropping text on the entry results on the text
going to the textview.

https://bugzilla.gnome.org/show_bug.cgi?id=699239
2013-05-12 21:17:01 -04:00
Matthias Clasen
7052d4071c csd: Properly dispose custom titlebars
gtk_bin_remove can't handle internal children, so we have
to unset the titlebar widget before chaining up in dispose.

https://bugzilla.gnome.org/show_bug.cgi?id=700054
2013-05-12 21:01:59 -04:00
Matthias Clasen
d31391b0c7 csd: Ignore titlebars when hidden
We were not drawing the content background in the titlebar
area when fullscreen, and were still treating clicks there
as if they were on the titlebar.
2013-05-12 21:01:59 -04:00
Matthias Clasen
759f223396 csd: Manage visibility of custom titlebars
We should hide custom titlebars when in fullscreen mode, just
as we do for non-custom titlebars.
https://bugzilla.gnome.org/show_bug.cgi?id=700053
2013-05-12 21:01:59 -04:00
Sébastien Wilmet
6b50045f90 Doc: various small fixes
https://bugzilla.gnome.org/show_bug.cgi?id=700007
2013-05-12 18:09:28 +02:00
Sébastien Wilmet
fcc3f973d3 gtktextchild: replace hard-coded values by a macro
The macro already exists, so it's better to use it.

https://bugzilla.gnome.org/show_bug.cgi?id=700007
2013-05-12 18:09:11 +02:00
Tristan Van Berkom
11be64d3fe GtkComboBoxText: Improved GtkBuildable documentation.
Also removed a bogus FIXME comment which might have been true
a long time ago. Clarification: the "domain" attribute specified
in the builder script overrides any domain previously set with
gtk_builder_set_translation_domain(), so the translation of items
here is perfectly correct and does not need to be fixed.
2013-05-12 21:56:40 +09:00
Matthias Clasen
42ee21e34c Make gtk_window_resize work again
This hunk of code was lost by accident in the previous commit.
2013-05-11 19:44:57 -04:00
Matthias Clasen
fc10ee8d4a GtkWindow: default size is only for initial map
Bring back need_default_size. We need it to preserve this
documented behavior:

The default size of a window only affects the first time a window is
shown; if a window is hidden and re-shown, it will remember the size
it had prior to hiding, rather than using the default size.

With this patch, all of the window sizing tests in
gtk/tests/window pass again.
2013-05-11 18:49:51 -04:00
Benjamin Otte
689905c1b4 widget: make gtk_widget_compute_size_for_orientation() static
It's not used anywhere outside of gtksizerequest.c anymore.
2013-05-11 15:11:53 +02:00
Benjamin Otte
bd4d00918e API: Don't export gtk_widget_preferred_size_and_baseline()
gtk_widget_preferred_size() is only useful if you want to quickly port a
widget from GTK2 sizing code to GTK3 but does not properly work with
height-for-width as used in GTK. So we don't want to encourage people to
use it. In particular we want people to convert to height-for-width
before adding baseline support to their widgets.
2013-05-11 14:48:01 +02:00
Matthias Clasen
31fd014c93 Add more window-size related tests 2013-05-10 13:55:00 -04:00
Colin Walters
33f6730249 GtkBookmarksManager: Only save if we have data to save
Otherwise we write an empty file, which is lame.
2013-05-09 16:48:38 -04:00
Colin Walters
4f01c0b159 GtkBookmarksManager: Ensure parent directory exists when saving
Otherwise we fail when the user doesn't have ~/.config yet.
2013-05-09 16:48:03 -04:00
Benjamin Otte
20e8675106 widget: Remove unused variable 2013-05-09 19:09:50 +02:00
Benjamin Otte
ecaf09c918 build: remove --disable-rebuilds
It's unused and was only useful when perl wasn't installed. But perl is
a dependency of glib these days, so it's useless.
2013-05-09 19:09:50 +02:00
Matthias Clasen
1800dc4709 Remove gtk_widget_size_allocate from gtk_menu_popup_for_device
GtkMenu calls gtk_widget_size_allocate on its GtkWindow during
gtk_menu_popup_for_device if the menu has not been realised. This can cause the
allocation of the GtkWindow and the size of the GdkWindow to become out of sync
because a top level GtkWindow does not attempt to re-size the GdkWindow when
its allocation is set.
https://bugzilla.gnome.org/show_bug.cgi?id=695120
2013-05-09 12:06:05 -04:00
Ryan Lortie
434dfc20c7 GtkCheckMenuItem: remove an unused boolean field
always_show_toggle was always set to TRUE in _init() and never changed
from anywhere else.  Remove it and remove the if() statements based on
it.

https://bugzilla.gnome.org/show_bug.cgi?id=699929
2013-05-09 12:04:41 -04:00
Stefan Sauer
a725b06363 label: fix return value type for _draw()
Change from gint to gboolean.
2013-05-08 22:05:56 +02:00
Matthias Clasen
c77e12a215 Make key themes work again
This was inadvertedly broken in commit
44ba5d253f.
Thanks to Matthew Francis for tracking this down and providing
a fix in https://bugzilla.gnome.org/show_bug.cgi?id=699901
2013-05-08 10:21:36 -04:00
Alexander Larsson
bb7054b508 overlay/paned: Ensure we set the right visual on windows
This was always "needed", but the problems with not doing it
now are worse, since any CSD window will have a nonstandard
rgba visual.
2013-05-08 15:51:00 +02:00
Rico Tzschichholz
d08d7f2c5a Remove abi checking scripts (2)
In addition to 019ad96479
2013-05-07 17:34:32 +02:00
Alexander Larsson
8ae7defad5 GtkPixelCache: Free cache if not used in 20 seconds
No need to keep a performance enhancing cache around if its not
actually in use.
2013-05-07 16:40:24 +02:00
Alexander Larsson
e2c8a95af6 GtkStack: Fix double-draw in crossfade
We should only draw the cross-fade on the bin window, not doing this
was causing us to draw it multiple times using ADD which resulted
in weird colors.
2013-05-07 16:40:24 +02:00
Alexander Larsson
0600d3d7e4 GtkWidget: Use gdk_window_get_children_for_user_data
This makes iterating over the children a lot faster, as we're
not doing lots of intra-library calls and type checks. We're still
in some sence O(n^2) since we iterate over each child window for each
widget, but the profiles look much better.
2013-05-07 16:40:24 +02:00
Alexander Larsson
cad751c762 GtkTreeView: port to PixelCache
We register an invalidate handler on the bin window to get told
of child widget invalidations, although we manually need to discard
invalidates from the scroll operation.

Additionally we invalidate all of the pixel cache whenever
the TreeView itself is queue_draw()n to handle e.g. style (bg)
changes, or changes due to model changes causing queue_draw() in
the tree view.
2013-05-07 16:34:05 +02:00
Alexander Larsson
2df27ce7f8 Make GtkViewport use GtkPixelCache
Since gdk_window_move() no longer uses XCopyArea all scrolling
now re-renders everything in the window. To get performance
back we use a GtkPixelCache to store already drawn children,
and we when we expose the viewport we just blit the
offscreen to the right place.
2013-05-07 16:34:05 +02:00
Alexander Larsson
dde714386d GtkPixelCache: Add debug feature to track redraws
Each time we redraw we tint it in a different color so that
you can see which regions are redrawn.
2013-05-07 16:34:05 +02:00
Alexander Larsson
30dc399b72 Add GtkPixelCache
GtkPixelCache is a helper utility that lets you implement
faster scrolling of a viewport of a canvas by using an
offscreen pixmap cache.

You call _gtk_pixel_cache_draw with a callback function that
does the drawing, and additionally you specify the size and the
position of the viewport in the widget, and the position and size
of the canvas wrt the viewport. The callback will be called to
draw on an offscreen surface, and the surface will be drawn
on the window. The next time you do the same, any already drawn
pieces of the surface are re-used from the offscreen and need
not be rendered again.

If things inside the canvas change you need to call
_gtk_pixel_cache_invalidate to tell the cache about this.

Some other details:

* The offscreen surface is generally a bit larger than
  the viewport, so scrolling a small amount can often
  be done without redrawing children.
* If the canvas is not larger than the viewport no
  offscreen surface is used.

GtkPixelCache: Make sure we always copy using SOURCE

We were using OVER for the first copy (from source to group surface.

GtkPixelCache: Fix x/y typos

GtkPixelCache: Allow NULL for invalidate region

gtkpixelcache: Use CONTENT_COLOR for solid bg windows
2013-05-07 16:34:05 +02:00
Alexander Larsson
cb2882a273 GtkWidget: Add a vfunc for queue_draw_region
Since widgets now cache drawn state we allow them to override
queue_draw_region to detect when some region of the widget
should be redrawn. For instance, if a widget draws the
background color in a pixel cache we will need to invalidate
that when the style context changes which queues a repaint.
2013-05-07 16:34:05 +02:00
Alexander Larsson
6c7689506f GtkWindow: Move cairo_save/restore from marshaller
We do the save/restore when emitting ::draw rather than in a custom
marshaller, as this saves an extra stack frame, which is helpfull now
that we do painting fully recursive. This is also likely to save a few
cycles.
2013-05-07 16:33:01 +02:00
Alexander Larsson
d22fd7223c Only handle exposes on native window, propagate to children via draw()
We now consider non-native windows non-opaque, which means any invalid
area in a subwindow will also be invalid all the way up to the nearest
native windows. We take advantage of this by ignoring all expose events
on non-native windows (which typically means just the toplevel) and instead
propagating down the draw() calls to children directly via
gtk_container_propagate_draw.

This is nice as it means we always draw widgets the same way, and it
will let us do some interesting ways in the future.

We also clean up the GtkWidget opacity handling as we can now always
rely on the draing happening via cairo.

We can't really just draw by walking down the widget hierarchy, as
this doesn't get the clipping right (so e.g. widgets doing cairo_paint
may draw outside the expected gdkwindow subarea) nor does it let
us paint window backgrounds.

So, we now do multiple draws for each widget, once for each GdkWindow,
although we still do it on the same base cairo_t that we get for the
toplevel native window. The difference is only the clipping, the rendering
order, and which other widgets we propagate into.

We also collect all the windows of a widget so we can expose them inside
the same opacity group if needed.

NOTE: This change neuters gtk_widget_set_double_buffered for
widgets without native windows. Its impossible to disable
the double buffering in this model.
2013-05-07 16:33:01 +02:00
Matthias Clasen
e9122eca68 Add more test cases
These are taken from
https://bugzilla.gnome.org/show_bug.cgi?id=696882
2013-05-07 08:54:05 -04:00
Benjamin Otte
a0aa367458 checkbutton: Implement height-for-width 2013-05-07 14:06:11 +02:00