Commit Graph

26480 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Paolo Borelli
6225d435e6 inspector: do not leak seat capabilities descriprion
Factor out an utility function for readability and free the string
with the list of capabilities
2016-04-24 17:49:26 +02:00
Christian Hergert
0b88d7976c quartz: fix quartz build
The quartz backend has its own implementation of these that
collide since the gtkdragdest.c extraction.

https://bugzilla.gnome.org/show_bug.cgi?id=764712
2016-04-24 03:50:22 -07:00
Christian Hergert
4f63d83955 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-04-24 03:49:20 -07:00
Lapo Calamandrei
aa99c64fdd Adwaita: color tweaks
use a slightly cold and slightly darker gray for the dark variant,
use the same hue for the osd bg color, make it bit darker and
transparent.
2016-04-22 14:44:59 +02:00
Sébastien Wilmet
554de0be2a app: replace private accels functions by get_application_accels()
It's like gtk_application_get_action_muxer().

https://bugzilla.gnome.org/show_bug.cgi?id=764879
2016-04-22 12:43:27 +02:00
Sébastien Wilmet
3b988ce523 app: share function to normalise detailed action name
Put the function in gtkactionmuxer.c, where
gtk_print_action_and_target() is implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=764879
2016-04-22 12:40:08 +02:00
Sébastien Wilmet
3d182160bb app-accels: rename static functions
Remove the "accels_" prefix from the remaining static functions. The
prefix no longer makes sense since the whole file is devoted to accels.

https://bugzilla.gnome.org/show_bug.cgi?id=764879
2016-04-22 12:39:44 +02:00
Sébastien Wilmet
bce4a0abde app: extract GtkApplicationAccels private class
This has several benefits:
- Less code in GtkApplication. The accels handling is something
  self-contained, and GtkApplication now delegates the work.
- For the accels functions, there is now a distinction between static
  functions and functions in the gtkapplicationaccelsprivate.h header,
  which makes the code easier to understand, because we have a good
  overview just by reading the header.
- The struct _GtkApplicationPrivate is now easier to find instead of
  being in the middle of the file.

https://bugzilla.gnome.org/show_bug.cgi?id=764879
2016-04-22 12:39:18 +02:00
Sébastien Wilmet
e0c34fd028 app: write higher-level gtk_application_accels static functions
These will become the functions present in the
gtkapplicationaccelsprivate.h header.

The gtk_application_accels functions deal with detailed_action_name's
instead of action_and_target's. action_and_target is an implementation
detail of Accels.

The added function prototype is temporary, it'll be removed in a later
commit.

https://bugzilla.gnome.org/show_bug.cgi?id=764879
2016-04-22 12:38:56 +02:00
Matthias Clasen
73c91c285e Fix formatting
The previous change was not quite using the right coding style.
2016-04-21 23:24:13 -04:00
Timm Bäder
0815b21ad4 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-04-21 23:11:38 -04:00
Benjamin Otte
c081ca2d4c cssshadowsvalue: Avoid allocating new value if not needed 2016-04-21 23:01:31 +02:00
Benjamin Otte
f93eca5604 cssbordervalue: Avoid allocating new value if not needed 2016-04-21 23:01:31 +02:00
Benjamin Otte
2fc0d6a91a cssbgsizevalue: Avoid allocating new value if not needed 2016-04-21 23:01:31 +02:00
Lapo Calamandrei
3ed8ac034d Adwaita: backdrop active button color tweaks 2016-04-21 17:01:45 +02:00
Lapo Calamandrei
d857ba3faf Adwaita: cosmetics 2016-04-21 16:51:24 +02:00
Lapo Calamandrei
874d4ede67 Adwaita: solid bg for disabled pushed button 2016-04-21 16:43:35 +02:00
Lapo Calamandrei
517f33b1a6 Adwaita: spinbutton fixes
reset background-color on backdrop disable buttons and entry node.
2016-04-21 16:25:05 +02:00
Jonathan Matthew
22cd8e9d4f gtkmenusectionbox: remove submenus when the parent item is removed
https://bugzilla.gnome.org/show_bug.cgi?id=749405
2016-04-20 17:28:19 -04:00
Matthias Clasen
d6ac55102e 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-04-19 23:32:26 -04:00
Matthias Clasen
d58885c9b9 css gadget: Fix baseline debug
We were not using the baseline that we're computing.
2016-04-19 23:26:57 -04:00
Matthias Clasen
37b70a9733 Use qdata for debug flags
This avoids some overhead.
2016-04-19 23:26:57 -04:00
Matthias Clasen
c01befe5cc css gadget: Don't get display flags twice
This got more expensive now that we store them per-display,
so don't get them twice in the same function.
2016-04-19 23:26:57 -04:00
Christian Hergert
3df2e0b26a debug: remove open-coded debug checks in gtktextsegment
These runtime checks were being performed whether or not we were in a
debug build. Using GTK_DEBUG_CHECK() will compile out of production
builds, as it will result in something like:

  if (G_UNLIKELY(0))

which the optimizer can prune.

https://bugzilla.gnome.org/show_bug.cgi?id=765284
2016-04-19 19:56:17 -07:00
Matthias Clasen
f3e6d930a8 text tag: Add a va marshaller to ::event 2016-04-19 21:10:31 -04:00
Matthias Clasen
c7bac91494 text buffer: Add va marshallers for signals 2016-04-19 21:10:31 -04:00
Matthias Clasen
3c3aa478f9 menushell: Add a va marshaller for ::insert 2016-04-19 21:10:31 -04:00
Lapo Calamandrei
1b22039649 Adwaita: use an image for backdrop button background
which doesn't make the sliders flash during background transition.
2016-04-19 23:00:54 +02:00
Lapo Calamandrei
5fc18c7167 Adwaita: link button style fix
ensure the label color doesn't get overridden, fixes link button
label being gray in backdrop.
2016-04-19 22:58:33 +02:00
Lapo Calamandrei
c16c9e7c3f Adwaita: scale with marks style fix
reset background-color on the slider.
2016-04-19 22:58:33 +02:00
Lapo Calamandrei
5199b66682 Adwaita: fix switch styling
ensure the last button has rounded corners and adapt to button
mixin changes.
2016-04-19 22:58:33 +02:00
Lapo Calamandrei
24c3906d5f Adwaita: fix insensitive switch styling
misplaced backdrop disabled selector was overriding the disabled
one.
2016-04-19 22:58:33 +02:00
Matthias Clasen
51d58108f9 Add some va marshallers to frequent signals
This makes us take the fast path in signal emission.
2016-04-19 16:12:33 -04:00
Lapo Calamandrei
b596fcada7 Adwaita: stop using images for solid backgrounds...
...unless it's needed.
2016-04-19 21:59:37 +02:00
Matthias Clasen
5efb574055 magnifier: Only connect to ::draw when needed
This making us take the slow path in ::draw handling, so we
want to avoid it if we can.

https://bugzilla.gnome.org/show_bug.cgi?id=765238
2016-04-19 15:29:04 -04:00