Commit Graph

49940 Commits

Author SHA1 Message Date
Daniel Boles
494a38504b 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:45:32 +00:00
Daniel Boles
0776bd438b 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:56 +00:00
Daniel Boles
d9dd312752 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:56 +00:00
Daniel Boles
e4ede33a65 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:24:24 +00:00
Daniel Boles
7a5c995fd4 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:24:24 +00:00
Daniel Boles
2e973cedc9 combobox: Move variables into narrowest scopes 2017-01-18 22:24:24 +00:00
Dušan Kazik
0a0401cce3 Update Slovak translation 2017-01-18 20:50:55 +00:00
Benjamin Otte
ee9828d49c vulkan: Fix copy/paste error 2017-01-18 16:46:04 +01:00
Benjamin Otte
12637195de vulkan: Add compiled shaders
I forgot to include them when adding the shaders.
2017-01-18 16:42:01 +01:00
Benjamin Otte
cde933ebd9 vulkan: Compute right size for outset shadow
We were emitting the box and not the shadow box as the rectangle. So we
didn't draw any shadows. Oops.
2017-01-18 16:39:27 +01:00
Benjamin Otte
fb47a8d714 css: Remove deprecated number-as-pixels compatibility
Previously, for compatibility with GTK 3.0, we allowed specifying
numbers without units and interpreted them as pixels, even when the CSS
specification didn't.

Remove that now that we can break API.
2017-01-18 04:13:56 +01:00
Benjamin Otte
bd24ca5b18 vulkan: Add support for unblurred box-shadow 2017-01-18 04:13:56 +01:00
Benjamin Otte
84c1204853 rendernode: Add getters for box-shadow nodes 2017-01-18 04:13:56 +01:00
Benjamin Otte
2ae6f59e7a docs: Remove mention of GdkColor 2017-01-18 04:13:56 +01:00
Matthias Clasen
95834ad1e1 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:14:44 -05:00
Matthias Clasen
4875c689a0 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:09:55 -05:00
Rui Matos
7a1b30f16e gdk/wayland: Always get the seat's key modifiers from the GdkKeymap
Elsewhere we already go through the keymap to get modifiers so we
should do the same here. In fact, this was relying on xkb modifier
mask values being bitwise compatible with GdkModifierType which isn't
necessarily true.

https://bugzilla.gnome.org/show_bug.cgi?id=770112
2017-01-17 18:24:28 +01:00
Rui Matos
515b71f14c gdk/wayland: Don't add GDK_META_MASK to gdk mod masks if MOD1 is set
Gtk+ treats MOD1 as a synonym for Alt, and does not expect it to be
mapped around, so we should avoid adding GDK_META_MASK if MOD1 is
already included to avoid confusing gtk+ and applications that rely on
that behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=770112
2017-01-17 18:24:28 +01:00
Jonas Ådahl
7ca6d7585f wayland: Handle subsurface as popup parent
When a subsurface is used as a parent of a popup, GDK needs to traverse
up to the transient-for as the next parent, to properly find the parent
used by the popup positioner. This is because the parent of a popup
must always either be an xdg_popup or an xdg_surface, but traversing
the "parent" (in GDK terms) upwards from a subsurface will end up on
the fake root window before we hit the actual parent (in Wayland terms).

https://bugzilla.gnome.org/show_bug.cgi?id=776225
2017-01-17 09:02:41 +01:00
Benjamin Otte
01d16524da vulkan: Add fallback message for node-as-texture
This is mainly to motivate me to implement it.
2017-01-17 06:38:36 +01:00
Benjamin Otte
6bec7aae89 vulkan: Generate clip shaders from same source
Instead of having 3 different shaders for the different clipping
versions, just have one shader and use a preprocessor define to use
different clip functions.

That preprocessor define is set in the Makefile.

Also use foo.frag and foo.vert as the file extensions instead of using
foo.frag.glsl and foo.vert.glsl, as that's what glslc suggests as
extension.
2017-01-17 06:17:55 +01:00
Benjamin Otte
3768c676c6 vulkan: Add clip.vert.glsl
Implement clipping the same way as in the last commit for the
fragment shaders.
2017-01-17 06:17:55 +01:00
Benjamin Otte
cf65443fb3 vulkan: Add a clip.frag.glsl include
This include is supposed to handle clipping for the different clipping
methods.

So far, we only use it in the rounded rect cases.
2017-01-17 06:17:55 +01:00
Benjamin Otte
6a60e335cd vulkan: Add push constants to fragment shader
That way we don't need to move the clip rounded rect manually through
the vertex shader into the fragment shader but can just look at the push
constants.

Simplifies shaders a lot.
2017-01-17 06:17:55 +01:00
Benjamin Otte
c7d899c535 vulkan: Move push constants into their own header
This is the first step towards easing maintenance of the Vulkan shaders
by moving common code into headers.
2017-01-17 06:17:55 +01:00
Mohammed Sadiq
8ffecabd93 wayland: avoid an unnecessary g_list_length call
https://bugzilla.gnome.org/show_bug.cgi?id=777363
2017-01-16 21:42:05 -05:00
Matthias Clasen
f21827eb22 3.89.3 2017-01-16 17:50:02 -05:00
Matthias Clasen
cfb599bf67 We no longer have gdktestutils
Update the docs build to reflect that.
2017-01-16 17:50:02 -05:00
Daniel Mustieles
a514faa074 Updated Spanish translation 2017-01-16 21:33:24 +01:00
Daniel Mustieles
ff4c05532b Updated Spanish translation 2017-01-16 21:33:13 +01:00
Timm Bäder
239f14cc96 switch: Fix build
Partial revert of 2b6b5c1c8f, which
removed a little too much.
2017-01-16 21:01:59 +01:00
Timm Bäder
2b6b5c1c8f switch: Remove some unused code 2017-01-16 18:17:28 +01:00
Timm Bäder
ca889b6e21 gtkentryprivate: Remove unused prototype 2017-01-16 17:23:01 +01:00
Timm Bäder
28a3dd539d scalebutton: Use GtkButon:icon-name in the ui file 2017-01-16 17:22:53 +01:00
Timm Bäder
3cfcbe2ccf spinbutton: Restore gtk3 focus behavior
Focus the spinbutton on button press, never focus the buttons.
2017-01-16 17:22:45 +01:00
Timm Bäder
132f2721ce inspector: Use GtkButton:icon-name in ui files 2017-01-16 17:22:38 +01:00
Timm Bäder
f4afa000a1 entry: Remove unused struct member 2017-01-16 17:22:29 +01:00
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