Commit Graph

24190 Commits

Author SHA1 Message Date
Takao Fujiwara
a41f02f9b1 GtkIMContextSimple: Load locale compose tables dynamically.
Load /usr/share/X11/locale/$LOCALE/Compose and $HOME/.XCompose
dynamically.

https://bugzilla.gnome.org/show_bug.cgi?id=721120
2015-10-09 00:19:41 -04:00
Takao Fujiwara
138187755f Add gtk_compose_table_new_with_file() to create GtkComposeTable
https://bugzilla.gnome.org/show_bug.cgi?id=721120
2015-10-09 00:19:41 -04:00
Takao Fujiwara
4535d09bea GtkIMContextSimple: Change guint to guint16 in gtkimcontextsimple.c
GtkComposeTable and GtkComposeTableCompact use guint16 for the data.

https://bugzilla.gnome.org/show_bug.cgi?id=721120
2015-10-08 22:35:52 -04:00
Takao Fujiwara
48a2477f2d GtkIMContextSimple: export _gtk_check_compact_table() and GtkComposeTable
Some functions need to be exported if X11 compose files are loaded.

https://bugzilla.gnome.org/show_bug.cgi?id=721120
2015-10-08 22:35:52 -04:00
Lapo Calamandrei
f45e26885c Adwaita: simplify spibutton styling a bit 2015-10-08 17:18:50 +02:00
Benjamin Otte
b6bf982289 iconhelper: Track icon-name fallback usage in the GIcon
Passing GTK_ICON_LOOKUP_GENERIC_FALLBACK to the icon lookup doesn't work
for GIcons, so we have to make sure we use the right GThemedIcon.

Fixes image-icon-name-use-fallback reftest.
2015-10-08 14:44:38 +02:00
Matthias Clasen
1e51398e9a Small cleanup
Use g_clear_object in gtkdnd.c.
2015-10-08 07:20:26 -04:00
Matthias Clasen
d3475f7a72 color chooser: Render icons sharp at scale 2
We need to load the icons at the right scale, and render them
to a surface with the right scale too.

https://bugzilla.gnome.org/show_bug.cgi?id=756195
2015-10-07 23:19:32 -04:00
Carlos Soriano
c929e98fba gtkfilesystem: protect against null filesystem type
The filesystem:type attribute could be NULL, then g_strv_contains
will crash if that happens.
Just don't call it if the attribute is not set.
2015-10-08 01:21:28 +02:00
Sébastien Wilmet
b23eabbd64 textiter: fix bug in _gtk_text_btree_get_iter_at_last_toggle()
If the last tag toggle is the end iter, the function returned the wrong
tag toggle.

This resulted in some bugs where the view wasn't relayout/redrawn
correctly.

The function also always returned TRUE, probably because the return
value is used nowhere. But for consistency with
_gtk_text_btree_get_iter_at_first_toggle(), it's better to keep the
return value, and also because otherwise the function would be wrong (it
doesn't always return a tag toggle, if there is none).

https://bugzilla.gnome.org/show_bug.cgi?id=755413
2015-10-07 16:41:37 +02:00
Timm Bäder
d8856f1b61 GtkPopover: Don't apply shape on wayland
Popovers are subsurfaces on wayland so we don't need that, and the shape
messed up hidpi popovers there.
2015-10-07 09:49:51 +02:00
Christoph Reiter
263cbd90a0 Fix accessibility not getting initialized in gtk_init() if a default display is already set
_gtk_accessibility_init() only gets called if the default
display changes, but in case gdk_init() is called before gtk_init()
the default display is already set and no property notification occurs.

This can happen quite easily in pygobject where
"from gi.repository import Gdk, Gtk"
will call gdk_init() followed by gtk_init() in the Python overrides.

This fixes it by checking for a default display in all cases.
2015-10-07 00:19:32 +02:00
Matthias Clasen
35b088459e assistant: Deal with spontaneous page disappearance
Removing pages from the assistant with gtk_widget_destroy() used
to work. It broke with the recent interposition of a box between
each page and the notebook. Fix this by cleaning up when the box
child is removed.

https://bugzilla.gnome.org/show_bug.cgi?id=756042
2015-10-05 08:21:55 -04:00
Rafal Luzynski
3c253c46a5 flowbox: correct the behavior with "can-focus"==FALSE
In fact there were two issues:

1. GtkFlowBoxChild with "can-focus"==FALSE should pass the focus
to its child immediately.
2. GtkFlowBox with "can-focus"==FALSE should cease its custom keynav
implementation and fall back to the default GtkContainer behavior
which is more natural.

Thanks to these changes the flow box can act as a better replacement
for GtkGrid and similar containers.

https://bugzilla.gnome.org/show_bug.cgi?id=753371
2015-10-03 22:48:15 -04:00
Matthias Clasen
47237ddd94 inspector: Add a reset button for settings
This is exercising the new gtk_settings_reset_property api.

https://bugzilla.gnome.org/show_bug.cgi?id=755008
2015-10-03 22:42:12 -04:00
Matthias Clasen
2f0d4b6868 Add gtk_settings_reset_property
This api undoes an application-specific override and makes the
setting follow the system-wide values again.

https://bugzilla.gnome.org/show_bug.cgi?id=755008
2015-10-03 22:42:12 -04:00
Matthias Clasen
d930ea7c1f style context: Avoid a compiler warning 2015-10-03 22:42:12 -04:00
Benjamin Otte
2dad7c1319 gdk: Add gdk_rectangle_equal()
There's enough users inside GTK to warrant this convenience function.
2015-10-03 22:26:27 -04:00
Sébastien Wilmet
5a561a8ddb texttag: add gtk_text_tag_changed()
The function is useful for a GtkTextTag subclass that adds new
properties.

https://bugzilla.gnome.org/show_bug.cgi?id=755416
2015-10-03 22:24:17 -04:00
Matthias Clasen
598e17018c style context: Formatting fixes 2015-10-03 21:38:20 -04:00
Matthias Clasen
506fe61938 Fix gtk_style_context_list_classes
The function was always returning NULL.
2015-10-03 17:37:34 -04:00
Matthias Clasen
83b8bcb63a switch: Unclip the slider shadow
This commit arranges things so the shadow of the slider can
extend outside the widget, even if the switch itself has no
shadow.

https://bugzilla.gnome.org/show_bug.cgi?id=755791
2015-10-03 16:20:50 -04:00
Matthias Clasen
eabdaf17dc file chooser: Clear busy cursor before showing error
It looks odd to still have a busy cursor while the error
dialog is presented.
2015-10-02 06:57:05 -04:00
Matthias Clasen
7d4ed3692e file chooser: Improve search focus handling
Move focus to list when search results appear to make it
possible to select the first search result by just hitting
Enter. To keep this from interfering with keynav, we need
to make sure that we still handle Escape to search. And when
search comes up empty, we need to move the focus back to the
entry.

https://bugzilla.gnome.org/show_bug.cgi?id=755926
2015-10-01 23:32:30 -04:00
Matthias Clasen
134c2ea799 file chooser: Don't select in the search entry
The stack calls gtk_widget_grab_focus on the last focus widget,
which selects the text in the entry, so we need to make sure to
move the focus there first to keep that from happening.

https://bugzilla.gnome.org/show_bug.cgi?id=755931
2015-10-01 22:59:57 -04:00
Emmanuele Bassi
707a071c66 app: Warn when trying to add windows on an inert instance
Application windows can only be added after the application has been
started.

https://bugzilla.gnome.org/show_bug.cgi?id=755954
2015-10-01 19:24:12 +01:00
Olivier Fourdan
42b02d9d01 window: ignore resize increments for maximized/fullscreen
Once a window is maximized/fullscreen, resize increments should be
ignored otherwise the window may appear smaller than the screen size.

That also applies to configure requests as well.

https://bugzilla.gnome.org/show_bug.cgi?id=751368
2015-10-01 16:17:42 +02:00
Matthias Clasen
84c7f6c747 header bar: Show a non-pixellated app icon
Load a hi-dpi icon when we are running with scale=2.

https://bugzilla.gnome.org/show_bug.cgi?id=751787
2015-09-30 18:42:20 -04:00
Timm Bäder
3e39ec5743 GtkPopover: Make transitions faster
https://bugzilla.gnome.org/show_bug.cgi?id=755528
2015-09-29 20:59:12 -04:00
Matthias Clasen
565677a22c header bar: Don't leave a dangling pointer
This might be the cause for some crashes, like
https://bugzilla.redhat.com/show_bug.cgi?id=1264558
2015-09-29 15:15:06 -04:00
Matthias Clasen
de70ad6c3b Use direct GValue access in our marshallers
These are used for every signal emission, so we should
make them as fast as we can.
2015-09-29 09:43:43 -04:00
Matthias Clasen
d9f05aa3f9 rounded rect: cache arcs
We are only ever drawing axis-aligned quarter arcs here. By caching
these paths, sincos drops from the profiles for drawing-heavy
workloads.
2015-09-29 09:43:43 -04:00
Matthias Clasen
a768798f2b container: Avoid duplicate calls to should_propagate
We were calling gtk_container_should_propagate_draw
twice for each child. We can avoid this by splitting
out an gtk_container_propagate_draw_internal function.
2015-09-29 09:43:43 -04:00
Matthias Clasen
12be4b04f8 Drop some redundant cairo_save calls
Almost all callers of _gtk_widget_draw already did their own
cairo_save/restore, so drop the save/restore calls inside
_gtk_widget_draw and instead fix the last caller, gtk_widget_draw,
to do the same.
2015-09-29 09:43:42 -04:00
Matthias Clasen
eaddbb2dca Trivial: Move a cairo_save call
Move the cairo_save call to where it is needed.
2015-09-29 09:43:42 -04:00
Timm Bäder
5bf47338e8 GtkPopover: Remove apply_shape field
This was introduced in 2d9c09d6 alongside a private setter, but that
setter has been removed and the field is always TRUE.
2015-09-29 15:28:55 +02:00
Timm Bäder
8a6b720632 GtkPopover: Don't resize during the transition
Call gtk_popover_update_position instead which will pick up the new
transition_diff value and pass it on to
_gtk_window_set_popover_position, which in turn will move the window
correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=755435
2015-09-29 15:28:55 +02:00
Timm Bäder
b92213e49d GtkWindow: Don't needlessly resize popovers
Check whether the given popover even changed size in
_gtk_window_set_popover_position. If not, just move its GdkWindow
without calling gtk_widget_queue_resize. Using popover_get_rect here is
still relatively costly, but popover_size_allocate would be doing that
anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=755435
2015-09-29 15:28:55 +02:00
Timm Bäder
eb8a64982e GtkPopover: Remove _get_pointed_to_coords
It's only used once and removing it only adds a single line there.

https://bugzilla.gnome.org/show_bug.cgi?id=755435
2015-09-29 15:28:55 +02:00
Matthias Clasen
130fc6ce9b css style: Accumulate changes in place
This avoids allocating a temporary bitmask, and lets us
avoid some value comparisons altogether.
2015-09-28 06:29:51 -04:00
Matthias Clasen
ac198a3ce6 Add a few more inlined getters 2015-09-28 06:29:50 -04:00
Benjamin Otte
7c762fe1c4 bitmask: Use gsize, not size_t
We want to use the same type everywhere to avoid surprises.
2015-09-27 15:12:22 +02:00
Dmitry Shachnev
97293865b5 bitmask: Don't hardcode 64bit size
This looks like an oversight from "quickly testing a potential fix" and
then forgetting to make a production-ready when it works.

https://bugzilla.gnome.org/show_bug.cgi?id=755691
2015-09-27 15:12:22 +02:00
Matthias Clasen
ff3cb8ac71 Avoid copying lists during draw
We can use gdk_window_peek_children here, instead of copying
the list. Note that we preserve the bottom-to-top ordering by
iterating the list from the end.
gdk_window_get_children_with_user_data was doing a list
reversal while filtering the list.
2015-09-27 00:35:12 -04:00
Matthias Clasen
001ba79dd6 Refactor gtk_widget_add_events_internal_list
Avoid copying the child window lists. It is not necessary.
2015-09-27 00:35:12 -04:00
Matthias Clasen
1cac30b6f3 Refactor gtk_widget_set_device_enabled_internal
Instead of constructing a single list of all windows associated
to a widget, just iterate the children lists recursively, avoiding
allocations.
2015-09-27 00:35:11 -04:00
Carlos Soriano
6e83c3b92e gtkbookmarksmanager: don't allow non valid utf8 in bookmarks
In case some client send to us a non valid utf8 string, don't screw up
the bookmarks file and just return.

https://bugzilla.gnome.org/show_bug.cgi?id=755215
2015-09-25 16:10:32 +02:00
Carlos Soriano
ecc698a282 gtkplacessidebar: avoid to use a freed string
The string we were using is the representation of the internal text
in the popover entry. However that can be freed before setting the
bookmark label, if i.e. the row is destroyed and therefore the popover
as well.
To avoid that, duplicate the label in a local variable.

One of the consequences is that for those people using development version
we migth screwed its bookmarks file, since the bookmark manager wrote
garbage from the already freed label.

https://bugzilla.gnome.org/show_bug.cgi?id=755215
2015-09-25 16:10:32 +02:00
Carlos Garnacho
f2fd655754 textview: Look up the drop location iter on the right coordinates on DND
We are passing widget coordinates to gtk_text_view_window_to_buffer_coords()
which expects coordinates to be relative to the text window in this case.
This may result in drop coordinates being displaced if the side windows to
the top/left sides are visible and taking space, so the DnD indicator will
point to the wrong position.

This can be seen on gnome-builder and gedit when displaying line numbers.
2015-09-24 20:47:55 +02:00
Jakub Steiner
9dfa8e200d HC: use round buttons on sidebars
Copy Adwaita in how sidebar icon buttons look

https://bugzilla.gnome.org/show_bug.cgi?id=755268
2015-09-23 23:31:27 -04:00