Commit Graph

54933 Commits

Author SHA1 Message Date
Piotr Drąg
bef44a0c9d Update Polish translation 2018-04-22 16:13:56 +02:00
Ting-Wei Lan
43a7f36993 gtk-demo, testgtk: Don't pass an integer to fabs
It looks like a mistake which compilers are likely to warn.
2018-04-22 21:59:13 +08:00
Ting-Wei Lan
d3f40dc771 imcontextxim: Don't assign a variable to itself
This causes clang to show warnings.
2018-04-22 21:57:10 +08:00
Ting-Wei Lan
77637dc73b Fix header guards
They were found by clang.
2018-04-22 21:57:10 +08:00
Ting-Wei Lan
ff1dd5009c build: Use cc.links to check linker arguments
Instead of hard-coding linker flags for a specific operating system and
a specific compiler, we can should cc.links to test them, so they can be
used on more operating systems and compilers.
2018-04-22 21:57:10 +08:00
Ting-Wei Lan
f922109a9c build: Make the default setting work on non-Linux Unix-like systems
All of the four platform-dependent backends are enabled by default. It
is usually a good default because it requires users to explicitly choose
backends they want to use. Rules in meson.build also automatically
disable unavailable backends for macOS, Windows, Linux, so users on
these 3 major platforms don't have to manually disable things when
running meson commands.

However, meson.build doesn't do the same thing for other Unix-like
systems, which is acceptable but not ideal. To make it easier to build
GTK+ on these systems, the Linux case, which enables X11 and Wayland and
disables Win32 and Quartz, is made the default for all operating systems
that are not Windows or macOS.

This commit also changes most 'host_machine.system()' calls to os_*
variables, which are easier to read and less likely to be used wrongly.
2018-04-22 21:57:10 +08:00
Benjamin Otte
7a09cd4cda widget: Position changes don't require a redraw
Well, they don't require a redraw of the widget, because the widget
itself didn't change.
They require a redraw of the parent, because that now displays the
widget in a different position.

And this means we can keep the cache of the widget's render node.

My fishbowl numbers are through the roof^W water surface. Vulkan gets
4000 now.
2018-04-22 02:57:47 +02:00
Benjamin Otte
c5bcc47ce7 demo: Don't add more icons all the time
If adding new icons takes longer than a second, the frame clock should
run before we add even more icons...
2018-04-22 02:57:47 +02:00
Timm Bäder
8d11e7685a build: Remove 'name' kwarg from has_function calls
They cause warnings with later meson versions.
2018-04-21 19:30:12 +02:00
Timm Bäder
f483fd539e build: Fix copy/paste error 2018-04-21 19:24:25 +02:00
Timm Bäder
5b453ecd19 Always use #ifdef for G_ENABLE_DEBUG
Release builds don't define it to 0, they just don't define it. Avoid
the compilation warning we get otherwise.
2018-04-21 19:18:20 +02:00
Timm Bäder
9b8ff8d6c3 sizerequestcache: Directly initialize some locals
Declaring them and initializing them in the same block of code without
an empty line in between is really just confusing.
2018-04-21 19:06:54 +02:00
Timm Bäder
1313234ae0 Use inlined gtk_widget_get_display version in a few places
We can safely do this whenever we already made sure that the given
pointer is a valid GtkWidget.
2018-04-21 19:06:21 +02:00
Timm Bäder
c3e02b2b22 widget: Add static inline version of gtk_widget_display()
Due to the few type checks in gtk_widget_get_display(), it was the
slowest part of a call to gtk_widget_query_size_for_orientation if the
in case of a cache hit.
2018-04-21 18:48:15 +02:00
Timm Bäder
1a24a360bd textview: Remove handling_key_event flag
It's not used anymore.
2018-04-21 15:45:47 +02:00
Timm Bäder
4f3c7cd48a gsk: Make gsk_text_node_new_with_bounds private
We pulled out the bounds calculation for performance reasons, but the
caller can't know how to properly compute them. Inside gtk+, we can do
that but it's not good enough for public API.
2018-04-21 11:20:15 +02:00
Timm Bäder
d74be1fcf0 gl renderer: Rename texture_id parameter to fbo_id
So this makes sense again.
2018-04-21 10:13:16 +02:00
Timm Bäder
ac268b1c5d widget: Use get_instance_private more often
To be more consistent with newer code. We can also save a few lines here
and there by pulling the priv initialization before the precondition
checks.
2018-04-21 10:06:57 +02:00
Timm Bäder
fae1bbb3fe sizerequestcache: Constify some locals
Make it clear that we only use them for lookups here.
2018-04-21 10:06:57 +02:00
Timm Bäder
bd855c11ab sizerequestcache: Use int instead of gint 2018-04-21 10:06:57 +02:00
Timm Bäder
bb412cdda1 sizerequest: Pull locals in closest scope 2018-04-21 10:06:57 +02:00
Timm Bäder
840504b60a snapshot: Fix some documentation problems 2018-04-21 10:06:57 +02:00
Timm Bäder
c948c9e51d viewport: Remove useless import
Just a debugging remnant
2018-04-21 10:06:57 +02:00
Timm Bäder
746c9dc278 viewport: Remove outdated comment 2018-04-21 10:06:57 +02:00
Timm Bäder
29f38056a9 gl renderer: Fix fallback node scaling 2018-04-21 10:06:57 +02:00
Matthias Clasen
cfa04805a3 Merge branch 'print-deserialize' into 'master'
printing: Be more careful when deserializing

See merge request GNOME/gtk!121
2018-04-20 21:37:13 +00:00
Matthias Clasen
6f4a77bb3c printing: Be more careful when deserializing
The GVariant we are getting here might not be coming
from GTK+, but rather from some other source. Best to
be forgiving and deal with missing data without crashing.

This was causing the GTK+ portal backends to crash on
print requests from Qt.
2018-04-20 16:58:36 -04:00
Daniel Mustieles
09037b261e Updated Spanish translation 2018-04-20 11:42:22 +02:00
Daniel Mustieles
9d746d4ec4 Revert "Update Spanish translation"
This reverts commit 8570d33e08.
2018-04-19 16:13:15 +02:00
Marco Trevisan (Treviño)
c15b64b720 stack: protect set_visible_child_name from NULL stack
Return with error if gtk_stack_set_visible_child_name is called
with NULL parameter


(cherry picked from commit 2ee5aee4a9)
2018-04-19 08:40:17 +00:00
Emmanuele Bassi
e30176a522 Merge branch 'gtkplacesview-finalization-fixes-master' into 'master'
Gtkplacesview finalization fixes

See merge request GNOME/gtk!119
2018-04-19 08:24:49 +00:00
Marco Trevisan (Treviño)
4900c3eb3b gtkplacesview: disconnect from server list monitor changes on destroy
It might happen otherwise that a change is recorded in between the
widget dispose and finalization, causing a crash when setting
the visible name for the GtkStack (as that will be NULL at that point)
2018-04-19 02:59:52 -05:00
Marco Trevisan (Treviño)
f9452957cd gtkplacesview: unset entry_pulse_timeout_id before removing it
Fixes a warning on widget finalize, when trying to remove an invalid
source.
2018-04-19 02:59:43 -05:00
Daniel Boles
06a1477f80 Scale: Document new optional classes on value node 2018-04-18 22:59:19 +01:00
Daniel Boles
45c8c8f934 Range: Make down/up keys act like down/up scrolls
Before now, down/up keys on H Ranges would increase/decrease value resp,
which is unintuitive & worse, contradicts what we already do for scrolls

Fix simply by moving to the new should_invert_move() as scrolls just did
– which also gets us the other benefits explained in the last 2 commits.

https://bugzilla.gnome.org/show_bug.cgi?id=407242
https://bugzilla.gnome.org/show_bug.cgi?id=791802
2018-04-18 18:36:55 +01:00
Daniel Boles
6985dde320 Range: Use should_invert_move() to scroll value
This fixes RTL and/or :inverted Ranges responding to a horizontal scroll
by moving the value/slider button in the opposite direction... See prev.

https://bugzilla.gnome.org/show_bug.cgi?id=791802
2018-04-18 18:36:55 +01:00
Daniel Boles
bc2a38a59e Range: Add should_invert_move() for scrolls & keys
This will be used in subsequent commits to fix the sign by which the
value is changed in response to directional scroll or keypress events.

The idea is: you have a movement to make – in the form of a delta that
follows widget directions, i.e. −1 means left or up, +1 means right or
down – and you want to know whether that delta needs to be inverted in
order to produce the intuitively expected directional change of :value.

The existing should_invert() is not sufficient: it just determines
whether to invert visually, but we need more nuance than that for input.

To answer that – while not doubling up the work for scrolls and keys – I
add a helper should_invert_move(), which considers other relevant state:

 • A parallel movement on priv->orientation should just use the existing
   should_invert(), which already worked OK for this case (not others).

 • Movements on the other orientation now depend on priv->orientation:

    ◦ For a horizontal Range, always invert, so up (i.e. −ve in terms of
      widget coords) always means increase value & vice-versa. This was
      done in get_wheel_delta(), but move it here for use with keys too.

    ◦ For a vertical Range, ignore :invert as it’s only relevant to the
      parallel orientation. Do not care about text direction here either
      as RTL locales do not invert number lines, Cartesian plots, etc.

This returns TRUE if the delta should be inverted before applying to the
value, and we can now use this function in both scroll and key handlers.

https://bugzilla.gnome.org/show_bug.cgi?id=407242
https://bugzilla.gnome.org/show_bug.cgi?id=791802
2018-04-18 18:36:09 +01:00
Benjamin Otte
2db43edbd6 snapshot: Don't handle clip anymore
If widgets want to clip things, they now need to do it themselves.

By not taking care of clip, we avoid the need to track clip. And by not
tracking clip, we can avoid all unnecessary cache invalidations that we
were doing for render nodes whenever the clip changed.

And when you are scrolling, the clip changes *a lot*.
2018-04-17 23:21:37 +02:00
Daniel Boles
3b2a03367c MenuShell: Avoid compiler warning re un/signed cmp
priv->button is a guint, but we assigned it to a local gint.

gtk/gtkmenushell.c:734:37: warning: comparison between signed and
  unsigned integer expressions [-Wsign-compare]
           if (button && (new_button != button) && priv->parent_menu_shell)
                                     ^
2018-04-17 20:53:48 +01:00
Daniel Boles
d13e78831b Menu|Item: Fix FIXME re non-const interned strings
These are members of the private struct, so it hurts no one to fix this.
2018-04-17 20:53:48 +01:00
Daniel Boles
4fae962a03 Menu: Remove redundant typecheck in private func
Everything that calls this already ensured we are a valid GtkMenu.
2018-04-17 20:40:21 +01:00
Daniel Boles
8fd0ee96a6 Menu: Update @accel_path annotation/description 2018-04-17 20:40:21 +01:00
Daniel Boles
48472a4b04 Menu: Typecheck AccelGroup passed via public API 2018-04-17 20:40:21 +01:00
Daniel Boles
24953ab1be Menu: Typecheck before dereferencing to get ->priv 2018-04-17 20:40:21 +01:00
Daniel Boles
2a7e5d5137 MenuShell: Sanitise take_focus bool via public API
We store in priv then compare it later, so better make sure it’s 0 or 1.
2018-04-17 20:40:21 +01:00
Daniel Boles
f6ba206d07 MenuShell: Typecheck the instance @ select_first()
since this is public API and therefore might get junk passed to it.
2018-04-17 20:21:05 +01:00
Daniel Boles
331f9762cc CellRenderer: Link to CellEditable.start_editing()
...from CellRenderer::start-editing, to point people in the direction of
info about the lifecycle of the Editable and how to do generic setup.

https://gitlab.gnome.org/GNOME/gtk/issues/154
2018-04-17 19:07:39 +01:00
Daniel Boles
aaf2e30a48 CellRenderer: Clarify doc of .start_editing()
Drop the line copied from .activate(), replace it with a description of
what this method actually does, and explain what a NULL result means.

https://gitlab.gnome.org/GNOME/gtk/issues/154
2018-04-17 19:07:39 +01:00
Daniel Boles
50feed4c28 CellRenderer: Entry is not the only CellEditable
so link to GtkCellEditable and note that GtkEntry is just one example.
2018-04-17 19:07:39 +01:00
Daniel Boles
0fd9362e91 CellRenderer|Editable: Don't @See_also subclasses
The documentation knows that from the inheritance hierarchy, without us
having to manually duplicate that info here. Link to each other instead.
2018-04-17 19:07:39 +01:00