Commit Graph

27129 Commits

Author SHA1 Message Date
Daniel Boles
563063d66b Scale: Fix signal documentation syntax
Oops, sorry. Thanks to Cristoph Reiter for correcting me on this.
2017-02-19 10:13:34 +00:00
Daniel Boles
0478bfd37b Scale: Improve docs of format-value property 2017-02-19 09:12:17 +00:00
Daniel Boles
b3b2f6b5d4 Scale: Improve docs of prop digits in other places
There were places still implying that it was only used for display.
2017-02-19 09:04:17 +00:00
Daniel Boles
ee6c514406 Scale: consistent #Class:signal-or-property syntax
Use : everywhere, not a mixture of : and ::
2017-02-19 09:04:17 +00:00
Daniel Boles
11f81e77f9 CssSelector: Fix warning for bad pseudo-class name
It was "Missing name of pseudo-class", but the real problem is exactly
the opposite: we /have/ been given a name, but it is not a valid one.
Change it to "Invalid name of pseudo-class" to minimise confusion.
2017-02-18 21:03:47 +00:00
Nelson Benítez León
c4874aeaa5 textiter: fix bug in gtk_text_iter_backward_line()
gtk_text_iter_backward_line() checks the value of
real->line_char_offset without previously calling
ensure_char_offsets (real) to make sure the former
is up-to-date.

As a consequence of this, when gtk_text_iter_backward_line()
is called after a gtk_text_buffer_insert_range() in the
first line of buffer, the iter is not moved to the start of
the line, and the return value is wrong.

Fixed by adding the ensure_char_offsets() call.

A test case for this bug is added to the textiter gtk testsuite.
2017-02-18 20:00:32 +00:00
Daniel Boles
6cdeac1c6a Image—Add some more missing (nullable) annotations 2017-02-17 22:13:48 +00:00
Timm Bäder
a729eeab0a filechooserentry: Avoid an uninitialized value
|= with a garbage value on the left side results in a still-garbage
value.
2017-02-17 21:46:51 +00:00
Timm Bäder
42d8b70b0e filechooserwidget: Fix profiling code compilation 2017-02-17 21:46:51 +00:00
Timm Bäder
8aa9fb38a3 Add a few missing (nullable) annotations 2017-02-17 21:46:51 +00:00
Timm Bäder
98c04230c3 builder: avoid an uninitialized value
When g_module_supported() returns FALSE, args.module is garbage
otherwise.
2017-02-17 21:46:51 +00:00
Timm Bäder
26cab782cd filechooserwidget: Fix rename popover position calculation
Since the browse_file_popover is positioned correctly, just convert the
coordinates in the same way we do there.

https://bugzilla.gnome.org/show_bug.cgi?id=778746
2017-02-17 21:46:51 +00:00
Emmanuele Bassi
d93dd81e65 Use gtk_show_uri_on_window() in GtkLabel
Avoid the deprecated gtk_show_uri(), and allow activating link in
sandboxed applications.

https://bugzilla.gnome.org/show_bug.cgi?id=778726
2017-02-16 16:34:42 +01:00
Bastien Nocera
72ac208052 GtkMountOperation: We use gtk_show_uri_on_window() by default
Not gtk_show_uri().

https://bugzilla.gnome.org/show_bug.cgi?id=778726
2017-02-16 16:34:42 +01:00
Bastien Nocera
e4fbfde07b gtk: Ignore gtk_show_uri() deprecation warnings
https://bugzilla.gnome.org/show_bug.cgi?id=778726
2017-02-16 16:34:42 +01:00
Bastien Nocera
da0291950d GtkLinkButton: We use gtk_show_uri_on_window() by default
Not gtk_show_uri().

https://bugzilla.gnome.org/show_bug.cgi?id=778726
2017-02-16 16:34:42 +01:00
Bastien Nocera
f2febf7c71 GtkAboutDialog: We use gtk_show_uri_on_window() by default
Not gtk_show_uri().

https://bugzilla.gnome.org/show_bug.cgi?id=778726
2017-02-16 16:34:42 +01:00
Lionel Landwerlin
977b26dcf5 widget: propagate scale factor upon reparenting a widget
When a widget is created, its default scale is the scale of the
primary screen (for instance 2). But once parented to another widget
its scale factor should be the one of its parent (if parented to a
widget on a screen at scale factor 1, it should be 1).

The problem is that we don't emit the notify::scale-factor signal when
reparenting happens.

https://bugzilla.gnome.org/show_bug.cgi?id=776821
2017-02-16 12:31:57 +00:00
Daniel Boles
f8af23553b widget: Document signal mnemonic-activate
Name the extra bool argument, and move the explanatory paragraph from
the emitting method to the signal, with some minor tweaks to wording.

https://bugzilla.gnome.org/show_bug.cgi?id=778534
2017-02-15 21:45:01 +00:00
Bastien Nocera
104c9ac845 gtkshow: Prefer gtk_show_uri_on_window() which works for sandboxed apps
gtk_show_uri_on_window() will pass enough information for Portal helpers
to allow dialogue parenting in Flatpak, gtk_show_uri() won't, so
deprecate it.

https://bugzilla.gnome.org/show_bug.cgi?id=778678
2017-02-15 16:23:48 +01:00
Lapo Calamandrei
8f01d6c5f4 HC: insensitive styling for views. 2017-02-08 16:53:10 +01:00
Lapo Calamandrei
efde7d15aa adwaita: insensitive styling for views
Add an insensitive style to views, somehow we didn't ship one, so
for example, disabled textviews looked the same as sensitive ones.
2017-02-08 16:45:51 +01:00
Philip Chimento
e338b4589d quartz: Implement gtk_clipboard_get_selection
This function is trivial and can be copied from the X11 implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=772281
2017-02-05 14:54:37 -08:00
Michael Catanzaro
644c2d9617 notebook: redraw arrows after closing a tab
Thanks to Daniel Boles for helping with a crash in an earlier version of
this patch.

https://bugzilla.gnome.org/show_bug.cgi?id=777547
2017-02-04 12:54:12 -06:00
Matthias Clasen
09b2c54d41 range: Add a queue_resize call
This is a workaround for a regression in updating scrollbars in
some applications; notably eog. We haven't fully tracked down yet
why a queue_allocation is not sufficient here, it should.

https://bugzilla.gnome.org/show_bug.cgi?id=765410
2017-02-01 21:16:29 +01:00
Daniel Boles
43de771574 searchentry: Fix typo in documentation 2017-01-31 09:47:42 +00:00
Michael Catanzaro
3708e5cc7c Revert "notebook: redraw arrows after closing a tab"
This reverts commit 8caaba82cc.
2017-01-27 08:53:54 -06:00
Michael Catanzaro
8caaba82cc notebook: redraw arrows after closing a tab
https://bugzilla.gnome.org/show_bug.cgi?id=777547
2017-01-24 08:32:53 -06:00
Daniel Boles
aff42686ce combobox: Fix documentation typo bx => box 2017-01-21 16:11:54 +00:00
Daniel Boles
167ef42c5c menushell: Don’t dereference before typechecking 2017-01-20 22:18:40 +00:00
Daniel Boles
f705d0a5fa combobox: If typechecking, don’t reference before 2017-01-20 21:07:26 +00:00
Daniel Boles
7401794de6 combobox: popdown() the menu during unmap()
combo_box_popdown() of course doesn’t popdown our menu if it is NULL.
But the required call to this at end-of-life was in destroy(), by which
point dispose() already NULLed the menu, so Menu::popdown() would never
run, even if it should. Fix this by trying popdown() earlier in unmap().
Also, add a converse assurance that we don’t popup() while not mapped.
2017-01-20 13:47:33 +00:00
Daniel Boles
eb26b57cba combobox: Avoid a pointless assignment
Don’t get the active item pointer before the grid/non-grid conditional,
because if we’re in grid mode, we re-get it before selecting it anyway.
2017-01-19 03:26:09 +00:00
Daniel Boles
b7cfe3c778 combobox: Also preselect active item in grid popup
i.e. when wrap-width > 0. This was only being done for non-grid cases.
So, ComboBoxes in grid mode did not indicate their selection when popped
up and required users to keynav from ‘nothing’ (at the top-left) to the
item they wanted to select. By selecting the active item in advance, now
it’s highlighted & acts as the starting point for keynav around the grid
2017-01-19 03:12:32 +00:00
Daniel Boles
a58dd993b2 scale: Really fix documentation of set_digits()
This previously only mentioned its effect on the displayed value, and
even after the previous commit, its rounding of the actual value upon
change still reads like too much of an afterthought. Worse, it wasn’t
mentioned at all in the doc for the @digits parameter. Change this to
emphasise rounding always occurs and the displayed value is secondary.
2017-01-19 00:44:35 +00:00
Daniel Boles
8377850127 scale: doc: set_digits doesn’t round retroactively
Whether it should is an open question, but for now, the documentation
should clearly indicate that currently rounding is only applied upon
changes to the value, not to the existing value when ::digits changes.
This is already clear in the doc for the underlying Range::round-digits.

https://bugzilla.gnome.org/show_bug.cgi?id=358970
2017-01-19 00:17:40 +00:00
Daniel Boles
4a6bd134bd Scale: Always sync ::digits to Range::round-digits
The documents state that gtk_scale_set_digits() “causes the value of the
adjustment to be rounded off to this number of digits, so the retrieved
value matches the value the user saw.” Note the lack of any condition.

But in fact, if draw-value was false, rounding was disabled on the base
Range, so values that weren’t displayed weren’t rounded. This made the
docs wrong and made an apparently cosmetic detail alter functionality.

Fix by ensuring the number of digits set on Scale is always propagated
along to gtk_range_set_round_digits(), thus rounding to it in all cases
when the value changes, regardless of whether the value is displayed.

This doesn’t address the other idea from Bugzilla: that changing the
number of digits should clamp the _existing_ value if it’s more precise.
This contradicts digits docs in the base Range, but the above from Scale
can be read as implying it’ll happen. For now, that’s an open question.

https://bugzilla.gnome.org/show_bug.cgi?id=358970
2017-01-19 00:17:40 +00:00
Daniel Boles
e98e6f73be combobox: Work around popup handler altering model
GtkFileChooserButton installs a handler for the popped-up signal, which
refilters the menu, in order to hide the “(None)” item from the popup
if it was previously selected in the ComboBox. This oddity means that:

 • Until recently, this item would be selected in the menu shell, which
   would then be popped up and change the selection away from that item.
   This was therefore redundant (more on which below!) but benign.

 • After the patch for https://bugzilla.gnome.org/show_bug.cgi?id=771242
   however, this causes a critical assertion fail, as now we stash the
   originally selected item in a pointer so that it can be selected only
   after realisation/popup – but by that stage, the model has just been
   refiltered and the previous pointer no longer refers to a valid item.

This commit works around this problem by, after popping up the menu,
getting the active item again, in case a popped-up handler has gone and
invalidated the pointer to the active item that we saved before popup.

If a handler does this, everything done to find/use the original item is
pointless. But this avoids the ugly critical in FileChooserButton, while
not harming every other ComboBox that doesn’t mess with its model while
popping up (hopefully the vast majority), and it’s very difficult to
imagine a way to check if the active item is /going to/ be hidden later)
2017-01-18 22:22:52 +00:00
Daniel Boles
dfe89a381f combobox: Don’t select active item if it’s hidden
I hope no one ever actually brings such a silly item into this world,
but this achieves symmetry with the similar checks immediately after.
2017-01-18 22:17:37 +00:00
Daniel Boles
ac4e1625f5 combobox: Move variables into narrowest scopes 2017-01-18 21:43:42 +00:00
Matthias Clasen
31fee675e4 Revert "filechooser portal: Make sure we can save"
This reverts commit 4875c689a0.

This was a thinko. Writable is not actually settable from the
application side, but only for the user, from the backend side.
2017-01-17 14:15:39 -05:00
Matthias Clasen
f4a0f2e5ca filechooser portal: Make sure we can save
Explicitly request files for saving to be writable, otherwise
we are at the mercy of the portal, which currently gets it wrong.
2017-01-17 14:10:50 -05:00
Daniel Boles
afd19e9433 grid: Fix plural error in docs' @Short_description 2017-01-15 20:39:43 +00:00
Benjamin Otte
21a71e94c6 cssimage: Fallback images have no aspect ratio
The aspect ratio for fallback image was incorrectly set to 1.

Reftest is included.
2017-01-13 03:39:50 +01:00
Benjamin Otte
2e7d5c08cb cssimage: Scale images to contain, not cover
Images with just an aspect ratio, but without a size, should be scaled
to be fully visible in the given area.
But we scaled them to completely cover the given area, which made them
partially invisible.

Reftest included.
2017-01-13 03:39:49 +01:00
Daniel Boles
cc4ea94d8b revealer: Fix a typo in a function doc
Also, "ie" wasn't very clear, but fixing that to "i.e." would cause
truncation of the summary when processed by bindings using doxygen. So,
I replaced it with "in other words", which is no _less_ clear, at least.
2017-01-09 22:46:21 +00:00
Carlos Garnacho
eb57651ff7 gtkdnd: Remove unnecessary call
drag-data-delete is emitted based on the interchange of the
DELETE atom, which may well be set or bypassed locally by
the app. As such emitting it here is not right, the other
paths handling the DELETE atom interchange are still valid
and there.

https://bugzilla.gnome.org/show_bug.cgi?id=774726
2017-01-09 19:04:23 +01:00
Matthias Clasen
074f391f10 Make GTK_DEBUG=interactive work better
We currently have various ways to initialize GTK+, and not
all of them were supporting this way of bringing up the
inspector. Fix this.

https://bugzilla.gnome.org/show_bug.cgi?id=776807
2017-01-07 19:18:09 -05:00
Matthias Clasen
bea4c0898d Revert "Make it possible to set style classes for label links"
This reverts commit 9a2527b361.

This needs more work to have a chance of working properly.
2017-01-05 19:40:40 -05:00
Matthias Clasen
41b14fd148 Revert "Use CSS for styling links in labels"
This reverts commit 34264667ed.
2017-01-05 19:40:12 -05:00
Matthias Clasen
34264667ed Use CSS for styling links in labels
This was implemented only halfway, and was hardcoding the
underline. We don't need to do that anymore.
2017-01-05 18:12:20 -05:00
Matthias Clasen
9a2527b361 Make it possible to set style classes for label links
This makes it possible to style links in labels differently
in certain situations.
2017-01-05 17:33:04 -05:00
Sébastien Wilmet
e75601c058 docs: improve the documentation of GtkEntry:attributes
See the implementation of gtk_entry_create_layout():
pango_attr_list_splice() is used to add the PangoAttrList of the preedit
string. And that is done *after* applying the PangoAttrList of the
"attributes" property.

https://bugzilla.gnome.org/show_bug.cgi?id=776868
2017-01-04 20:01:28 +01:00
Daniel Boles
7960e94112 scrolledwindow: Fix func summary being cut off in bindings using doxygen
...which treats the first '.' in doc comments as the end of the summary.
So, e.g., in gtkmm, get_kinetic_scrolling() is currently summarised as
"Changes the behaviour of @scrolled_window wrt." Not very informative!

No need for a period there & anyway, the phrase "wrt to" is superfluous,
and we have space to actually say "with regard to", so just do that now.
2016-12-31 13:28:51 +00:00
Chris Mayo
d9748563c8 GtkAboutDialog: Fix formatting of example email address in html
Signed-off-by: Chris Mayo <aklhfex@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=776524
2016-12-30 10:37:38 -05:00
Matthias Clasen
1fc3fe4a0a about dialog: Simplify the template a bit
Remove some unnecessary complications, like an extraneous
box, and some child property settings that are not needed.
2016-12-30 10:20:16 -05:00
Matthias Clasen
f19ecbb850 Avoid a possible crash in ::activate-url handlers
If the signal handler ends up changing the label text,
the link is no longer around to update the css node.
Check for this possibility to avoid a crash here.
2016-12-29 11:08:29 -05:00
Debarshi Ray
8155c33d80 flowbox: Don't emit child-activated while dragging the pointer
https://bugzilla.gnome.org/show_bug.cgi?id=776306
2016-12-20 12:55:41 +01:00
Debarshi Ray
9679ef6b00 flowbox: Export gtk_flow_box_get_child_at_pos as public API
Bump the gtk+ version so that others can depend on this new API.

https://bugzilla.gnome.org/show_bug.cgi?id=776187
2016-12-20 00:35:48 +01:00
Philip Chimento
30b5187e60 GtkApplication: Lack of optional components shouldn't warn
When running uninstalled tests with GtkApplication on an autobuilder with
a fake session bus, warnings will cause the tests to abort. The GNOME
session manager, the Xfce session manager, and the Inhibit portal are all
not needed for normal operation of GTK, so we should not log warnings if
they are not found.

As well as not being present on a fake session bus, it's also not
expected that they'll be present on all platforms.

https://bugzilla.gnome.org/show_bug.cgi?id=774784
2016-12-19 15:25:58 -08:00
Debarshi Ray
3073419ff1 flowbox: Don't emit selected-children-changed during destruction
https://bugzilla.gnome.org/show_bug.cgi?id=776012
2016-12-19 18:06:41 +01:00
Debarshi Ray
e779ec4b1f listbox: Don't emit selected-rows-changed, etc. during destruction
https://bugzilla.gnome.org/show_bug.cgi?id=776012
2016-12-19 18:06:41 +01:00
Debarshi Ray
bebcb5e094 flowbox: Rename gtk_flow_box_find_child_at_pos for consistency
... with gtk_list_box_get_row_at_y. It would be nice to avoid the
'find' versus 'get' discrepancy since we are planning to expose it as
public API.

https://bugzilla.gnome.org/show_bug.cgi?id=776187
2016-12-19 15:10:07 +01:00
Benjamin Otte
e04654f865 css: An opaque background does not allow omitting push_group
When the background-clip of the background is smaller than the
background-clip of blended images, not pushing a group is wrong.

Test testing exactly that included.
2016-12-13 23:01:54 +01:00
Lapo Calamandrei
155dbaaa14 HC: progressbar style fix
Reset styling on the progress node when trough node has the `empty'
styleclass.

See https://bugzilla.gnome.org/show_bug.cgi?id=774695
2016-12-03 16:30:23 +00:00
Lapo Calamandrei
d55aa2a859 Adwaita: progressbar style fix
Reset styling on the progress node when trough node has the `empty'
styleclass.

See https://bugzilla.gnome.org/show_bug.cgi?id=774695
2016-12-03 16:30:23 +00:00
Daniel Boles
42d7f81649 GtkProgressBar: trivial conditional optimisation
I'd hope the compiler would realise this for us, but let's be explicit.
2016-12-03 16:30:23 +00:00
Simon Steinbeiss
a793f8f243 progressbar: add empty and full classes on trough based on fill-level
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774695
2016-12-03 16:26:15 +00:00
Debarshi Ray
8952975304 flowbox: Fix get_child_at_index crash with an invalid index
https://bugzilla.gnome.org/show_bug.cgi?id=775525
2016-12-02 16:38:05 +01:00
Lapo Calamandrei
e6d7df7233 Adwaita: render updated assets. 2016-12-01 13:17:02 +00:00
Lapo Calamandrei
35e6a8eb0d Adwaita: update assets svg
correct colors for pointy sliders assets.
2016-12-01 13:17:02 +00:00
Daniel Boles
7fca502115 ComboBox: Do not select item before menu realised
For a menu mode CB with wrap_width == 0 and an active item, that item is
selected in gtk_combo_box_menu_popup. Selection causes the MenuShell to
activate and hence take a grab. This was done before the menu was popped
up. A patch distributed in Debian sid - after being proposed on our BZ -
revealed that on the 1st popup of any such ComboBox, within grab_add,
the MenuShell's toplevel's GdkWindow is NULL. This causes a Gdk-CRITICAL
assertion fail on the 1st time opening any such CB, on Debian and if
that patch were merged to GTK+. By selecting after popup, we ensure the
MenuShell is realised before its grab_add and so avoid the critical.

https://bugzilla.gnome.org/show_bug.cgi?id=771242
2016-12-01 12:58:59 +00:00
William Hua
f50ed5b358 gtkcombobox: pass trigger event when popping up menu
https://bugzilla.gnome.org/show_bug.cgi?id=771242
2016-12-01 12:58:59 +00:00
Daniel Boles
3971439a17 ComboBox: Fix whitespace
* Replace tabs for indentation with spaces
 * Remove whitespace at ends of lines
2016-12-01 12:58:59 +00:00
Matthias Clasen
f7fb610278 Don't leak a pixbuf reference in dnd
https://bugzilla.gnome.org/show_bug.cgi?id=775316
2016-11-29 14:45:41 -05:00
Matthias Clasen
17ec4f10e4 Fix reference handling in GtkScaleButton
We were leaking the adjustment, since we confuse ourselves
with a property whose initial value comes out of a template.
Stop doing that.

https://bugzilla.gnome.org/show_bug.cgi?id=775212
2016-11-28 15:04:49 -05:00
Sébastien Wilmet
2f940d91a0 docs: fix a parameter name of GtkEntry::populate-popup
Trivial commit.

The documentation block refers to @widget, not @popup. @widget is a
better name since the type is GtkWidget.
2016-11-26 12:35:14 +01:00
Sébastien Wilmet
ca75748223 docs: fix docs of functions to convert layout_index <-> text_index
Trivial commit.

The documentation was swapped. The documentation for the parameters and
the return values is good.
2016-11-26 12:34:48 +01:00
Cosimo Cecchi
5282991ab9 Adwaita: make rubberband selection work again for libgd apps
libgd views still use the old style class.
2016-11-25 18:53:21 +01:00
Matthias Clasen
6c0cd1a16d Make gtk-encode-symbolic-svg work for icons with dotted names
We were producing org.symbolic.png from org.gnome.Recipes-symbolic.svg,
which is not useful. Look for the last dot in the original name, to
produce the expected org.gnome.Recipes-symbolic.symbolic.png instead.
2016-11-25 08:57:50 -05:00
Matthias Clasen
4cd8796c0e inspector: Respect text-scaling-factor value initially
This was pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=774893
2016-11-23 19:37:28 -05:00
Florian Müllner
cc6335d94d GtkLabelAccessible: Initialize link before setting parent
Since at-spi-atk commit 96621a5e95 fixed PropertyChange notifications
for AccessibleParent, setting the parent will result in a call to
ref_state_set() which assumes that the object is fully initialized.

https://bugzilla.gnome.org/show_bug.cgi?id=774939
2016-11-23 19:02:40 -05:00
Christian Hergert
ecb38bc824 inspector: ensure controller is a GtkGesture
While GtkEventController implementations today are all GtkGesture, it is
possible to create a GtkEventController manually. This is an extrac check
to ensure we only add gestures to the list.

https://bugzilla.gnome.org/show_bug.cgi?id=774760
2016-11-23 14:02:15 -08:00
Matthias Clasen
43b9b7f4e6 menu: Don't leak check menu items
Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=774686
2016-11-23 14:50:16 -05:00
Matthias Clasen
7d695068e2 notebook: Don't leak arrow gadgets
This was pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=774743
2016-11-23 14:49:15 -05:00
Matthias Clasen
da9bd46aed text handle: Don't leak adjustments
This can happen if the weak pointer is triggered before the
adjustments are unset. Pointed out in

https://bugzilla.gnome.org/show_bug.cgi?id=774790
2016-11-23 13:58:00 -05:00
Gustavo Noronha Silva
aa1307a787 Fix off by one in check for GtkRoundedBox containing a rectangle
When checking if a rectangle is contained by the rounded box, the code
will refuse a rectangle which is the exact size as the one backing the
rounded box, since it checks for greater or equal width and height.
Check for greater only instead.

https://bugzilla.gnome.org/show_bug.cgi?id=774114
2016-11-21 11:03:36 -02:00
Matthias Clasen
5301644a3f Document gtk_menu_place_on_monitor 2016-11-19 13:53:05 -05:00
Matthias Clasen
157b630d72 Add a since tag 2016-11-19 13:29:17 -05:00
Timm Bäder
dc184902d7 filechooserwidget: Forward file filter to entry
And in the entry, apply the currently used filter as a second step to
the completion items.

https://bugzilla.gnome.org/show_bug.cgi?id=773007
2016-11-18 13:29:58 -05:00
Matthias Clasen
748a1450a8 placeview: Don't leak the file enumerator
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774634
2016-11-17 13:55:44 -05:00
Matthias Clasen
7f7501b1e7 Allow replacing input file in gtk-builder-tool simplify 2016-11-15 06:14:59 -05:00
Matthias Clasen
9a257e1f6a entry: Avoid recursion in gtk_entry_ensure_layout
This was unintentional, and lead to a memory leak.
2016-11-14 15:18:25 -05:00
Lauri Kasanen
a28022e916 recent-manager: Fix a memory leak caused by "recent-manager: Add a limit to the list's size"
Signed-off-by: Lauri Kasanen <curaga@operamail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=773587
2016-11-14 14:27:03 -05:00
Matthias Clasen
14545342d5 appchooser: Plug a memory leak
We were not dropping the reference that the model gives us.

https://bugzilla.gnome.org/show_bug.cgi?id=774352
2016-11-14 14:21:17 -05:00
Olivier Fourdan
57f551a114 gtkstack: reorder size_allocate and move_window
Unlike other container widgets, GtkStack would allocate its children
prior to moving its windows, which might prevent further valid size
allocation signals to be emitted.

Re-order the size allocation of child widgets to be performed after
moving the GtkStack windows.

Thanks to Owen for spotting the real issue here.

https://bugzilla.gnome.org/show_bug.cgi?id=767713
2016-11-14 12:02:43 +01:00
Lauri Kasanen
bf560369f2 recent-manager: Add a limit to the list's size
This fixes a DOS where any app can cause all running gtk apps
to use arbitrary amounts of memory.

Originally reported against mate-panel, where running a big slideshow
in eye-of-mate caused increasing RAM usage in mate-panel.

v2: Hardcode the value
Signed-off-by: Lauri Kasanen <curaga@operamail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=773587
2016-11-10 17:10:34 -05:00
Matthias Clasen
275bbbf88d places sidebar: Don't leak a reference
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774185
2016-11-10 15:17:28 -05:00
Matthias Clasen
9e5510420c Fix a copy-paste error
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774185#c3
2016-11-10 15:07:45 -05:00
Matthias Clasen
53474fa404 headerbar: Don't leak widgets
We were not properly freeing separators that we end up
not using.

https://bugzilla.gnome.org/show_bug.cgi?id=774066
2016-11-10 15:04:35 -05:00
Matthias Clasen
f8900e5ac4 spinbutton: Fix some gadget handling issues
We were not adding the down_button gadget to the parent,
and we were not unreffing the button gadgets.

https://bugzilla.gnome.org/show_bug.cgi?id=774046
2016-11-10 14:47:58 -05:00
Thibaut Girka
f9796b01ff Fix loading cached compose tables
https://bugzilla.gnome.org/show_bug.cgi?id=773916
2016-11-10 14:33:43 -05:00
Gustavo Noronha Silva
04f3940488 cssshadowvalue: scale the blur surface by the same factor as the target
Making sure the surfaces are using the same scale factor makes it more
likely a fast path will be used when pixman gets involved, as pointed
out by Benjamin Otte.

https://bugzilla.gnome.org/show_bug.cgi?id=772075
2016-11-10 16:30:36 -02:00
Carlos Garcia Campos
255225584e printing: Do not truncate job names in GtkPrintOperation
We are currently truncating job names to 255 bytes, because that's the
maximum allowed length of job-name attribute in CUPS. This is a CUPS
limitation that GtkPrintOperation shouldn't need to know, and it
shouldn't affect other backends, that might have other limitations or
even no limitation at all. This has another side effect, that what you
set as GtkPrintOperation:job-name could be different to what you get if
the property is truncated, this is not documented in
gtk_print_operation_set_job_name(). So, I think the job name should be
truncated by the CUPS backend, right before setting the job-name
attribute.

https://bugzilla.gnome.org/show_bug.cgi?id=774097
2016-11-10 16:56:43 +01:00
Florian Müllner
0bccddb2ff wayland: Set startup ID from GApplication platform data
The GApplication platform data may contain a startup ID that on X11
is used to set the startup notification ID when activated. Do the
same on the wayland backend to make startup notifications work for
DBus-activated applications where the DESKTOP_STARTUP_ID environment
variable is not set.

https://bugzilla.gnome.org/show_bug.cgi?id=768531
2016-11-08 13:29:55 -05:00
Benjamin Otte
dbc0337498 range: Don't leak pointers to discarded gadgets 2016-11-08 02:25:45 +01:00
Benjamin Otte
a68460847e render: Draw shadows outside of potential push_group() call
Before, the shadows were clipped.
2016-11-08 02:25:45 +01:00
Benjamin Otte
34d45def37 render: Clip the correct rectangle
We translated before.
2016-11-08 02:25:45 +01:00
Matthias Clasen
a61d7f7acf Avoid deprecation warnings
The recent round of deprecation additions has caused some
warnings that we should avoid.
2016-11-07 11:24:43 -05:00
Benjamin Otte
03de0c3444 widget: Deprecate gtk_widget_is_composited()
Also GtkWidget::composited-changed is gone.
2016-11-05 03:38:13 +01:00
Georges Basile Stavracas Neto
b3e3946b2f levelbar: update css nodes even when no offset value is found
GtkLevelBar supports adding custom offsets as style classes, and they
are applied whenever the :value property matches. The current code,
however, only updates any CSS nodes when an offset is found, causing
it to not update when a discrete value changes but no custom offset
is added.

Fix that by always updating the CSS nodes.

https://bugzilla.gnome.org/show_bug.cgi?id=773799
2016-11-04 12:45:03 -04:00
Lapo Calamandrei
a47a3fbd3b Adwaita: correctly style headerbars in a stack
corners are correctly rounded now. Stacked splitted headerbars are
not supported yet though.
2016-11-03 18:54:44 +01:00
Ernestas Kulik
39a8a6ef72 popover: pop down when pressing escape
Simply hiding the popover may introduce inconsistencies in application
behavior, since popping up/down is the usual use case.

https://bugzilla.gnome.org/show_bug.cgi?id=773885
2016-11-03 15:47:54 +02:00
Lapo Calamandrei
0ad5d51d8a Adwaita: no rounded corners for solid-csd. 2016-10-29 17:21:23 +02:00
Chun-wei Fan
45cf4c7d57 gtk/gtkmenu.c: Avoid compound literals
We only start requiring compound literals from GTK+-3.90, so fix this so
that pre-C99 compilers can build GTK+-3.22 properly.
2016-10-28 15:49:29 +08:00
Matthias Clasen
c54f348edf color chooser: Fix a problem with show-editor=TRUE
For some reason we end up allocating the colorplane widget
before it is realized, and then never initialize the surface.

Fix this by explicitly doing it on realize.

https://bugzilla.gnome.org/show_bug.cgi?id=773474
2016-10-26 14:32:28 -04:00
Sébastien Wilmet
94c6d19415 docs: fix copy/paste errors in the docs of GtkScrolledWindow
Trivial commit.
2016-10-26 15:23:16 +02:00
Felix Riemann
27029a79fa GtkShortcutType: Fix typos in developer documentation
https://bugzilla.gnome.org/show_bug.cgi?id=773479
2016-10-25 20:10:24 +02:00
Matthias Clasen
e51d73afa3 Emit ::style-set after setting priv->style
This was inadvertedly changed with an optimization a while ago,
and can lead to application crashes.

https://bugzilla.gnome.org/show_bug.cgi?id=773029
2016-10-21 14:39:10 -04:00
Jonas Ådahl
3ad1677a3a GtkMenu: Try using gdk_window_move_to_rect() more often
With best-effort, try to use gdk_window_move_to_rect() more often, when
all pieces fit together. For the non-legacy paths to be triggered for
when gtk_menu_popup_for_device() or gtk_menu_popup() were used, the
following conditions must be met:

 1) There is no custom positioning function specified
 2) The menu is attached to a widget (using gtk_menu_attach_to_widget())
 3) There is a associated grab device

https://bugzilla.gnome.org/show_bug.cgi?id=772922
2016-10-21 11:55:39 -04:00
Pavel Grunt
2b527d6e97 overlay: Document availability of properties
Add missing "Since"

https://bugzilla.gnome.org/show_bug.cgi?id=773082
2016-10-21 11:53:36 -04:00
Matthias Clasen
cd495a26b7 Deprecate gdk_window_set_debug_updates
This is gone in GTK+ 4, so lets deprecate it.
2016-10-21 10:55:16 -04:00
Matthias Clasen
a372f554eb Deprecate GtkContainer::child
It is gone in GTK+ 4, so let it deprecate here.
2016-10-21 10:21:44 -04:00
Matthias Clasen
796107c833 Deprecate gtk_window_set_wmclass
This function was already documented as "don't use", and it is
removed in GTK+ 4, so deprecate it properly.
2016-10-20 14:26:43 -04:00
Matthias Clasen
b109d25e8b Some forgotten deprecation cleanup 2016-10-20 13:58:49 -04:00
Matthias Clasen
0ca9b468b8 Deprecate gtk_drag_dest_set_proxy 2016-10-20 13:48:05 -04:00
Matthias Clasen
d3ad642519 Deprecate more to-be-removed screen apis
These will be removed in GTK+ 4, therefore, we're deprecating
them now.
2016-10-20 13:44:23 -04:00
Matthias Clasen
61fc7ddd87 Deprecate to-be-removed screen API
GTK+ 4 is removing the monitor-related screen APIs. We should
deprecate them in 3.22 so people know to port away from them.
2016-10-20 12:06:42 -04:00
Jaime Velasco Juan
0d104b041a win32 theme: Fix tooltip borders
https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
ebd2487df2 win32 theme: Fix combobox
https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
ad258bc81c win32 theme: Fix column headers
https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
d47d342012 win32 theme: Fix popup window decorations
Windows such as combobox's popup were using toplevel window's borders

https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
c46c744529 gtkwin32theme: delete #if 0 code
https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
49f2ed37cd win32 theme: Fix scale widget
It was invisible before.

https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
424b59aec6 win32 theme: No need to create a DC for GetThemePartSize
https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
db41f815c7 win32 theme: use TS_TRUE in GetThemePartSize
Several styles return a size of 0x0px when using TS_DRAW, as
we don't pass a RECT to draw into.

https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
bece404043 win32 theme: Fix scrollbars
The fix is only partial, when both scrollbars are visible their ends
overlap.

https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
91d4879f82 Fix CSS warnings in win32 theme
https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Jaime Velasco Juan
eda51b4ef5 Fix tiny fonts in win32 theme
broken since df08fc91... (css: always get default font size in pixels)

https://bugzilla.gnome.org/show_bug.cgi?id=773221
2016-10-20 16:57:24 +02:00
Lapo Calamandrei
e75314ec17 Adwaita: make circular button border looking nice
the darker bottom border used on buttons looks bad on circular ones
so now a gradient clipped on the border-box and a transparent
border is used in that partcular case.
See https://bugzilla.gnome.org/show_bug.cgi?id=771205 for details.
2016-10-19 15:59:33 +02:00
Lapo Calamandrei
f3d78aff12 Adwaita: sass, make button mixin export a global $button_fill var
$button_fill contains the background-image property value of
buttons, having it readable outside the drawing mixin allows, for
example, stacking background images in an easier way.
2016-10-19 15:59:33 +02:00
Lapo Calamandrei
38056d0f6e Adwaita: sass cleanup
aggregate circular button style to the main button structure.
2016-10-18 13:19:02 +02:00
Alan Jenkins
1e2e736d0d shortcutswindow: working version of set_section_name()
(testing before+after, it actually works now)

https://bugzilla.gnome.org/show_bug.cgi?id=772926
2016-10-14 10:58:17 -04:00
Christian Hergert
17bcd0d127 menusectionbox: add support for "text-direction" attribute
This allows the use of a "text-direction" hint set to one of "none", "rtl",
or "ltr" to enforce the text direction of a "horizontal-buttons"
display-hint.

This is useful when a menu has buttons that map to physical space in the
UI and therefore must match the application widgetry.

https://bugzilla.gnome.org/show_bug.cgi?id=772775
2016-10-14 10:44:57 -04:00
Alan Jenkins
45528cf5b5 scrolledwindow: fix leak of pan_gesture
https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:52:00 -04:00
Alan Jenkins
29fbeea84d headerbar: fix leak of label_sizing_box
Since the widget is not added to a container, we have the responsibility
to sink the initial floating reference, and ultimately to unref it.

https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:51:55 -04:00
Alan Jenkins
3eb53e9e7c headerbar: fix leak of separator
https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:51:48 -04:00
Alan Jenkins
b3af460860 headerbar: fix leak of start_box/end_box
gtk_widget_destroy() removes widgets from their container.  However
_internal_ widgets must be unref'ed using gtk_widget_unparent() instead.
This is symmetric with the fact that these widgets were ref'ed by direct
call to gtk_widget_set_parent().  It's also the method that was used in
gtk_headerbar_destroy().

https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:51:42 -04:00
Alan Jenkins
4100a848a7 shortcutsgroup: fix leak of title
like previous commit, albeit simpler this time

https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:51:35 -04:00
Alan Jenkins
e2f5425a1d applicationwindow: fix leak of help_overlay
> Due to Gtk+ keeping a reference to the window internally,
> gtk_window_new() does not return a reference to the caller.
> To delete a GtkWindow, call gtk_widget_destroy().

Caller(s) aren't expecting a need to delete help_overlay themselves
once they've installed it.  (E.g. see gtk_application_window_added()).

I didn't notice any direct precedents, but there's a parallel in the
current implementation of gtk_container_destroy() which uses
gtk_widget_destroy() on any added widget.

This avoids leaking 100s of kB per window, when I tested nautilus.

https://bugzilla.gnome.org/show_bug.cgi?id=772859
2016-10-13 09:51:13 -04:00