Commit Graph

50003 Commits

Author SHA1 Message Date
Timm Bäder
32783a8187 gtk4-section: Add GtkInfoBar:revealed setter+getter 2017-01-16 17:22:11 +01:00
Olivier Fourdan
4259aba883 wayland: avoid 0 width/height anchor rectangle
Passing a rectangle with zero width or height to xdg_shell-v6
set_anchor_rect() will cause a protocol error and terminate the client,
as with gedit when pressing the Win key.

Reason for this is because the rectangle used to set the anchor comes
from gtk_text_layout_get_iter_location() which uses the pango layout
width/height, which can be empty if there is not character at the given
location.

Make sure we don't use 0 as width or height as an anchor rectangle to
avoid the protocol error, and compensate the logical position of the
given rectangle if the size is changed, so that the actual position
remains as expected by the client.

https://bugzilla.gnome.org/show_bug.cgi?id=777176
2017-01-16 13:55:51 +01:00
Chun-wei Fan
f2ee8f4342 Visual Studio builds: Update gsk project
Another Vulkan renderer source was added, so include them in the builds.
2017-01-16 13:47:21 +08:00
Daniel Boles
5e816f7283 grid: Fix plural error in docs' @Short_description 2017-01-15 20:37:49 +00:00
Jordi Mas
b373512523 Update Catalan translation 2017-01-15 20:18:08 +01:00
Benjamin Otte
87497ca2e1 snapshot: Rename gtk_snapshot_translate_2d()
It's now called gtk_snapshot_offset().
2017-01-13 14:37:48 +01:00
Jordi Mas
fc94ee99e8 Update Catalan translation 2017-01-13 06:51:42 +01:00
Benjamin Otte
6055028c96 snapshot: Rename append APIs
Instead of having gtk_snapshot_append_foo_node(), just have
gtk_snapshot_append_foo(). Nobody needs to know that this internally
uses nodes.
2017-01-13 04:46:09 +01:00
Benjamin Otte
e5e5beafa5 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:38:36 +01:00
Benjamin Otte
a06b1ea1ba 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:38:36 +01:00
Benjamin Otte
b58de2d16c snapshot: Redo pop() API
gtk_snapshot_pop() => removed
gtk_snapshot_pop_and_append() => gtk_snapshot_pop()

So now there is no way to get a rendernode out of the snapshotting API
until you gtk_snapshot_finish().
2017-01-13 03:38:36 +01:00
Benjamin Otte
bc3ba68641 snapshot: Add gtk_snapshot_push_blend()
and use it for backgrounds.
2017-01-13 03:38:36 +01:00
Benjamin Otte
9616df9292 reftests: Fix test
No, GtkActions don't need to be part of this test.
2017-01-13 03:38:36 +01:00
Benjamin Otte
4668e6dc63 stack: Build stored render node with custom Snapshot object
This is in preparation for API changes in GtkSnapshot.
2017-01-13 03:38:36 +01:00
Benjamin Otte
d9b0685b49 Add gtk_snapshot_push_cross_fade()
... and use it.

The function is a bit awkward because it requires 2 calls to
gtk_snapshot_pop(), but once you accept that, it's very convenient to
use, as can be seen by the 2 implementations.
2017-01-13 03:38:36 +01:00
William Hua
670ae58cc9 mir: use modal window hint 2017-01-12 17:24:19 -05:00
Matthias Clasen
b355c80977 widget-factory: Add a system tab to the about dialog
Just for trying it out.
2017-01-12 15:30:11 -05:00
Matthias Clasen
3024956df1 about dialog: Add a "system" tab
This is a free-form tab that can contain information about the
system environment. To see it, set GtkAboutDialog::system-information
to a non-NULL value.

https://bugzilla.gnome.org/show_bug.cgi?id=776604
2017-01-12 15:29:56 -05:00
Timm Bäder
e08918cce0 actionbar: Notify when :revealed changes 2017-01-12 15:14:25 +01:00
Timm Bäder
db12128d35 infobar: Fix copy&paste error in documentation
Of course you shouldn't call gtk_dialog_response on a GtkInfoBar.
2017-01-12 09:18:55 +01:00
Timm Bäder
58c252d5e6 infobar demo: Adapt to GtkInfoBar changes
Bind GtkToggleButton:active to GtkInfoBar:revealed instead of :visible.
2017-01-12 09:18:52 +01:00
Timm Bäder
1bb4f1e9d9 infobar: Add :revealed property 2017-01-12 09:16:02 +01:00
Timm Bäder
e3871c4424 infobar: Keep GParamSpecs around
So we can use them in notify_by_pspec
2017-01-12 09:13:38 +01:00
Benjamin Otte
d54117024c x11: Add call to XInitThreads()
The Mesa Vulkan drivers need XInitThreads() being called, because their
implementation has to use threads.

And I don't want to make the call depend on if Vulkan is compiled in
because that makes GTK's X11 behavior depend on compile-time flags, so
it's always called.
2017-01-12 02:01:07 +01:00
Matthias Clasen
0868757cfd More filter documentation updates
Actually document the filter property, not just -gtk-icon-filter.
2017-01-11 14:07:56 -05:00
Matthias Clasen
5f2a7ed3c1 Correct the -gtk-icon-filter docs
I was overlooking that it is possible to specify multiple
functions. Also add a reference to the relevant spec draft.
2017-01-11 13:42:58 -05:00
Benjamin Otte
10bc71a5e6 build: List resource files explicitly
This way, we ensure that files that are built during make always get
properly listed. And we ensure that creating the resources actually
depends on them.
2017-01-11 18:33:09 +01:00
Benjamin Otte
b8371a1d61 shortcutswindow: Make dispose work properly 2017-01-11 18:33:09 +01:00
Benjamin Otte
fd762d203c tests: Add a rendernode test for borders 2017-01-11 18:33:09 +01:00
Benjamin Otte
b186bce7ff vulkan: Add shader for border rendering 2017-01-11 18:33:09 +01:00
Alexander Larsson
c00f8dce9f GtkSnapshot: Always use int for the translation
We already take ints when setting the translation, so it can't
currently take any other values. Additionally, I was seeing large
costs in int -> double -> int for the rects in
gtk_snapshot_clips_rect(), as all callers really are ints (widget
allocations) and the clip region is int-based.

This change completely cleared a 2% rectangle_init_from_graphene from
the profile and is likely to have nice performance effects elsewhere
too.
2017-01-11 16:14:03 +01:00
Alexander Larsson
275185d415 widget: Avoid typechecks when accessing ->clip and ->allocation 2017-01-11 15:30:30 +01:00
Alexander Larsson
8cabfef9c9 GtkCSSImage: Avoid some type checks
The width/height/aspect getters are called a lot, and almost all
callers already verify it from _gtk_css_image_get_concrete_size (),
so just skip these checks.
2017-01-11 15:28:35 +01:00
Alexander Larsson
7bee22bcb6 Avoid some more type checks for internal calls 2017-01-11 15:27:51 +01:00
Alexander Larsson
68a27a9951 gtkcssgadget: Use private non-checking versions of gtk_widget calls
This avoids a lot of checking overhead.
2017-01-11 12:05:44 +01:00
Alexander Larsson
6341fab985 GtkSnapshot: Reuse snapshot state objects
Rather than allocate new ones all the time we reuse the previous ones.
We just clear them and save them in the parent for later reuse.
2017-01-11 11:41:46 +01:00
Alexander Larsson
f67ae85b7a GtkSnapshot: Move collect data to a union in the state
This means we allocate the collect data with the state, avoiding
an extra allocation. Also, a union means every state object
is the same size and we could reuse the state objects.
2017-01-11 11:21:27 +01:00
Alexander Larsson
65ad2541d7 Snapshot: Only record names if inspector is recording
Otherwise we do a lot of allocations and vprintf calls which are
not used.
2017-01-11 10:22:40 +01:00
Alexander Larsson
2f453cc57e gsk_rounded_rect_init_copy: Don't normalize
This was showing up quite high on the profiles, and there is
no real reason for copy to normalize, as the source is a
GskRoundedRect which should be normalized already unless
you did something very strange (and then you should have normalized
manually).
2017-01-11 09:23:37 +01:00
Alexander Larsson
882290b479 Skip dynamic type check in css value getters
This gets called a lot during snapshotting, and this change
alone brings down snapshot time by almost 10% in a syntethic
snapshot test.
2017-01-11 09:20:30 +01:00
Matthias Clasen
249a0b1f22 Some updates to the migration guide 2017-01-10 21:21:26 -05:00
Matthias Clasen
8a83362fb8 Document -gtk-icon-filter
Not much detail here yet, but the syntax is documented.
2017-01-10 21:21:26 -05:00
Benjamin Otte
4c7ddbf519 cssimage: Fix cross-fade
Simgle image cross-fade opacity was computed the wrong way, which caused
weird fade-in/out animations, for example in flat buttons.

I messed this up when porting cross-fades to snapshot().
2017-01-11 02:53:12 +01:00
Matthias Clasen
9133ec5cd4 Remove an unnecessary check
Since the demise of theme engines, we can no longer hit
the case of id >= GTK_CSS_PROPERTY_N_PROPERTIES. So don't
check for this in a very frequently called function.
2017-01-10 19:56:21 -05:00
Matthias Clasen
c1dc36dff0 Use an internal parameter check here as well
We should not slow down the core parts of the css machinery
with type checks.
2017-01-10 19:56:16 -05:00
Matthias Clasen
ecd0ce3993 Use gtk_internal_return_val_if_fail here
It seems odd to have checks in just a few functions,
so switch everything over to use the internal versions.
2017-01-10 19:56:09 -05:00
Matthias Clasen
a013a16d1c Use _gtk_widget_get_window more
This avoids type checks in places where we know it is safe.
2017-01-10 19:56:02 -05:00
Matthias Clasen
d9bc675cba Refactor some css transition code slightly
Reshuffling things a bit to avoid a bunch of NULL and
type checks.
2017-01-10 19:55:57 -05:00
Matthias Clasen
4f0cf475a5 Use the .symbolic.png assets in Adwaita
Using an image() fallback from svg to png doesn't make too
much sense, since the svg is always used (unless librsvg is
not present), while the png icon is faster and cheaper to
load and thus preferable.
2017-01-10 17:16:10 -05:00
Rui Matos
ae61220c9f gdk/wayland: Handle non-existant gsettings keys
Since we're a library, crashing on gsettings keys, whose presence is out
of our control, isn't appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=775846
2017-01-10 15:17:32 +01:00