Commit Graph

24550 Commits

Author SHA1 Message Date
Matthias Clasen
0f4663728e toolitemgroup: Fix the previous change
dispose can be called more than once.
2015-10-27 12:54:19 -04:00
Matthias Clasen
9753bea6a4 tool item group: Don't leak a button
This causes a hickup in the new css node machinery, causing
the default-value test to fail.
2015-10-27 11:09:00 -04:00
Matthias Clasen
270e900f55 icon theme: Ensure to propagate an error
If the svg pixbuf loader is not available, we end up with criticals
from gtk_css_image_icon_theme_draw because gtk_icon_info_load_symbolic
returns NULL without setting an error.

Avoid this by propagating the load error.
2015-10-27 11:09:00 -04:00
Matthias Clasen
bb5b711d4b shortcuts: Some property hygiene
Bring property notification for some of the new shortcuts widgets
up to the standards of our testsuite.
2015-10-27 09:25:17 -04:00
Matthias Clasen
ed00d86496 inspector: Allow editing css node properties
This reuses the property editor infrastructure from the
property list pages. Good that css nodes are objects.
2015-10-26 23:39:51 -04:00
Matthias Clasen
6852a1eef9 inspector: Support editing interned string properties
Sadly, interned string properties cannot be handled generically
at all - GObject insists on inserting a strcpy in any attempt
to set a string property with generic api, destroying the
internedness of the string.

Therefore, we have to special-case GtkCssNode in the property
editor code :-(
2015-10-26 23:39:51 -04:00
Matthias Clasen
b7d001e613 Add some api annotations
Nothing is using the /*interned*/ annotations currently,
but if we are doing this, we should be consistent.
2015-10-26 23:39:50 -04:00
Benjamin Otte
a648afae12 widget: Add name to widget paths
This changes widget paths for widgets with a CSS name to return that CSS
name, now that we have added API for it.
This means that style properties are now matches using the CSS name.

Also fix the theme to use the correct name when matching style properties.
2015-10-27 03:13:42 +01:00
Benjamin Otte
517cea36ed cssmatcher: Actually match names for widget paths
The type is always 0 when we use names. So this would always return
FALSE. Oops.
2015-10-27 03:13:42 +01:00
Matthias Clasen
d717afd4d4 entry: properly update css subnode state
Update the state of the css subnodes for icons when
appropriate, and avoid calling set_state after save_to_node.
2015-10-26 22:09:07 -04:00
Matthias Clasen
c72d094ae0 entry: Use better element name for progress
Change the name of the CSS subnode for progress rendering from
progressbar to progress. This will align better with GtkProgressBar.
2015-10-26 21:34:16 -04:00
Robert Ancell
aefa1ba611 gdk: Deprecate gdk_display_get_screen 2015-10-27 14:17:52 +13:00
Benjamin Otte
101df329ae API: Add gtk_widget_path_iter_set_object_name()
... and gtk_widget_path_iter_get_object_name(). This allows applications
that still use widget paths to use the new object names to get the
correct styling.

Mutter and webkit-gtk are examples here.
2015-10-27 01:44:50 +01:00
Jonas Ådahl
aedd193c69 GtkTreeView: Rework the search window hack so it also works on Wayland
The search window of a tree view was implemented by showing without
making it visible by by positioning it outside the screen edge. This is
not possible on Wayland, so implement another method for being able to
enter text into a non-visible entry.

The new method is implemented by, before showing the window, pass the
key event directly to the IM context backing the entry. If the key
event triggered the context to commit new text or change the preedit
content, the search window is shown, and from that point the key events
are forwarded directly to the entry widget.

https://bugzilla.gnome.org/show_bug.cgi?id=756780
2015-10-27 08:41:02 +08:00
Jonas Ådahl
97dbef451e GtkTreeView: Make a search window destroy helper
https://bugzilla.gnome.org/show_bug.cgi?id=756780
2015-10-27 08:41:02 +08:00
Jonas Ådahl
2eb7d7476b GtkTreeView: Use more consistent search window naming
Instead of alternating between search dialog and search window, use
search window everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=756780
2015-10-27 08:41:02 +08:00
Matthias Clasen
76619cf1ae entry: Bring back icon padding
Not sure why this is necessary now, but it is.
2015-10-26 16:51:28 -04:00
Matthias Clasen
ed8641ff26 entry: Only set one of the .left, .right style classes
We were not removing the old style class when adding a new one.
2015-10-26 15:28:50 -04:00
Matthias Clasen
e28b3d1296 assistant: Handle page-type and title changes properly
We need to update our state when a pages' type or title changes.
2015-10-26 09:01:07 -04:00
Matthias Clasen
6efbf329c3 shortcuts: Cosmetic change
The .flat style class is controlled by the relief property,
so just use that instead of manually setting style classes.
2015-10-26 07:23:07 -04:00
Matthias Clasen
953aa45c04 label docs: Mention common style classes
Mention some of the style classes that are commonly used
with labels.
2015-10-26 07:23:07 -04:00
Olivier Fourdan
305b34aa15 GtkWindow: fix move/get position with CSD
Take into account and compensate for the size of the client side
decorations widgets in gtk_window_move() and gtk_window_get_pos()
including gravity.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=756618
2015-10-26 08:40:36 +01:00
Olivier Fourdan
3450f53907 GtkWindow: add up CSD size in gtk_window_resize()
When client side decoration is used, the size passed to
gtk_window_resize() or retrieved from gtk_window_get_size() for top-
level windows also accounts for the client side decorations widgets
such as the title bar or the shadow borders.

Add up the size of these additional controls to the given size to get
the size expected.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=756618
2015-10-26 08:40:36 +01:00
Matthias Clasen
bf65b06781 HighContrast: Don't use GtkInfoBar type name
We have a proper element name for it now.
2015-10-25 17:19:34 -04:00
Matthias Clasen
91ec104dd3 Adwaita: Don't use GtkInfoBar type name
We have a proper element name for it now.
2015-10-25 17:19:01 -04:00
Matthias Clasen
f1248ccea4 infobar: Add a name to the css node
This lets us avoid the type name in css.
2015-10-25 17:18:20 -04:00
Matthias Clasen
2de0f06af9 HighContrast: Update separator rendering
Adapt HighContrast t othe changes in the pre-previous commit.
2015-10-25 16:29:11 -04:00
Matthias Clasen
0ba03aac16 Adwaita: Update separator styling
Adapt Adwaita to the changes in the previous commit.
2015-10-25 16:28:38 -04:00
Matthias Clasen
2eb6599b29 separator: Use the element name separator
Switch GtkSeparator from using the .separator style class to
using the element name separator for its css node.
2015-10-25 16:27:44 -04:00
Matthias Clasen
aa67ad0011 Adwaita: Update accel label styling
Adapt Adwaita to the changes in the previous commit.
2015-10-25 15:45:13 -04:00
Matthias Clasen
caa6fb0732 accel label: Use a css node for the accelerator
Use a permanent subnode with name accelerator instead of the
.accelerator style class.
2015-10-25 15:45:13 -04:00
Matthias Clasen
2b20bd54c5 HighContrast: Update spinner rendering
Adapt HighContrast to the changes in the pre-previous commit.
2015-10-25 15:45:13 -04:00
Matthias Clasen
bd80b1d037 Adwaita: Update spinner styling
Adapt Adwaita to the changes in the previous commit.
2015-10-25 15:45:13 -04:00
Matthias Clasen
9269525f07 spinner: Use the element name spinner
Switch GtkSpinner from using the .spinner style class to
using the element name spinner for its css node.
2015-10-25 15:45:13 -04:00
Matthias Clasen
f55e3f7eda inspector: Be more careful with dead objects
gtk_inspector_object_tree_find_object accesses the type information
of the object, so we can't safely use it on an already decaying
object when we get a weak notify. Instead just walk the tree and
compare pointers, that is safe.

https://bugzilla.gnome.org/show_bug.cgi?id=756852
2015-10-25 13:11:17 -04:00
Matthias Clasen
4305aa1def inspector: Improve css node UI
All the other object pages have a title, this one was missing it.
Add one, so the page fits in with the rest.
2015-10-25 09:20:43 -04:00
Matthias Clasen
1e112ca75e inspector: Allow editing strv-valued properties
These do occur in some places, and we can easily allow editing
them.
2015-10-25 02:14:04 -04:00
Matthias Clasen
e440050134 Fix the build 2015-10-24 17:04:38 -04:00
Matthias Clasen
f1b7560938 notebook: Document css nodes and style class
This will have to be updates as we do further changes to the
way GtkNotebook does its rendering.
2015-10-24 10:54:56 -04:00
Matthias Clasen
8917ee5373 notebook: Drop unneeded code
We no longer need to set the position classes on the main css node,
since they are already set on the per-tab subnodes.
2015-10-24 10:39:18 -04:00
Matthias Clasen
9f738da11b HighContrast: Update notebook styling
The switch from .notebook to notebook requires minor changes,
such as moving the style properties into a separate selector.
2015-10-24 10:39:18 -04:00
Matthias Clasen
a22e07f374 Adwaita: Update notebook styling
The switch from .notebook to notebook requires minor changes,
such as moving the style properties into a separate selector.
2015-10-24 10:39:18 -04:00
Matthias Clasen
f194b9608a notebook: Use the element name notebook
Switch GtkNotebook from using the .notebook style class to
using the element name notebook for its main css node.
2015-10-24 10:39:18 -04:00
Matthias Clasen
e2bfe9e95a notebook: Cosmetic cleanup 2015-10-24 10:39:17 -04:00
Matthias Clasen
431089f769 entry: Add css node documentation
List the css names and the typical style classes that can be
expected to occur with entries.
2015-10-23 16:22:25 -04:00
Matthias Clasen
78309d8b00 HighContrast: Update entry progress rendering
Adapt HighContrast to the changes in the pre-previous commit.
2015-10-23 16:16:55 -04:00
Matthias Clasen
d8a3a4e7aa Adwaita: Update entry progress rendering
Adapt Adwaita to the changes in the previous commit.
2015-10-23 16:13:43 -04:00
Matthias Clasen
6a768ba218 entry: Use a permanent css node for progress
Create a css node with name progressbar when we start showing progress
in the entry. The node gets the style class .pulse added when we
do pulse mode.
2015-10-23 16:11:08 -04:00
Matthias Clasen
e39ca899ad Adwaita: Update for entry icon changes 2015-10-23 15:41:05 -04:00
Matthias Clasen
f5e77d0c67 entry: Use css nodes for icons
Create css nodes for icons in entries, with name image, and use
gtk_style_context_save_to_node() for them. We still set the
style classes .left and .right on them.
2015-10-23 15:39:29 -04:00
Matthias Clasen
8a8518ed40 HighContrast: Update entry styling
Use the new element name instead of the style class.
2015-10-23 14:53:06 -04:00
Matthias Clasen
c6a7ceedc9 Adwaita: Update entry styling
Use the new element name instead of the style class.
There is some minor fallout for vertical spin buttons that
will need a second look.
2015-10-23 14:52:27 -04:00
Matthias Clasen
b2dd9cbc59 entry: Use the element name entry
Set the element name on the css node and drop the .entry class.
2015-10-23 14:51:35 -04:00
Lapo Calamandrei
5b0a26f8a3 Adwaita: fix switch styling
looks like switch stare are not passed to the slider anymore so
rewrite selectors accordingly.
2015-10-23 17:12:01 +02:00
Lapo Calamandrei
4959fe3267 Adwaita: generalize .has-open-popup
so it works for any list-row istead of just the ones in a sidebar.
2015-10-23 16:58:17 +02:00
Matthias Clasen
71b79f3329 shortcut: Improve formatting of ranges
Use a centered ellipsis, to make it look nicer.
2015-10-23 07:46:31 -04:00
Matthias Clasen
57057f73e4 HighContrast: Update image styling
Use the new element name instead of the type name.
2015-10-23 00:05:46 -04:00
Matthias Clasen
6f90b3ca31 Adwaita: Update image styling
Use the new element name instead of the type name.
2015-10-23 00:05:18 -04:00
Matthias Clasen
34be4de1ad image: Use the element name image
Set hte element name on the CSS node.
2015-10-23 00:04:47 -04:00
Matthias Clasen
a8b5c04694 HighContrast: Update label styling
Use the new element name instead of the style class.
2015-10-22 23:27:43 -04:00
Matthias Clasen
bacc9d4edd Adwaita: Update label styling
Use the new element name instead of the style class.
2015-10-22 23:27:43 -04:00
Matthias Clasen
7d98c7f1ae label: Use the element name label
Set the element name on the CSS node, and drop the .label style
class.
2015-10-22 23:27:43 -04:00
Matthias Clasen
506d5b5b48 switch: Document css names a bit
This is still provisional. Better gtk-doc support will be needed
to do better here.
2015-10-22 23:27:43 -04:00
Matthias Clasen
b5e1fd5b7f HighContrast: Update switch styling
Use the new element names instead of the type name and style
classes, just like we did for Adwaita in the previous commit.
2015-10-22 21:44:03 -04:00
Matthias Clasen
99d7648517 Adwaita: Update switch styling
Use the new element names instead of the type name and style
classes.

Note that there is one problem with moving away from type names
here: it turns out that style properties only work if the selector
uses the type name.
2015-10-22 21:42:20 -04:00
Matthias Clasen
48b30e8e91 switch: Convert to element names
Use the element names switch and slider for the two css nodes,
and drop the .trough and .slider classes.
2015-10-22 21:40:31 -04:00
Matthias Clasen
203742b188 widget: Always set the type on css nodes
See the previous commit for why this is necessary.

Also make gtk_widget_class_set_css_name work by looking at
the correct class for the name.

Note for future reference: GTK_WIDGET_GET_CLASS() does not
work in the instance init function.
2015-10-22 21:01:06 -04:00
Matthias Clasen
d1a85fc9e4 css node declaration: Allow both name and type to be set
The widget path machinery assumes that we always have types,
and without this change, it will start spewing warnings when
we start to introduce node names.
2015-10-22 20:58:52 -04:00
Matthias Clasen
e0d9250a07 inspector: Show names for css nodes
Currently, we don't have any css nodes with names, but we will soon.
2015-10-22 20:58:08 -04:00
Matthias Clasen
7cf3eec85b Add since tags to new api
gtk_widget_class_set/get_css_name were missing it.
2015-10-22 19:43:32 -04:00
Timm Bäder
5a0a870d89 GtkApplicationWindow: Add missing annotations 2015-10-22 21:02:28 +02:00
Matthias Clasen
67a54bf4ef shortcuts: Support ranges in the display of shortcuts
Repeating Alt-1 to Alt-9 as individual shortcuts looks really boring,
so allow compressing such ranges by specifying <Alt>1...9.
2015-10-22 14:32:50 -04:00
Benjamin Otte
6cf7c03334 notebook: On drag window hide, fix css nodes 2015-10-22 20:29:10 +02:00
Benjamin Otte
1f1c7547da switch: Use the right state when querying padding
We were using the state of the widget node, not the state of the slider
node.

This caused layout loops due to invalidations.
2015-10-22 18:43:55 +02:00
Owen W. Taylor
1571d2872f GtkWindow: draw the frame and shadow even for app-paintable windows
If a window is decorated, we need to draw the frame and shadow, even if
it is app-paintable - it's just nonsense to have a frame that we handle
events on, but expect the app to paint it. (We paint the titlebar in
any case.) If a client wants to handle all painting, it should use an
undecorated window.

https://bugzilla.gnome.org/show_bug.cgi?id=756886
2015-10-22 11:05:03 -04:00
Owen W. Taylor
01136618b8 Guard against selection requestor disappearing
We made a number of unchecked accesses to the selection requestor,
which could cause X errors if the selection requestor vanished
(or we were sent invalid events). Add error traps around all of them.

See https://bugzilla.redhat.com/show_bug.cgi?id=1210814 for an
example of a crash that could be caused by this. (There are about
1000 instances of such a crash in http://retrace.fedoraproject.org
though no linked bug reports specifically talk about cut-and-paste
or DND.)

https://bugzilla.gnome.org/show_bug.cgi?id=756881
2015-10-22 11:05:03 -04:00
Benjamin Otte
d3bf602c60 iconcache: Remove unused function 2015-10-22 16:42:49 +02:00
Benjamin Otte
371f501632 window: Name the decoration style 2015-10-22 16:42:48 +02:00
Benjamin Otte
408920d438 window: Add gtk_widget_class_set_css_name()
This is to replace using class names as CSS names.
2015-10-22 16:42:48 +02:00
Benjamin Otte
244d9ffeee window: Refactor function
Move gtk_style_context_save() into the function that sets up the
decoration rendering.
2015-10-22 16:42:48 +02:00
Benjamin Otte
ed574408f2 notebook: Remove "prelight-page" class
Instead, just use the "tab:hover" selector
2015-10-22 16:42:48 +02:00
Benjamin Otte
182f9a7f39 notebook: Remove "active-page" class
Instead, just use the "tab:active" selector
2015-10-22 16:42:48 +02:00
Benjamin Otte
2720d97db3 notebook: Remove funciton by folding it into callers 2015-10-22 16:42:48 +02:00
Benjamin Otte
acd63a6019 notebook: Refactor internal function
Don't return the state anymore as the function doesn't even look at the
state. Instead, make the callers that need the state query it manually.
2015-10-22 16:42:48 +02:00
Benjamin Otte
7b9844288a notebook: Make tab positions permanent
... on the tab CssNodes.
2015-10-22 16:42:48 +02:00
Benjamin Otte
dd3f2ec987 notebook: Remove last traces of regions
Now that we don't use regions anymore, there's no need to update
anything when the regions change.
2015-10-22 16:42:47 +02:00
Benjamin Otte
f713bcd742 notebook: Set reorderable-page style class properly
Set it when the reorderable state changes, not just when rendering.
2015-10-22 16:42:47 +02:00
Benjamin Otte
a4e86341e4 notebook: Set active state properly
Don't update it on save/restore, actually set it when it changes.
2015-10-22 16:42:47 +02:00
Benjamin Otte
541926089a notebook: Set prelight state properly
Don't update it on save/restore, actually set it when it changes.
2015-10-22 16:42:47 +02:00
Benjamin Otte
3392d53f61 notebook: Use CssNodes instead of regions
This almost makes CSS work again with notebooks.
2015-10-22 16:42:47 +02:00
Benjamin Otte
01f7711307 notebook: Move style_context_save() into function
This is for future changes.
2015-10-22 16:42:47 +02:00
Benjamin Otte
601fe8f502 css: Remove macros that were used only with regions 2015-10-22 16:42:47 +02:00
Benjamin Otte
55d496e917 cssmatcher: Remove matching API for regions 2015-10-22 16:42:47 +02:00
Benjamin Otte
983de6f4a0 treeview: Use a cssnode instead of regions
This makes Treeview headers work again like before region support was
removed.
2015-10-22 16:42:47 +02:00
Benjamin Otte
24dde6346a API: cssselector: Stop supporting regions
The namespace that belonged to regions is supposed to be used for
CssNode names.
2015-10-22 16:42:46 +02:00
Benjamin Otte
20ce0588b1 treeviewcolumn: Create button on init
This way, the button is always available and the code doesn't have to
special case this condition.
2015-10-22 16:42:46 +02:00
Benjamin Otte
950b1fb65c switch: Port to GtkCssNode
This is a simple port, no code modifications so far other than replacing
gtk_style_context_save() with gtk_style_context_save_to_node().
2015-10-22 16:42:46 +02:00
Benjamin Otte
c075c14bf4 stylecontext: Add gtk_style_context_save_to_node()
To be used instead of gtk_style_context_save() with persistent nodes.
2015-10-22 16:35:14 +02:00
Benjamin Otte
72615a1b16 stylecontext: Add gtk_style_context_add_named()
This is an intermediate step for cssnode introduction. It gives a name
for the node created by saving the style context.
2015-10-22 16:35:14 +02:00
Benjamin Otte
385fda80b4 cssmatcher: Marshal name to matcher
... and use it in the node matcher.

Also rename function from _gtk_css_matcher_get_type() to
_gtk_css_matcher_get_name().
2015-10-22 16:35:14 +02:00
Benjamin Otte
efff9c8edb cssnode: Add setters/getters for name 2015-10-22 16:35:14 +02:00
Benjamin Otte
26450a661e cssnodedeclaration: Add possibility to set the name
This is supposed to be a replacement for setting the type. So far, both
options are possible - either will unset the other.
2015-10-22 16:35:14 +02:00
Benjamin Otte
b65f400d56 treeview: Remove "row" and "col" regions
They aren't used by the theme and we want to get rid of regions.
2015-10-22 16:35:13 +02:00
Matthias Clasen
f6d9f9f93d Add automatic help overlay support to GtkApplication
When the $(resource_prefix)/gtk/help-overlay.ui resource exists,
load a GtkShortcutsWindow from it for each GtkApplicationWindow,
and set up a win.show-help-overlay action with accels <Primary>F1
and <Primary>? to show it.
2015-10-21 15:33:09 -04:00
Matthias Clasen
d1c81446d7 Add some styling for GtkShortcutsWindow
Add some keycap frame around keysyms, and make the stack switcher
buttons rounds. This is very provisional.
2015-10-21 15:32:33 -04:00
Matthias Clasen
1dfbae1aa4 Add GtkShortcutsWindow
This is a toplevel window that is tailored towards showing
help for shortcuts in an application. The implementation closely
follows this design: https://wiki.gnome.org/Design/OS/HelpOverlay

This implementation is inspired by earlier work in gnome-builder,
thanks to Christian Hergert.

https://bugzilla.gnome.org/show_bug.cgi?id=756428
2015-10-21 15:19:34 -04:00
Matthias Clasen
f254a4b67f builder: Support creating GFile objects
This is useful, e.g. when creating GFileIcon objects.
2015-10-21 13:42:15 -04:00
Matthias Clasen
2dc63dad34 Don't use g_slist_next in gtktreeview.c
We generally use ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
05717fe2df Don't use g_slist_next in gtktreemodel.c
We generally use ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
95c7a539bf Don't use g_slist_next in gtktextview.c
We generally use ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
55bd936b73 Don't use g_slist_next in gtktextlayout.c
We generally use ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
b65668a251 Don't use g_slist_next in gtktextdisplay.c
We generally use ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
060948d806 Don't use g_slist_next in gtktextchild.c
We generally use ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
5dd78f74e0 Don't use g_slist_next in gtktextbufferrichtext.c
We generally use ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
50c269f846 Don't use g_slist_next in gtktextbuffer.c
We generally use ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
a863b06576 Don't use g_slist_next in gtkstock.c
We generally use ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
9727a4c4bf Don't use g_slist_next in gtkiconfactory.c
We generally use ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
b5d3bebae3 Don't use g_list_next in gtkselection.c
We generally access ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
ea91670c11 Don't use g_list_next in gtkmain.c
We generally access ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
8422633311 Don't use g_list_next in gtkdialog.c
We generall access ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
b84797a2c6 Don't use g_list_next in gtkcontainer.c
We generally access ->next directory.
2015-10-20 06:14:57 -04:00
Matthias Clasen
a0379d5424 Don't use g_slist_next in gtktextbtree.c
We generally access ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
d0e30994d0 builder: Don't use g_slist_next
We just use direct access to list->next all over the place.
2015-10-20 06:14:57 -04:00
Matthias Clasen
45fa145034 builder: Cosmetic changes
Use an iter instead of g_hash_table_forall.
2015-10-20 06:14:57 -04:00
Matthias Clasen
eec75ee9d6 Cosmetic changes
Line up struct-filling code with the order in the declaration.
2015-10-20 06:14:57 -04:00
Matthias Clasen
019078364e builder: Avoid some unnecessary overhead
Only get the class once per object, not once per property.
And don't canonicalize the property name, g_object_class_find_property
does that already.
2015-10-20 06:14:57 -04:00
Paolo Borelli
4447cf2419 widget: fix typo in warning message 2015-10-19 11:42:39 +02:00
Timm Bäder
944ef8bb0b GtkPaned: Fix gtk_paned_set_child_visible calls
Use CHILD1/CHILD2 instead of 0 and 1, always use the same order and
don't check for child NULL-ness, because it will be done in
gtk_paned_set_child_visible anyways.
2015-10-16 15:07:53 +02:00
Timm Bäder
d0779db1e1 GtkRevealer: Remove useless _start_animation call
The call just passed priv->target_pos, but _start_animation directly
returns if the given target is priv->target_pos (see line 627).
2015-10-16 15:07:49 +02:00
Sébastien Wilmet
9d3e9c9375 inspector: remove gtk_text_buffer_get_iter_at_line_index() workaround
The function is now safe to use.

https://bugzilla.gnome.org/show_bug.cgi?id=735341
2015-10-16 08:43:27 +02:00
Sébastien Wilmet
a9a1c00cc9 textbuffer: nicer get_iter functions
Avoid crashes when passing an invalid location to a
gtk_text_buffer_get_iter_at_*() function.

A boolean is returned to know if @iter has been set to the exact
location.

Unit tests are added.

https://bugzilla.gnome.org/show_bug.cgi?id=735341
2015-10-16 08:43:27 +02:00
Matthias Clasen
c264cd6785 Split off a private header for GtkTextBuffer
This avoids polluting the installed header with private symbols.
2015-10-15 23:04:44 -04:00
Matthias Clasen
3c217e6954 file chooser: Avoid search interruption
When the search entry is shown, the 'special' nature of
., ~ and / should not trigger the location entry, because
that interrupts the search and is likely not what the
user intended.

https://bugzilla.gnome.org/show_bug.cgi?id=756505
2015-10-15 20:53:43 -04:00
Matthias Clasen
0731c50262 entry completion: Only grab the device if we have one
When the entry completion is popped up from a timeout, we may
not have a device. In that case, don't call gdk_device_grab,
do avoid criticals.
2015-10-15 20:18:26 -04:00
Matthias Clasen
dd3f4f2904 scrolled window: Protect against nameless devices
It seems that gdk_device_get_name() can return NULL.
We should not crash if that happens.

https://bugzilla.gnome.org/show_bug.cgi?id=756625
2015-10-15 16:06:15 -04:00
Carlos Soriano
c3686838ea gtkplacesview: align spinner with header label
Use the box margin top instead of the label margin top,
so the spinner remains aligned with the header label.

https://bugzilla.gnome.org/show_bug.cgi?id=756568
2015-10-15 19:22:40 +02:00
Carlos Soriano
9cc3e63045 gtkplacesview: plug leak
https://bugzilla.gnome.org/show_bug.cgi?id=756568
2015-10-15 19:22:40 +02:00
Carlos Soriano
d29d54a97b gtkplacesview: remove hover color from rows
Since other views are not using hover neither

https://bugzilla.gnome.org/show_bug.cgi?id=756568
2015-10-15 19:18:54 +02:00
Carlos Soriano
9341f64c19 gtkplacesview: add a clear button to address entry
So it allows a quick way to clear the entry.

https://bugzilla.gnome.org/show_bug.cgi?id=756568
2015-10-15 19:18:54 +02:00
Carlos Soriano
f9b6c07c8a gtkplacesview: rotate server list icon on toggled
Disclosure triangles are usually used pointing down, however
in this case the popover spawns in the upper direction, which
makes it odd looking.
Instead of pointing always down or up, point down when not toggled and
animate a rotation when toggled.

https://bugzilla.gnome.org/show_bug.cgi?id=756568
2015-10-15 19:18:54 +02:00
Carlos Soriano
831509f6aa gtkplacesview: tweak ui to allow more server rows
Following design guidance, reduce row height and increase
popover height so the user is allowed to see more than 3
rows.

https://bugzilla.gnome.org/show_bug.cgi?id=756568
2015-10-15 19:18:54 +02:00
Carlos Soriano
1dbcce785e gtkplacesview: improve heuristics for external drives
Following the sidebar on commit b0989b190df, improve the way
we check when a drive is external or not.

https://bugzilla.gnome.org/show_bug.cgi?id=756589
2015-10-15 19:16:56 +02:00
Carlos Soriano
569be9f111 gtkplacesview: remove dead code
This is checked on add_volume inside the loop.

https://bugzilla.gnome.org/show_bug.cgi?id=756589
2015-10-15 19:16:56 +02:00
Carlos Soriano
983c61826b gtkplacesview: remove dead code
This is checked on is_removable_volume

https://bugzilla.gnome.org/show_bug.cgi?id=756589
2015-10-15 19:16:56 +02:00
Carlos Soriano
0cd4e7ec43 gtkplacessidebar: improve heuristics for external drives
Since the change to use GtkPlacesView we don't want to show
internal storage on the sidebar.

In our case we were checking for drive_can_eject and
drive_is_media_removable.

However for some external hard drives it's reported that they
are not ejectable nor the have removable media. So the only
attribute that they have different from internal drives is that
they can be stopped.
So check for if the drive can be stopped to decide if it is
external or internal.

On the way realized we don't need to check for the mounts associated
with the volume to know if the volume can be ejected or not. So remove
that code.

https://bugzilla.gnome.org/show_bug.cgi?id=756589
2015-10-15 19:16:56 +02:00
Carlos Garnacho
8147f12eca texthandle: Ensure handles are invalidated on mode changes
Otherwise the "cursor" handle stays with "cursor" appearance instead of
"selection end" when a text selection is started.
2015-10-14 18:44:34 +02:00
Carlos Garnacho
14dde08e33 texthandle: small refactor
These long enums are used too often, shorten things a bit with temp vars.
2015-10-14 18:44:34 +02:00
Carlos Garnacho
cfaa421433 texthandle: Fix Y positioning of text handles
It is assumed that border.top is the same than pointing_to.height (which
equals the strong cursor position), which is not since some time ago.

The border calculation has been move on top too, it is now used in the
Y position one, and doesn't depend on anything we calculate later.
2015-10-14 18:44:34 +02:00
Carlos Garnacho
73bf16b3b0 texthandle: Fix handle dragging on wayland
Text handles are subsurfaces on wayland, so sort of their own toplevel.
This made gtk_widget_translate_coordinates() to bail out there, resulting
in text handles being mispositioned and jumpy. To fix this, translate to
toplevel GtkWindow coordinates manually, and translate coordinates from
there.

Along the way, the coordinates reported in ::handle-dragged have been
fixed so there is no small jumps in either axis (most noticeable in the
X axis when you started dragging, and in the Y axis when moving between
lines of different heights.
2015-10-14 18:44:34 +02:00
Ross Lagerwall
f2b848a531 gtkplacessidebar: Show drives with removable media
Some drives have removable media that is not ejectable (e.g. a laptop's
SD card reader). Show volumes on these drives in the sidebar.

https://bugzilla.gnome.org/show_bug.cgi?id=755654
2015-10-14 17:38:25 +01:00
Jonas Ådahl
364732f2e6 GtkWindow: Enlarge the type hint private field
Make it what it is - the enum - so that that it is sure that the hint
will fit in the field. Without this, any hint that doesn't fit in 3
bits will be truncated to the 3 least significant bits, causing
unexpected behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=756496
2015-10-14 10:32:31 +08:00
Carlos Garnacho
ab001d01c8 textview: Ensure magnifier popover points within widget area
Otherwise the popopver will be automatically unmapped in
_gtk_popover_update_child_visible() when the X axis (coming more
or less directly from events) goes outside the textview.
2015-10-13 02:07:24 +02:00
Carlos Garnacho
d8e41e1308 popover: Invalidate borders on tail position changes
There's nothing doing this explicitly, so tail position changes may
leave trails of older positions.

https://bugzilla.gnome.org/show_bug.cgi?id=756449
2015-10-13 02:07:24 +02:00
Timm Bäder
c05dc28952 gtk-query-settings: Add license header 2015-10-12 20:49:05 +02:00
Timm Bäder
7aa2bfdc77 Add gtk-query-settings
A small utility binary to query all properties of GtkSettings.

https://bugzilla.gnome.org/show_bug.cgi?id=756174
2015-10-10 17:29:15 -04:00
Benjamin Otte
bddc524cd8 stylecontext: Make sure style is valid when looking up style properties
Otherwise, the validation may happen vey automatically some time during
the style property and that will most likely cause a crash.

https://bugzilla.gnome.org/show_bug.cgi?id=756338
2015-10-10 23:23:34 +02:00
Lapo Calamandrei
74e02842bb Adwaita: osd spinbutton fixes 2015-10-10 17:42:40 +02:00
Lapo Calamandrei
b2d379a340 Adwaita: stop consider buttons on osd 'linked'
we used to consider every button inside osd containers linked,
this is not true anymore, now those buttons behave normally.
This will clearly cause breakage in applications.
2015-10-09 16:30:54 +02:00
Felipe Borges
70f577251f gtkprintoperation: job names must not exceed 255 chars
According to http://datatracker.ietf.org/doc/rfc2911/, The 'name'
attribute syntax is essentially the same as 'text', including the
REQUIRED support of UTF-8 except that the sequence of characters
is limited so that its encoded form MUST NOT exceed 255 (MAX) octets.

CUPS will not print jobs with names exceeding 255 characters.

https://bugzilla.gnome.org/show_bug.cgi?id=755988
2015-10-09 10:51:26 +02:00
Matthias Clasen
5548665351 im context simple: Add documentation
Document that GtkIMContextSimple is loading additional compose
tables. Also document Ctrl-Shift-u.
2015-10-09 00:19:41 -04:00
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
Carlos Soriano
5c0447fa44 gtkplacessidebar: avoid accessing destroyed popover
The row and rename popovers are always relative_to a row.
We also keep a pointer to them so we can interact with them in
callbacks.

However, if the row is destroyed its associated popovers will be
destroyed as well as relative_to destroyes and frees memory of its
associated widget when its relative_to widget is destroyed.
If we, for example, update the places while the popover is shown we are
going to access and invalid widget on the next time.

To avoid that, connect to the destroy signal of the popovers and clean
the sidebar pointers when that happens.

https://bugzilla.gnome.org/show_bug.cgi?id=755444
2015-09-23 23:29:22 -04:00
Timm Bäder
02306867c3 GtkWindow: Check for popover realized-ness before unrealizing
https://bugzilla.gnome.org/show_bug.cgi?id=755473
2015-09-23 23:26:44 -04:00
Timm Bäder
5167f525a3 gtkmain: Add nullable annotations
https://bugzilla.gnome.org/show_bug.cgi?id=755038
2015-09-23 23:24:09 -04:00
Matthias Clasen
aff6835f1b application: Be save against impl being NULL
We clear the impl in shutdown, so all callbacks that may
happen at a later time need to be prepared for this.

https://bugzilla.gnome.org/show_bug.cgi?id=755432
2015-09-23 14:38:08 -04:00
Chun-wei Fan
1374645089 Fix make dist
Commit ea241c6 dropped the wrong private header from dist, so correct
this to fix 'make dist'
2015-09-23 23:31:23 +08:00
Chun-wei Fan
ac62479c9e Fix Visual Studio Build Since a080cb4
The patch did not check for Visual Studio 2008 correctly, plus it
would break the build on later Visual Studio versions, as it should
be __popcnt(), not __popcount().  Fix that.
2015-09-23 23:24:36 +08:00
Emmanuele Bassi
a080cb40b9 Improve compiler detection for __builtin_popcount()
The popcount builtin was added in GCC after version 4.2 (which is what
some *BSDs are using), which means we need to be more specific when
using it than just asking for GCC.

While we're at it, we can improve the compiler detection, and use a
builtin popcount on Clang ≥ 3.1 and MSVC 2008.

https://bugzilla.gnome.org/show_bug.cgi?id=755455
2015-09-23 13:58:50 +01:00
Matthias Clasen
3c54fbd3ac Use stupid quotes instead of dumb quotes
Following a similar change in GLib a while ago.

'bla' may by stupid, but it looks less dumb than `bla'.
2015-09-23 07:01:16 -04:00
Matthias Clasen
1d46dfb0a7 container: Use qdata for focus chain 2015-09-23 07:01:16 -04:00
Matthias Clasen
c7c1f9ff61 widget: Add a few more inlined getters 2015-09-23 07:01:16 -04:00
Matthias Clasen
da45d29dbc size group: Streamline disposal
Remove widgets from their size groups in dispose, without connecting
to ::destroy. The signal handler is not necessary.
2015-09-23 07:01:16 -04:00
Matthias Clasen
cd35a14bbb size request: Avoid unnecessary reffing
There is no particular reason why we should have to ref the
widgets if they are in a size group - we are not reffing them
in the simple case either.
2015-09-23 07:01:16 -04:00
Matthias Clasen
e0be076652 size group: streamline iteration slightly
Instead of handling the horizontal and vertical peers separately
(and often, duplicatively), collect all peers in one go. At the
same time, avoid creating and destroying hash tables more often
than necessary.
2015-09-23 07:01:15 -04:00
Matthias Clasen
ac72a9cedc inspector: Ellipsize the accessible name
It can be long, and we don't want the inspector to grow excessively.
2015-09-23 07:01:15 -04:00
Matthias Clasen
525339573e text view: Use qdata with preallocated quarks 2015-09-23 07:01:15 -04:00
Matthias Clasen
b1bf153c99 entry: Use qdata with preallocated quarks 2015-09-23 07:01:15 -04:00
Matthias Clasen
1bb86c2056 label: Avoid recalculation in some cases
Avoid recalculation the entire label layout when nothing changed.
2015-09-23 07:01:15 -04:00
Matthias Clasen
ea241c691c scale: Drop unneeded private exports
Nobody outside gtkscale.c is using these functions, so make
them static.
2015-09-23 07:01:15 -04:00
Matthias Clasen
442ad755d4 assistant: Drop unneeded calls
GtkAssistant is just a regular composite widget nowadays,
no need to manually queue resizes.
2015-09-23 07:01:14 -04:00
Matthias Clasen
5dcbbc6736 style context: Trivial refactor
Use g_set_object for setting the frame clock.
2015-09-23 07:01:14 -04:00
Matthias Clasen
0b86b8b0a1 app chooser widget: protect against show_all
The visibility of the 'no apps' placeholder is managed by
the dialog, it should not be affected by gtk_widget_show_all.

https://bugzilla.gnome.org/show_bug.cgi?id=748080
2015-09-22 16:07:13 -04:00
Matthias Clasen
08e25b9ef7 app chooser: Avoid duplicates
At the time we populate the model "initially" in constructed(),
it has already been filled and cleared a couple of times (we do
that every time one of the construct properties gets set). So
we can't assume that the model is empty, and have to clear it
first. Otherwise, we add duplicates to the list.

https://bugzilla.gnome.org/show_bug.cgi?id=748080
2015-09-22 15:17:02 -04:00
Matthias Clasen
c1ad0f595c places view: fix a crash in finalize
Fix a GtkPlacesView crash in the test suite, _again_.
2015-09-21 19:42:28 -04:00
Matthias Clasen
47167f59be flow box: Fix up docs 2015-09-21 18:50:44 -04:00
Alexander Larsson
d29c48815c widget: get_widget_windows() don't modify window child lists
We can't modify the lists returned from gdk_window_peek_children,
instead use get_children().
2015-09-21 16:59:51 +02:00
Carlos Garnacho
b323252c14 widget: Make sure we only run controllers on realized widgets
The default event bubbling paths are prone to just running event controllers
even after the widget was potentially unrealized/destroyed in an event
handler callback, so bail out early if that's the case.

https://bugzilla.gnome.org/show_bug.cgi?id=755352
2015-09-21 15:55:33 +02:00
Carlos Garnacho
defa1e9c0d gesture: strengthen against destroyed windows
Bail out when we receive an event with an already destroyed window,
we'll hopefully get reset/cancelled afterwards on grab broken events.

https://bugzilla.gnome.org/show_bug.cgi?id=755352
2015-09-21 15:53:28 +02:00
Carlos Garnacho
e3d21accd0 window: cancel unclaimed sequences after GtkEventController::handle_event.
To GtkGesture machinery, if an event triggers a controller/gesture signal,
and gesture reset/cancellation as a result, the event has been managed
after all.

Commit e3bd895667 effectively changed the return value of the
wrapping gtk_event_controller_handle_event() function, which broke some
paths (eg. gtk_popover_button_press() wouldn't while the GTK+ grab was
active for this reason because the button press event was consumed early
on gtk_window_check_handle_wm_event()).

That patch is not too off-track given potential child widgets' behavior,
we want nonetheless to distinguish the denied vs cancelled paths here
(because GtkWindow itself relies on the GtkGesture behavior described in
the first paragraph on the begin_move/resize paths), so just reset
gestures after the event has already gone through the GtkEventController
so the return value is unaffected.
2015-09-21 14:32:44 +02:00
Carlos Garnacho
f860afc92e Revert "gtkwidget: Ensure unrealization during event dispatching cancels gestures"
This reverts commit 13873d2c50.
2015-09-18 12:59:00 +02:00
Carlos Garnacho
bdb854d92c Revert "widget: Fix propagation of gesture cancellation on widget unrealize/destroy"
This reverts commit 3aaf730901.
2015-09-18 12:57:26 +02:00
Carlos Garnacho
9577266d34 Revert "widget: Cancel also denied sequences"
This reverts commit 63e255e7b5.
2015-09-18 12:57:04 +02:00
Carlos Garnacho
e3bd895667 window: Reset on unhandled gestures right away
Traditionally a sequence is set to GTK_EVENT_SEQUENCE_DENIED state when
it is to be ignored, which means it is dormant, but still managed by the
gesture (accounting, "denied" sequences still make "slots" in multitouch
gesture busy, etc...).

This gesture will run for all button presses and releases in the window
though when presses happen on the "window content" region, and we can't
account for every children to be as educated as setting the proper mask
on every window, or ensuring events will be propagated as they should.

In order to cater for this, just reset the gestures, we can live without
such accounting in these specific GtkGestureSingle gestures.

https://bugzilla.gnome.org/show_bug.cgi?id=754098
2015-09-18 12:51:22 +02:00
Christian Hergert
e55a8b6aef pixelcache: use factor instead of margin
Instead of using a fixed size, use a factor of the surface size. This
helps in situations where animations of surrounding widgets are used
and cause a rapid rate of surface destroy/create cycles.
2015-09-16 11:24:29 -07:00
Carlos Garnacho
63e255e7b5 widget: Cancel also denied sequences
It makes no sense to skip denied sequences here, the gestures are
still carrying out the accounting for these, which must be also put
to an end if we're possibly not receiving any further events from
this sequence.

https://bugzilla.gnome.org/show_bug.cgi?id=754098
2015-09-16 19:16:39 +02:00
Carlos Garnacho
3aaf730901 widget: Fix propagation of gesture cancellation on widget unrealize/destroy
At the time event_check_cancel_sequence_on_hierarchy() is called, the widget
has been already unparented. Given the widget itself is being destroyed,
cancellation on it is impending in one way or another, we still must
propagate cancellation across all parents, so retrieve it early before
possible widget destruction.

https://bugzilla.gnome.org/show_bug.cgi?id=754098
2015-09-16 19:14:10 +02:00
Carlos Garnacho
5b6360ebb2 scrolledwindow: Set the scrollbar as "over" immediately during slider grabs
Otherwise it's attempted through a timeout, which gets cancelled early after,
and the slider disappears after a while with no mouse activity despite the
ongoing implicit grab.

Once the grab is finished, check_update_scrollbar_proximity() will be called
again on both scrollbars, and the fade out animation will be triggered as a
result.

https://bugzilla.gnome.org/show_bug.cgi?id=754745
2015-09-16 19:14:10 +02:00
Matthias Clasen
450056cdfe file chooser: Avoid a crash
When right-clicking in an empty folder, you should get a context
menu, not a crash. The code for positioning the popover was not
handling the eventuality of no row under the pointer. Just position
the popover right at the click location in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=755021
2015-09-16 07:41:02 -07:00
Matthias Clasen
ee8eb91523 widget path: Don't leak sibling paths 2015-09-15 19:33:49 -04:00
Alexander Larsson
d8d0188e86 css shadows: Cache blured masks for the corners of outset shadows
A lot of time was spend rendering the shadows on windows with CSD, in
particular the corner pieces, since they are the largest parts. This
patch catches this particular case and caches the pre-rendered blur
masks.

This makes the shadow code go from 25% to 8% of the time when resizing
gtk3-demo.
2015-09-15 16:05:50 +02:00
Alexander Larsson
f31e20247f css shadows: Break out side & corner shadows into helper functions
This changes nothing, but makes the code a bit easier to read
2015-09-15 16:05:50 +02:00