notebook: return TRUE for drag-motion event when over tabs
The GtkNotebook drag-motion event handler may install a timeout when
hovering over a tab, in order to switch to it.
On the other hand it's desirable for applications to use the empty tab
area as a drop target, so the drag-motion handler returns FALSE
(also in case it installs the switch tab timeout), as explained in
https://bugzilla.gnome.org/show_bug.cgi?id=350665.
Unfortunately, applications can use the tab label widget (or a child
of it) as a different drop target area, and install their own
drag-motion handler there.
In this scenario, the timeout will still be installed by GtkNotebook's
handler, but since it returns FALSE, it will never get the matching
drag-leave event, causing it to trigger also when the mouse pointer
moved elsewhere before it expired.
Fix this by returning TRUE from drag-motion when the event is over a
tab. Note that this makes automatic tab switching not work anymore when
drag and drop is handled in the tab label widget; applications are
expected to also handle tab switching if desired in such a case.
Cosimo Cecchi [Mon, 22 Oct 2012 15:42:55 +0000 (11:42 -0400)]
scrollbar: update style properties on GtkRange at init
GtkScrollbar used to rely on style-updated being emitted every time
after the widget was created in order to set the right values from its
style properties on GtkRange.
Nowadays we try to be smarter and avoid emitting style-updated at
creation time, so we need to manually initialize the GtkRange values.
Cosimo Cecchi [Wed, 17 Oct 2012 04:59:59 +0000 (00:59 -0400)]
scrolledwindow: set GDK_EXPOSURE_MASK on the overshoot window
Currently we use gtk_style_context_set_background() when the state flags
change in order to propagate the background color to the overshoot
window, but this is actually only needed because the window doesn't get
expose events, since we always draw a full background in draw().
This also fixes some problems when the GdkWindow of the scrolled
window's child is composited, as seen in oxygen-gtk3.
The implementation of transition for GtkCssShadowValue can return NULL
at least when the two values have a different inset; all other parts of
the GTK/CSS machinery (e.g. GtkCssArrayValue) handle this by returning
NULL too. Instead, GtkCssShadowsValue was returning an invalid value,
where "len" was set, but some values in the array were NULL, which would
lead to a segfault when this value is later evaluated by the compute
function.
Fix this by making GtkCssShadowsValue return NULL if a shadow transition
fails, like GtkCssArrayValue does.
Cosimo Cecchi [Tue, 16 Oct 2012 17:02:55 +0000 (13:02 -0400)]
reftests: fix the linear-gradient reftest
Don't use a repeating linear gradient, since it can't be easily
reftested against a non-repeating one for the reasons described in the
test header.
Instead, add a separate test for repeating gradients (against another
repeating gradient).
This makes the test pass, so it can be added to the Makefile now.
Matthias Clasen [Tue, 16 Oct 2012 10:00:40 +0000 (06:00 -0400)]
Fix css parser tests
Parsing a shorthand background property was running into unexpected
errors when trying position values where there were none. To fix this,
introduce a try_parse variant of the position parse function that
silently returns NULL.
Matthias Clasen [Mon, 15 Oct 2012 10:04:11 +0000 (06:04 -0400)]
GtkWidgetAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkWidgetAccessible innards
from several accessible implementations.
Matthias Clasen [Mon, 15 Oct 2012 09:52:04 +0000 (05:52 -0400)]
GtkToplevelAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkToplevelAccessible innards
from the GtkWindowAccessible implementation.
Matthias Clasen [Mon, 15 Oct 2012 01:07:46 +0000 (21:07 -0400)]
GtkRendererCellAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkRendererCellAccessible innards
from various cell accessible implementations.
Matthias Clasen [Sun, 14 Oct 2012 19:52:29 +0000 (15:52 -0400)]
GtkContainerCellAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkContainerCellAccessible
innards from the GtkCellAccessible implementation.
Matthias Clasen [Sun, 14 Oct 2012 19:11:17 +0000 (15:11 -0400)]
GtkContainerAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkContainerAccessible innards
from the GtkMenuItemAccessible implementation.
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.