quartz: Actually use the window background PATTERN color
Before we used a window's background color, which resulted in corrupted
display in some cases, presumably because we didn't reset the active
pattern. This patch seems to eliminate the observed corruption.
(cherry picked from commit 0e42cf81f1dad319489e447c6c4e640bed2ab915)
Benjamin Otte [Fri, 5 Oct 2012 16:45:37 +0000 (18:45 +0200)]
animations: Don't set animated values for finished transitions
Otherwise, that value will never get reset and remain frozen in time.
This is problematic for example when the value is inherited and the
parent changes the value.
Cosimo Cecchi [Thu, 4 Oct 2012 04:58:29 +0000 (00:58 -0400)]
scrolledwindow: fix wrong allocation of padding and borders
When positioning the scrollbar we were doing several miscalculations
when accounting for CSS paddings and borders. This also fixes a number
of problems with RTL and when scrollbars-within-bevel is FALSE.
Benjamin Otte [Tue, 2 Oct 2012 17:30:50 +0000 (19:30 +0200)]
gtk/tests: Fix for -Wmissing-declarations
I'm adding a bunch of fixes for gcc complaining about
-Wmissing-declarations after finding a bunch of cases today where I
had forgotten to make functions static in the CSS code.
This patch fixes the tests in gtk/tests.
After this last patch, the gtk/ subdir should now compile without
warnings when this flag is enabled.
Benjamin Otte [Tue, 2 Oct 2012 17:19:50 +0000 (19:19 +0200)]
gtk: Add get_type() function declarations for private objects
I'm adding a bunch of fixes for gcc complaining about
-Wmissing-declarations.
This set of patches makes private classes in gtk/*.c that use
G_DEFINE_TYPE() safe by adding definitions for the get_type() function
that can't be made static.
Benjamin Otte [Tue, 2 Oct 2012 17:13:30 +0000 (19:13 +0200)]
a11y: Fix for -Wmissing-declarations
I'll add a bunch of fixes for gcc complaining about
-Wmissing-declarations after finding a bunch of cases today where I had
forgotten to make functions static in the CSS code.
A thorn in those patches is G_DEFINE_TYPE() which doesn't allow making
the get_type() function static, so I added definitions for that function
above the G_DEFINE_TYPE().
After those patches, GTK should compile without warnings when this flag
is enabled.
Just as in ed7a417dcbe3f0723e5dcef07d4bb566d77b7205 we don't want to
show auto mnemonics immediately but only after a short delay. In
particular this allows to capture screenshots without visible
mnemonics.
Amended documentation for gtk_widget_set_size_request().
It seems we missed updating this since GTK+3, widgets cannot be
allocated less than the size they requested in thier request
phase, and explicit sizes are used only to grow the size request.
Benjamin Otte [Tue, 2 Oct 2012 12:11:18 +0000 (14:11 +0200)]
cssimage: Implement proper cross-fades for gradients
This is intended mainly to speed up the current situation with spinners
on debug kernels. Because we now don't use a cross-fade to draw the
transition but instead have a real gradient that we draw, we don't need
to use the slow cross-fade code.
Benjamin Otte [Mon, 1 Oct 2012 16:21:30 +0000 (18:21 +0200)]
css: Move special case code for border widths
We need to store the border widths independant of them being set to 0 by
border styles, because otherwise we'd need to track that dependency and
recompute on changes, and I don't want to add more entries to
GtkCssDependencies just for this special case.
By moving the code that does the setting to 0 from the compute stage to
the query stage, we can achieve this.
Now we need to just be aware that the actual value stored is not set to
0 when we use gtk_css_computed_values_get_value().
By calling XSync in _gdk_x11_display_after_process_all_updates we
effectively make gdk rendering sync, which avoids problems with the
client animations running faster than the Xserver rendering, thus
filling up the X rendering pipes and essentially "locking up" the
Xserver (i.e. you can't even close the offending window because the
WM is starved too).
I verified this worked by making GtkSpinner paint multiple times on my
intel driver (which has some issue making this rendering slow atm),
and without this patch i get severe lag where even window dragging
stops for 5 seconds when i drag the mouse around. However, with the
patch everything is smooth.
Matthias Clasen [Mon, 1 Oct 2012 00:33:38 +0000 (20:33 -0400)]
XIM: Don't force random windows to become native
GDK_WINDOW_XID() has the side-effect of turning a window native;
this in turn can have unexpected effects such as black backgrounds.
Avoid this by using the XID of the toplevel.
https://bugzilla.gnome.org/show_bug.cgi?id=682395
Benjamin Otte [Mon, 1 Oct 2012 13:43:21 +0000 (15:43 +0200)]
widget: Move style context update out of vfunc
Otherwise the evil widgets that don't chain up their map and unmap
vfuncs will not get updated style contexts. This is in particular true
for GtkWindow and the CSS Theming / animated backgrounds demo in
gtk-demo.
Benjamin Otte [Fri, 28 Sep 2012 16:02:46 +0000 (18:02 +0200)]
css: Huge refactoring to avoid computing wrong values
Here's the shortest description of the bug I can come up with:
When computing values, we have 3 kinds of dependencies:
(1) other properties ("currentColor" or em values)
(2) inherited properties ("inherit")
(3) generic things from the theme (@keyframes or @define-color)
Previously, we passed the GtkStyleContext as an argument, because it
provided these 3 things using:
(1) _gtk_style_context_peek_property()
(2) _gtk_style_context_peek_property(gtk_style_context_get_parent())
(3) context->priv->cascade
However, this makes it impossible to lookup values other than the ones
accessible via _gtk_style_context_peek_property(). And this is exactly
what we are doing in gtk_style_context_update_cache(). So when the cache
updates encountered case (1), they were looking up the values from the
wrong style data.
So this large patch essentially does nothing but replace the
context argument in all compute functions with new arguments for the 3
cases above:
(1) values
(2) parent_values
(3) provider
quartz: Fix garbage content when windows are initially mapped
The garbage would be visible if any widget enabled the toplevel
NSView's CALayer in order to do custom native rendering.
(cherry picked from commit 92ea94af5f1a4d0970628b58997192ccf74cab36)
This is needed for the SELECTION_NONE mode where nothing is ever
selected, but its also needed for CTRL-<key> keynav that moves the
focus without changing the selection.
Currently the GdkWindow used for dragging is created once when
the first drag starts, and the reused identical each time.
Instead, just recreate it for each drag, with the correct size.