Commit Graph

28720 Commits

Author SHA1 Message Date
Daniel Boles
79bbd4aca5 cssselector: Ensure we do not index out of bounds
This would only happen if the last element was deprecated, but it should
be avoided anyway.

CID 1388852 (#1 of 1): Out-of-bounds read (OVERRUN)
12. overrun-local: Overrunning array pseudo_classes of 16 32-byte
elements at element index 16 (byte offset 512) using index i + 1U (which
evaluates to 16).
2017-08-01 20:17:02 +01:00
Daniel Boles
fc619706b7 Notebook: Remove null check after dereference
This function clearly assumes the parameter children cannot be NULL, and
the call sites seem to perform enough checks to confirm this.

CID 1388869 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking children suggests that it may be null,
but it has already been dereferenced on all paths leading to the check.
2017-08-01 20:15:14 +01:00
Daniel Boles
881d7c6442 Calendar: Add default case to appease Coverity
CID 1432024 (#1 of 1): Uninitialized scalar variable (UNINIT)
2. uninit_use_in_call: Using uninitialized value rect.x when calling
calendar_arrow_rectangle.

Add a default case to the switch which will bail out with
g_assert_not_reached(), which should reassure Coverity that the method
is always called with a valid value that is handled in the switch.
2017-08-01 20:15:14 +01:00
Daniel Boles
eddbfc65a9 cssbordervalue: Fix possible use of uninitialised
If value->values[i] is NULL, then values[i] was left uninitialised.
The code then reads each element of values[].

CID 1432029 (#1 of 1): Uninitialized pointer read (UNINIT)
11. uninit_use: Using uninitialized value values[i].
2017-08-01 20:14:50 +01:00
Daniel Boles
37b23927c4 Stack: Fix copy-paste error
This fixes Coverity CID 1452217.
2017-08-01 19:18:39 +01:00
Daniel Boles
44c4faeed0 Entry: Fix unset icon tooltip hiding Entry tooltip
Our ::query-tooltip handler first checks whether the pointer is over any
of the icons, returning their tooltip if so, and if not chains up to
Widget::query-tooltip in order to show the text for the widget overall.

But ensure_has_tooltip(), which exists to update :has-tooltip based on
whether ::query-tooltip is needed, only set :has-tooltip to TRUE if any
icon had a tooltip, without caring whether the widget as a whole does.

That is asymmetrical and meant that if the Entry had a tooltip, but
subsequently all icons had their tooltips unset, :has-tooltip would be
set to FALSE, and hence the tooltip for the widget would become lost.

The fix is to set :has-tooltip to TRUE if the widget has a tooltip of
its own, and we only need to check the icons if that is not the case.

https://bugzilla.gnome.org/show_bug.cgi?id=785672
2017-08-01 18:13:11 +01:00
Daniel Boles
b3a6067541 Entry: Warn about corner case hiding icon tooltips
https://bugzilla.gnome.org/show_bug.cgi?id=785672#c4
2017-08-01 18:13:11 +01:00
Timm Bäder
f7bb6a7aa8 widget: Unset PRELIGHT and ACTIVE state in _set_sensitive
They both depend on input, which an insensitive widget does not receive.
2017-08-01 18:43:42 +02:00
Timm Bäder
36c4582086 button: Stop fiddling with PRELIGHT state
This is done automatically now and it's wrong here since it gets
executed after gesture release.
2017-08-01 18:16:40 +02:00
Timm Bäder
30d6b08271 scale: Allocate the value next to the slider
... when vertical. Also fixes usage of the uninitialized value_alloc.y.
2017-08-01 11:36:03 +02:00
Daniel Boles
0eb7e71a89 entry: Remove unused/duplicate widget in IconInfo 2017-07-30 14:20:59 +01:00
Timm Bäder
2cbcee8549 widget: Don't access highlight_resize in non-debug builds
The GtkWidgetPrivate struct only contains that member if G_ENABLE_DEBUG
is defined.
2017-07-28 21:28:32 +02:00
Timm Bäder
b71f644cf5 eventbox: Remove visible-window property
The GdkWindow that was supposed to back it is gone.
2017-07-27 21:53:42 +02:00
Carlos Garnacho
2d3882c7eb gtklabel: Fix touch link handling under wayland
Refactor the code updating the active link under the current coordinates
into a separate function, and call it on GtkGestureMultiPress::pressed
so the link is updated on GDK_TOUCH_BEGIN. Based on a patch by
Jan-Michael Brummer <jan.brummer@tabos.org>.

https://bugzilla.gnome.org/show_bug.cgi?id=776903
2017-07-26 13:20:56 +02:00
Carlos Garnacho
21062fab02 gtklinkbutton: Set cursor on button's event window
It is not necessary to (re)set the cursor on every crossing
event, and can probably yield the wrong results if there are
multiple master devices involved. Just set it on init(), and
let the inner machinery update the cursor whenever necessary.

This patch is an adaption of commit 0daf79676 in gtk-3-22, the
side effects are not as bad here because the cursor was already
being set on the widget specifically instead of the parent
widget's, but there's still some nonetheless (plus, it's simpler)

https://bugzilla.gnome.org/show_bug.cgi?id=785375
2017-07-26 13:11:43 +02:00
Kjell Ahlstedt
e2744aa74f actionbar: Call g_object_class_install_properties()
https://bugzilla.gnome.org/show_bug.cgi?id=785318
2017-07-25 10:35:29 +02:00
Matthias Clasen
ce801641a7 Avoid the use of g_autofree
We can't use this in code that may be built on win32,
so lets just not use it at all.
2017-07-24 13:27:29 -04:00
Timm Bäder
3f9bcf3b31 widget: Stop invalidating recursively 2017-07-24 14:32:06 +02:00
Timm Bäder
343f2d8c08 notebook: Set tabs child visible before allocating a size
Otherwise we might skip them here, then set child-visible to TRUE and
then later snapshot them even though they have no valid size.
2017-07-22 19:36:05 +02:00
Timm Bäder
3b44a88ddb cssstylechange: Fix change printing
Only print the old value once, above the new one.
2017-07-22 19:36:05 +02:00
Timm Bäder
5afbde2632 flowbox: Fix get_child_at_pos 2017-07-22 06:52:46 +02:00
Chun-wei Fan
73e81b64b6 gtk/gtkprintoperation-win32.c: Don't call gtk_widget_set_allocation()
This function was removed recently.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-07-21 23:35:38 +08:00
Timm Bäder
e92eebb434 overlay: Fix child widget allocation
Just adding the overlay's own position is wrong now.
2017-07-20 12:40:46 +02:00
Timm Bäder
c3176ed302 overlay: Keep the main child at the bottom
Since gtk_bin_add does a gtk_widget_set_parent call, we cannot use it in
a GtkBin implementation that has multiple child widgets and cares about
their order.
2017-07-20 12:33:57 +02:00
Timm Bäder
f537d36d0a GtkStyleContext: Create path node in _new
So we can avoid creating a GtkCssPathNode in _init and then throwing it
away right after when using the _new_with_node constructor, which is the
one we use for all widgets.
2017-07-19 21:27:16 -04:00
Timm Bäder
fc47be9339 GtkStyleContext: Remove property cache
It was only used for widget style properties which don't exist anymore.
2017-07-19 21:27:16 -04:00
Timm Bäder
9bf5def6b7 statusbar: Inherit from GtkWidget 2017-07-19 21:27:16 -04:00
Timm Bäder
4a4c7131fd modelmenuitem: Care about GtkAccelLabel in get_text 2017-07-19 21:27:16 -04:00
Timm Bäder
8a26e8a6ba modelmenuitem: Update indicator visibility when has_indicator changes 2017-07-19 21:27:16 -04:00
Timm Bäder
2f1d962e56 menushell: Hide model submenus by default 2017-07-19 21:27:16 -04:00
Timm Bäder
b1354a184b GtkCheckMenuItem: Remove snapshot-indicator vfunc
Let the widget snapshot all child widgets and control the visibility of
those child widgets instead.
2017-07-19 21:27:16 -04:00
Timm Bäder
ed5192497f label: Remove GtkEventBox mention from docs
Packing the label inside a GtkEventBox is not necessary anymore for it
to receive events.
2017-07-19 21:27:16 -04:00
Timm Bäder
584d613bfd image: Remove irrelevant code sample
Both the description and the sample itself are obsolete or uninteresting
now that all widgets can receive events.
2017-07-19 21:27:16 -04:00
Timm Bäder
d31621256d spinbutton: Fix css node docs 2017-07-19 21:27:16 -04:00
Timm Bäder
2c3ec49535 treeview: Fix row drag icon offsets 2017-07-19 21:27:16 -04:00
Timm Bäder
d836fa5134 treeviewcolumn: Remove input window 2017-07-19 21:27:16 -04:00
Timm Bäder
bd446c48e9 spinbutton: expand the entry
It's supposed to fill the entire spinbutton allocation apart from the
buttons
2017-07-19 21:27:16 -04:00
Timm Bäder
efccff70b7 Adwaita: Set minimum size for modelbutton arrows
Otherwise the minimum size is 1×1.
2017-07-19 21:27:16 -04:00
Timm Bäder
348871d9fc Fix a few testsuite failures
Adjust default property values, skip GtkRange:adjustment.
2017-07-19 21:27:16 -04:00
Timm Bäder
5720f2a845 widget: Make _set_clip private
We don't need this anymore since clips are now reported in
size-allocate.
2017-07-19 21:27:16 -04:00
Timm Bäder
28dae5f1c2 checkmenuitem: Don't always snapshot the indicator
Chaining up will snapshot all child widgets, which doesn't work with
GtkModelMenuItem.
2017-07-19 21:27:16 -04:00
Timm Bäder
8358817ad1 applicationwindow: Remove some useless queue_resize calls
The gtk_widget_{set_parent,unparent} calls before will already cause a
resize when necessary.
2017-07-19 21:27:16 -04:00
Timm Bäder
308f41487d modelmenuitem: Set label on menu items
We have to add a check for GTK_IS_ACCEL_LABEL too now...
2017-07-19 21:27:16 -04:00
Timm Bäder
5116ce19b7 widget: Remove queue_draw_region vfunc
Unused
2017-07-19 21:27:16 -04:00
Timm Bäder
65209da486 widget: Set :focus on focus children 2017-07-19 21:27:16 -04:00
Timm Bäder
d7056f5d22 revealer: Explain CSS oddities 2017-07-19 21:27:16 -04:00
Timm Bäder
36ab70ddf5 widget: Add baseline and out_clip parameters to size-allocate
Since setting a clip is mandatory for almost all widgets, we can as well
change the size-allocate signature to include a out_clip parameter, just
like GtkCssGadget did. And since we now always propagate baselines, we
might as well pass that one on to size-allocate.

This way we can also make sure to transform the clip returned from
size-allocate to parent-coordinates, i.e. the same coordinate space
priv->allocation is in.
2017-07-19 21:27:16 -04:00
Timm Bäder
95bd58ac00 widget: Don't propagate size-allocate if only the position changed
We can do this now so we should
2017-07-19 21:27:15 -04:00
Timm Bäder
2e6b1158ee widget: Fix priv dereference in size_allocate_with_baseline
Accessing ->priv is only safe *after* the GTK_IS_WIDGET precondition, so
use the get_instance_private function instead.
2017-07-19 21:27:15 -04:00
Timm Bäder
6d9a0d432a widget: Fix a widget/container mixup 2017-07-19 21:27:15 -04:00