Commit Graph

47568 Commits

Author SHA1 Message Date
Christian Hergert
8fc11ef2a5 Revert "iconhelper: check if surface was invalidated"
This reverts commit 88d0258397.
2016-04-27 19:02:25 -07:00
Руслан Ижбулатов
96c18db0da GtkTreeView: change child repositioning to preserve locality
If there was a piece of text in the cell, then when the edit
entry is shown for that cell, it should have a piece of text
in it roughly at the same location.

Therefore, when child widget is enlarged (child preferred
size exceeds cell size), extra width should be added by
extending either left or right edge depending on text direction.

If after that the child sticks outside of the treeivew visible region,
try to push it back inside (breaking its alignment with the
cell), again, giving preference (i.e. adjusting it last)
to either left or right edge depending on text direction.

https://bugzilla.gnome.org/show_bug.cgi?id=765471
2016-04-28 01:35:46 +00:00
Christian Hergert
88d0258397 iconhelper: check if surface was invalidated
Fetching the style may cause the surface to be invalidated.
2016-04-27 17:45:01 -07:00
Balázs Meskó
055ce9f095 Updated Hungarian translation 2016-04-27 19:32:14 +00:00
Daniel Mustieles
25c38df30e Updated Spanish translation 2016-04-27 21:07:11 +02:00
Lapo Calamandrei
0d55542359 Adwaita: add a background to cellrendertext 2016-04-27 20:05:44 +02:00
Matthias Clasen
d0c4747bd3 3.21.1 2016-04-27 13:36:26 -04:00
Matthias Clasen
46abbfebe2 Updates 2016-04-27 13:36:26 -04:00
Daniel Stone
210a747ff0 wayland: Ignore NoSymbol keys
NoSymbol is not a valid GDK symbol (it only has the concept of
VoidSymbol, for some reason, which is neither the same thing nor
produced by any sane keymap). Passing NoSymbol events through to GTK+
apps is unlikely to produce anything useful.

In particular, this meant VTE would scroll to the end of the buffer when
pressing Fn (required for Page Up/Down on Macs), as it was receiving a
keypress that wasn't a modifeir. This does not happen on X11, as the
KEY_FN keycode is above 255, so does not get sent to clients.

https://bugzilla.gnome.org/show_bug.cgi?id=764825
2016-04-27 14:00:30 +01:00
Georges Basile Stavracas Neto
605e205584 placesview: update a leftover function name
This should've been part of the previous commit.
2016-04-27 09:06:46 -03:00
Georges Basile Stavracas Neto
bb8b459407 placesview: follow up fixes
This patch unmarks the addresses' prefixes as translatable,
and updates the callback name to reflect what it really does
now.

This is a follow up fix from commit 7449add82.

https://bugzilla.gnome.org/show_bug.cgi?id=756570
2016-04-27 08:40:19 -03:00
Carlos Garnacho
14967d8d7d wayland: Perform seat grab focus checks on native windows
We don't care about the specific (possibly client-side) window that
requested the focus here, only the toplevel. Fixes mistakenly sent
focus events when the grab happens inside the current focus window.

https://bugzilla.gnome.org/show_bug.cgi?id=762756
2016-04-27 13:29:19 +02:00
Christian Hergert
0763a027c7 pixelcache: reuse existing timeout source when possible
This avoids the g_source_remove(), g_source_destroy(),
g_timer_source_new(), and g_source_set_name_by_id() in the common case.

Instead, we reuse our previous source and update the ready time to our
new deadline. We lose the coalescing with g_timeout_add_seconds(), but
that is not going to help in the common case anyway (unless you have
three hands and can scroll multiple pixelcached backed widgets at once).

https://bugzilla.gnome.org/show_bug.cgi?id=765640
2016-04-27 06:26:42 -04:00
Daniel Mustieles
060c7d5c18 Updated Spanish translation 2016-04-27 07:47:56 +00:00
Matthias Clasen
1d35f273d6 dnd: Fix some issues with drag icons
In non-composited environments, we were ending up with all-black
drag icons, because nothing was drawing the background of our new
toplevel. Fix this by drawing background when we are not composited.
We don't do this when composited, since we want to allow transparent
icons.
2016-04-26 22:02:34 -04:00
Matthias Clasen
012904097a Fix indentation 2016-04-26 21:25:02 -04:00
Matthias Clasen
23df86e923 dnd: Set attributes from all widgets for text drag icons
There is nothing textview-specific here.
2016-04-26 21:23:45 -04:00
Georges Basile Stavracas Neto
7449add82b placesview: provide guidance on server addresses
GtkPlacesView currently provides no example of
server addresses, which may confuse users.

To fix that, add a helper popover with some
guidance on server addresses.

https://bugzilla.gnome.org/show_bug.cgi?id=756570
2016-04-26 20:50:45 -04:00
Matthias Clasen
dfdc7c3e0d progressbar: Enforce invariants
When measuring gadgets, minimum must come out <= natural.
Make sure we don't fail this when measuring progressbar text.

https://bugzilla.gnome.org/show_bug.cgi?id=765644
2016-04-26 20:44:07 -04:00
Matthias Clasen
c27c4e2048 dnd: Fix lifecycle issues with widgets as drag icons
The documentation clearly says that the widget is not destroyed,
but we were in fact failing to keep it alive, since it was still
a child or the icon_window when we destroy that. Fix this by
reparenting the icon_widget out before. Also, deal with the
possibility that the application might destroy the widget
halfway through, for whatever reason.
2016-04-26 20:35:25 -04:00
Matthias Clasen
e0e114fddb testdnd2: Actually test gtk_drag_set_icon_widget
I added a new test function, but didn't actually use it.
No wonder I couldn't reproduce the lifecycle issues with
drag widgets that firefox is experiencing.
2016-04-26 20:34:24 -04:00
Bernhard Reutner-Fischer
5a04edc57b docs: typo in GTK_STYLE_CLASS_LIST_ROW docs
Fix typo in documentation of GTK_STYLE_CLASS_LIST_ROW: s/rowss/rows/g

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=765632
2016-04-26 16:41:52 -04:00
Jonas Ådahl
1a4f000f3b gdk/dnd: Don't use default display when getting cursor
Always associate a drag context with a GdkDisplay and use that when
getting a cursor for a given action.

If we don't do this, dragging on a window that doesn't use the default
display will make us use cursors from the wrong display.

https://bugzilla.gnome.org/show_bug.cgi?id=765565
2016-04-26 23:03:24 +08:00
Christian Hergert
f27dd21426 frametimings: reuse previous frame timing in common case
Typically, there won't be any references on old frame timings except for
the most recent timing. So instead of discarding these and re-entering
gslice twice, just steal the old frame timing and reuse it.

https://bugzilla.gnome.org/show_bug.cgi?id=765592
2016-04-26 09:06:07 -04:00
Jonas Ådahl
8f64e4a8e3 gdk/dnd: Add missing signal parameter documentation
The cancel reason parameter was missing.

https://bugzilla.gnome.org/show_bug.cgi?id=765577
2016-04-26 20:40:47 +08:00
Jonas Ådahl
145b626c2f wayland: Track orphaned dialogs per display
Don't track all orphaned dialogs globally, as mixing them up with each
other would in most cases trigger errors when we try to pass bogus
values to Wayland requests.

https://bugzilla.gnome.org/show_bug.cgi?id=765474
2016-04-26 08:38:18 -04:00
Jonas Ådahl
cb73becfb4 wayland: Clean up naming of GdkWaylandDisplay pointers
The naming of pointers to GdkWaylandDisplay's were inconsistent.
Running the following commands in gtk+/gdk/wayland illustrate the
inconsistency:

$ grep -r '\<display_wayland\>' *.[ch] | wc -l
195
$ grep -r '\<wayland_display\>' *.[ch] | wc -l
81

This patch renames all occurrences of "wayland_display" to
"display_wayland". This is also consistent with naming in the X11
backend. A couple of whitespace changes were done as well in places
where the rename was already done, that added line breaks to long lines
that stood out.

https://bugzilla.gnome.org/show_bug.cgi?id=765474
2016-04-26 08:38:18 -04:00
Chun-wei Fan
7700243bd4 gdk/gdkglcontext.c: Avoid a GCCism
Pointer arithmetic on GLvoid* (a void*) is a GCCism, so cast it to an
unsigned char*, which is the type cairo_image_surface_get_data() returns.
2016-04-26 20:29:23 +08:00
Chun-wei Fan
71bb1bebc0 Visual Studio builds: Generate .pc files
Generate .pc files for the package, so that it would be easier for
building introspection for packages that depend on GTK+.  Also split
PythonPath into PythonPath and PythonPathX64 to facilitate the build of
introspection files, which need to have Python that is built with the
same ac=rchitecture where GTK+ is built.

Clean up the formatting and spacing a bit.
2016-04-26 20:15:45 +08:00
Gábor Kelemen
75df7c163d Updated Hungarian translation 2016-04-26 09:43:45 +00:00
Emmanuele Bassi
0e14456f15 gdk: Ensure resources registration happens once
Like GTK does it.

https://bugzilla.gnome.org/show_bug.cgi?id=765576
2016-04-26 10:36:37 +01:00
Matthias Clasen
4fe336930e Expand the drag widget testcase
This adds a testcase which reuses the drag widget for multiple
drags.
2016-04-26 00:19:02 -04:00
Matthias Clasen
9a3e97d6f0 Updates 2016-04-26 00:07:45 -04:00
Matthias Clasen
a91fc65291 label css style test: fix font syntax 2016-04-26 00:07:01 -04:00
Matthias Clasen
2968098f74 Remove debug spew 2016-04-26 00:07:00 -04:00
Matthias Clasen
7855294594 Fix css parser tests
These tests were affected by the font and linear-gradient parsing
changes.
2016-04-26 00:03:09 -04:00
Matthias Clasen
3fd9bda06f css: Fix printing of images
When there is only a call in a fallback image, we were errnoneously
printing out a comma before it.
2016-04-26 00:03:09 -04:00
Matthias Clasen
0eefe81f37 Raleigh: Fix font syntax 2016-04-25 23:25:55 -04:00
Matthias Clasen
db1a39a817 notify test: Skip GtkFontButton::font-name
This is not freely settable.
2016-04-25 23:09:19 -04:00
Matthias Clasen
43312bb8c2 font button: Fix translation of font-name default
The default value should come out of regular translations, not
property translations.
2016-04-25 23:09:19 -04:00
Christian Hergert
724d3be794 wayland: avoid jitter in keyboard repeat
When synthesizing keyboard repeat, we can potentially drift further from
the mark depending on the timing of the frame callback and how long it
took to deliver the event.

This patch attempts to reduce this by tracking from a stable epoch the
time of our next keyboard repeat.

https://bugzilla.gnome.org/show_bug.cgi?id=765567
2016-04-25 18:15:24 -07:00
Timm Bäder
1951642c0e GtkLabel: Use g_clear_object
https://bugzilla.gnome.org/show_bug.cgi?id=765496
2016-04-25 20:37:56 -04:00
Timm Bäder
be5a105f2e GtkLabel: Don't manually iterate over link list
There are various functions to access links based on their index for
a11y. We can spare quite a few lines of code by just using
g_list_nth_data instead of iterating over the list ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=765496
2016-04-25 20:37:56 -04:00
Christian Hergert
f165bbda57 builtinicon: avoid calculating font-metrics in vast majority of cases
We perform lots of gadget allocations that require allocating a
GtkBuiltinIcon. One notable example is the scrollbar for a scrolled
window.

In the process of doing this, we often calculate baseline information that
isn't necessary. With how much this code path gets exercised, its worth
catching the result for the common case, which is that the font-description
has not changed and we are using the default language the application
was started with.

This simply caches the previous result and verifies that we can reuse it
with pango_font_description_hash() and a simple language check.

Numbers below are scrolling through a textview with GDK_KEY_Down.

Before:
      SELF CUMULATIVE    FUNCTION
[   0.08%] [   9.26%]    gtk_builtin_icon_get_preferred_size
[   0.01%] [   8.82%]      pango_context_get_metrics
[   0.02%] [   0.16%]      gtk_widget_get_pango_context
[   0.06%] [   0.06%]      pango_context_get_language
[   0.01%] [   0.02%]      g_type_check_instance_cast
[   0.02%] [   0.02%]      strlen
[   0.02%] [   0.02%]      pango_context_get_font_description
[   0.02%] [   0.02%]      g_list_foreach
[   0.01%] [   0.01%]      gtk_css_style_get_value
[   0.01%] [   0.01%]      itemize_with_font
[   0.01%] [   0.01%]      pango_context_get_type
[   0.01%] [   0.01%]      get_base_metrics
[   0.00%] [   0.01%]      pango_font_metrics_unref
[   0.01%] [   0.01%]      g_list_free
[   0.01%] [   0.01%]      gtk_builtin_icon_get_type

After:
      SELF CUMULATIVE    FUNCTION
[   0.08%] [   0.18%]    gtk_builtin_icon_get_preferred_size
[   0.02%] [   0.02%]      pango_font_description_hash
[   0.00%] [   0.02%]      gtk_widget_get_pango_context
[   0.00%] [   0.02%]        g_object_get_qdata
[   0.00%] [   0.02%]          g_datalist_id_get_data
[   0.02%] [   0.02%]      gtk_builtin_icon_get_type
[   0.01%] [   0.01%]      pango_context_get_font_description
[   0.00%] [   0.01%]      - - kernel - -
[   0.01%] [   0.01%]      pango_context_get_language
[   0.00%] [   0.01%]      gtk_css_style_get_value
[   0.00%] [   0.01%]      gtk_css_gadget_get_style

https://bugzilla.gnome.org/show_bug.cgi?id=765486
2016-04-25 16:13:06 -04:00
Emmanuele Bassi
414e86fb95 docs: Add new GtkGLArea symbols 2016-04-25 14:35:03 +01:00
Emmanuele Bassi
044b5aa3d2 docs: Add new GdkGLContext symbols 2016-04-25 14:35:03 +01:00
Emmanuele Bassi
79a7e881b1 docs: Clarify the platform-dependency of GdkGLContext:use-es
Not all platforms allow creating an OpenGL ES context.
2016-04-25 14:35:02 +01:00
Emmanuele Bassi
b45c7b508b glarea: Use the appropriate texture format for GLES
The core OpenGL ES spec does not have GL_BGRA, so we need to make do
with GL_RGBA and live with the format conversion.
2016-04-25 14:35:02 +01:00
Emanuele Aina
971998de34 glarea: Relay the use-es flag to context creation
https://bugzilla.gnome.org/show_bug.cgi?id=743746
2016-04-25 14:35:02 +01:00
Emmanuele Bassi
872b5115ea demo: Add GLES support to the GtkGLArea demo
We need new shaders, and we need to select the correct shader when
building the program we use to render the triangle.
2016-04-25 14:35:02 +01:00