Commit Graph

26496 Commits

Author SHA1 Message Date
Matthias Clasen
952d0fd23f window: Stop using gdk_screen_get_n_monitors 2016-04-27 23:18:16 -04:00
Matthias Clasen
03d70f1636 settings: Stop comparing screen numbers
There is only one screen.
2016-04-27 23:18:16 -04:00
Matthias Clasen
f5d6688d3e window: Stop using screen width/height 2016-04-27 23:18:16 -04:00
Matthias Clasen
6ae2c24bde treeview: Stop using screen width/height
Popups should always be placed relative to a monitor.
2016-04-27 23:18:16 -04:00
Matthias Clasen
29396a1e5e label: Stop using screen width/height
Popups should always be placed relative to a monitor.
2016-04-27 23:18:16 -04:00
Matthias Clasen
e9a58190af combobox: Stop using screen width/height
Popups should always be placed relative to a monitor.
2016-04-27 23:18:16 -04:00
Matthias Clasen
b5fb9ae3b7 gtk: Port to new monitor api
Use the GdkDisplay monitor api instead of the GdkScreen one.
2016-04-27 23:18:16 -04:00
Matthias Clasen
1b7d7c857f menu: Add new monitor api
This will work better with the new monitor api in gdk.
2016-04-27 23:18:16 -04:00
Matthias Clasen
3952bd60a5 inspector: Port to new monitor api
Adapt to new monitor apis, and show more information.
2016-04-27 23:18:16 -04:00
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
Lapo Calamandrei
0d55542359 Adwaita: add a background to cellrendertext 2016-04-27 20:05:44 +02: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
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
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