Commit Graph

47203 Commits

Author SHA1 Message Date
Benjamin Otte
1bac6684f1 cssimagebuiltin: Remove icons that don't draw anything anymore 2016-05-05 15:04:01 -04:00
Benjamin Otte
9d1a64455b cssimagebuiltin: Remove unused variables 2016-05-05 15:04:01 -04:00
Matthias Clasen
c46bfcf752 css: Stop drawing double borders for builtins
The fallback code for rendering builtin checks, radios
and expanders was using border parameters. With the generic
gadget borders using the same parameters, this was giving
double borders.
2016-05-05 15:04:01 -04:00
Timm Bäder
bab6cb6d97 shadowsvalue: Don't draw invisible box shadows 2016-05-05 15:04:01 -04:00
Matthias Clasen
f58aaf2ccf Fix gtk_paned_set_position to set position_set consistently
As pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=765676,
we were failing to set position_set if the position did not change.
2016-05-05 15:04:01 -04:00
Руслан Ижбулатов
86855f7531 GtkPlacesView: check for network:// URI support before using it
Specifically, this URI is not supported on Windows, but GFile will
do its "best" and turn it into GLocalFile("$pwd/network"), with
spectacularly bad results.

https://bugzilla.gnome.org/show_bug.cgi?id=765858
2016-05-05 15:04:01 -04:00
Carlos Garnacho
25672b7f39 gdkevents: Free motion events discarded by motion compression
Those should be freed together with their list link.
2016-05-05 15:04:01 -04:00
Matthias Clasen
1065506257 dnd: Make sure to free a stashed event
I am not sure if this happens in practice, but better to be safe.
2016-05-05 15:04:01 -04:00
Matthias Clasen
e3e84de96c gesture: Don't leak stashed events
These events were never freed.
2016-05-05 15:04:01 -04:00
Matthias Clasen
964eb99a5e Drop unused macros
These have been sitting here forever, unused. Time to drop them
2016-05-05 15:04:01 -04:00
Matthias Clasen
518023df56 x11: drop a useless list
We were keeping all the event sources in a list, only to remove
them at the end of their life. Not useful.
2016-05-05 15:04:01 -04:00
Matthias Clasen
86f197893a wayland: drop a useless list
We were keeping all the event sources in a list, only to remove
them at the end of their life. Not useful.
2016-05-05 15:04:01 -04:00
Matthias Clasen
ac26fc3be4 wayland: Tag the event source with the acutal display name 2016-05-05 15:04:00 -04:00
Matthias Clasen
4ad8436316 wayland: Make gdk_display_get_name work
It should just return the same as gdk_screen_make_display_name.
2016-05-05 15:04:00 -04:00
Matthias Clasen
631123bbd4 Use a better hash for arcs 2016-05-05 15:04:00 -04:00
Matthias Clasen
5f9a19ff33 box gadget: Redo expand flag handling
We only keep one align flag per child, so it seems odd to
keep separate h/v expand flags. Just keep one expand flag
and interpret it according to orientation. Allow setting
the expand flag for child widgets too, though, so we can
make widget expand without interfering with the recursive
widget expand flag.

Update all callers.

Use the new possibility of expanding child widgets to make
the label of check and radio buttons expand. This fixes
unexpected behavior of these widgets in RTL in some places.

https://bugzilla.gnome.org/show_bug.cgi?id=765742
2016-05-05 15:04:00 -04:00
Matthias Clasen
587308004c expander: Reverse alignments in RTL
Flip alignments of the title gadget children.
2016-05-05 15:04:00 -04:00
Matthias Clasen
2ebad7ec2b check button: Reverse alignments in RTL
Flip alignments for the box gadget children.
2016-05-05 15:04:00 -04:00
Matthias Clasen
fc04d6613a box gadget: allow reversing alignments
In RTL, we want to interpret GTK_ALIGN_START and _END
in the opposite way. Since we don't give gadgets a text
direction, just allow setting an align_reverse flag
to the box gadget.
2016-05-05 15:04:00 -04:00
Руслан Ижбулатов
515c665b7f 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-05-05 15:04:00 -04:00
Lapo Calamandrei
563add1325 Adwaita: add a background to cellrendertext 2016-05-05 15:04:00 -04:00
Daniel Stone
0e44b8c38c 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-05-05 15:04:00 -04:00
Christian Hergert
cdab14dc22 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-05-05 15:04:00 -04:00
Matthias Clasen
ab300e7de3 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-05-05 15:03:59 -04:00
Matthias Clasen
acdb9650e2 dnd: Set attributes from all widgets for text drag icons
There is nothing textview-specific here.
2016-05-05 15:03:59 -04:00
Matthias Clasen
92166f1f69 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-05-05 15:03:59 -04:00
Matthias Clasen
7054b0ccff 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-05-05 15:03:59 -04:00
Matthias Clasen
ea0d3d2a95 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-05-05 15:03:59 -04:00
Jonas Ådahl
0258c88949 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-05-05 15:03:59 -04:00
Christian Hergert
3244d7a138 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-05-05 15:03:59 -04:00
Jonas Ådahl
044e4b15a6 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-05-05 15:03:59 -04:00
Matthias Clasen
f6a5dad12c Expand the drag widget testcase
This adds a testcase which reuses the drag widget for multiple
drags.
2016-05-05 15:03:59 -04:00
Matthias Clasen
b38e4e0ac0 notify test: Skip GtkFontButton::font-name
This is not freely settable.
2016-05-05 15:03:59 -04:00
Matthias Clasen
4b4533ef68 font button: Fix translation of font-name default
The default value should come out of regular translations, not
property translations.
2016-05-05 15:03:59 -04:00
Christian Hergert
113ce66151 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-05-05 15:03:59 -04:00
Timm Bäder
021d065a1f GtkLabel: Use g_clear_object
https://bugzilla.gnome.org/show_bug.cgi?id=765496
2016-05-05 15:03:58 -04:00
Timm Bäder
db17324d82 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-05-05 15:03:58 -04:00
Christian Hergert
d505df90b0 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-05-05 15:03:58 -04:00
Paolo Borelli
db326889f9 inspector: do not leak seat capabilities descriprion
Factor out an utility function for readability and free the string
with the list of capabilities
2016-05-05 15:03:58 -04:00
Christian Hergert
6be0f108b4 kineticscrolling: avoid stutter at tail of kinetic deceleration
When decelerating the kinetic scroll, we can get into a position where it
looks like we are stuttering. This happens because the amount we move is
so little that it takes multiple frames to make forward progress by one
pixel.

This prevents that by detecting when we have reached the slow stutter of
the deceleration and simply stops the deceleration phase immediately.

https://bugzilla.gnome.org/show_bug.cgi?id=765493
2016-05-05 15:03:58 -04:00
Paolo Borelli
136409b8cd textiter: add unit test for forward_to_line_end
Surprisingly we had no unit test for this method
2016-05-05 15:03:58 -04:00
Matthias Clasen
84e0bef150 Fix formatting
The previous change was not quite using the right coding style.
2016-05-05 15:03:58 -04:00
Timm Bäder
0e002cbef0 listbox: Make sure page down/up move at least one row
When the current cursor_row is taller than the page_size we get from the
GtkAdjustment, the previous code would not actually cause any scrolling,
so make sure we just take the row after or before the cursor_row in that
case.

https://bugzilla.gnome.org/show_bug.cgi?id=765261
2016-05-05 15:03:58 -04:00
Benjamin Otte
107b5d7397 cssshadowsvalue: Avoid allocating new value if not needed 2016-05-05 15:03:58 -04:00
Benjamin Otte
8efd10c9fd cssbordervalue: Avoid allocating new value if not needed 2016-05-05 15:03:58 -04:00
Benjamin Otte
758e10ad41 cssbgsizevalue: Avoid allocating new value if not needed 2016-05-05 15:03:58 -04:00
Matthias Clasen
5d5b7c9f7f Add a dnd test using a window as icon
This case is causing problems in firefox. Lets at least make
sure that it doesn't crash in GTK+.
2016-05-05 15:03:58 -04:00
Jonathan Matthew
761f19e7d7 gtkmenusectionbox: remove submenus when the parent item is removed
https://bugzilla.gnome.org/show_bug.cgi?id=749405
2016-05-05 15:03:58 -04:00
Matthias Clasen
c33d8c7005 widget: Don't show widget resizes in the inspector
Avoiding this sort of visual debugging in the inspector
is the main reason we have per-display debug flags now.
2016-05-05 15:03:57 -04:00
Matthias Clasen
4cf6141462 css gadget: Fix baseline debug
We were not using the baseline that we're computing.
2016-05-05 15:03:57 -04:00