Commit Graph

45594 Commits

Author SHA1 Message Date
Matthias Clasen
3f56c530b3 Be more careful with floating point divisions
The assumption that MIN() takes care of all infinities here
turns out to be wrong. We were getting inf and -nan for some
combinations of 0 width/height and corners, leading to invalid
matrices and cairo errors.

https://bugzilla.gnome.org/show_bug.cgi?id=759668
2016-01-08 13:17:58 -05:00
Matthias Clasen
709cc08603 x11: Simplify drag cancel animation setup
Instead of creating an intermediate pixbuf, just render
the window surface onto the new surface. Doing things this
way lets us avoid the cairo_surface_mark_dirty() call in
gdk_pixbuf_get_from_window(), which is not generally safe
to call on 'random' surfaces - it asserts that the surface
has no mime data attached, and the X11 backend uses mime
data for damage tracking purposes...
2016-01-08 11:33:24 -05:00
Matthias Clasen
ea0084cd99 x11: Keep the drag window alive longer
We destroy the widget that is wrapped around the drag window
when the object data on the drag context gets cleared. Destroying
the window before that happens leads to unpleasantries. E.g. we may
try to access the frame clock, which doesn't exist anymore, and
things go downhill from there. So, keep the window alive for
a little longer.
2016-01-08 11:33:24 -05:00
Matthias Clasen
f9e504d70e wayland: Keep the drag window alive longer
We destroy the widget that is wrapped around the drag window
when the object data on the drag context gets cleared. Destroying
the window before that happens leads to unpleasantries. E.g. we may
try to access the frame clock, which doesn't exist anymore, and
things go downhill from there. So, keep the window alive for
a little longer.
2016-01-08 11:22:47 -05:00
Matthias Clasen
d3aea5c498 Forgotten file
One was forgotten in the dark -> inverse rename.
2016-01-08 11:12:55 -05:00
Matthias Clasen
000b5b9055 color editor: Set a name on the color sample
This can be used to tweak the style from CSS, via #editor-color-sample.
2016-01-08 11:10:02 -05:00
Lapo Calamandrei
91123adba7 Adwaita: remove some now uneeded selectors
...related to image-button sizing which is handled differently now.
2016-01-08 16:48:01 +01:00
Lapo Calamandrei
5de71413fe Adwaita: colorchooser and color button style rewrite
fixing https://bugzilla.gnome.org/show_bug.cgi?id=760169 in the
process.
2016-01-08 16:41:58 +01:00
Chun-wei Fan
d07f00d98f CJK Windows: Silence gtk_style_context_set_state() warnings
We need to update calls to gtk_style_context_set_state() in
gtkimcontextime.c, so that the state passed into that function would be in
line with what GtkStyleContext expects, due to updates in the CSS
machinery, as outlined in this link[1], which is based on information in
in Matthias' blog[2].

Doing so will silence the gtk_style_context_set_state() warnings, which is
emitted when a widget uses gtkimcontext on Windows with CJK IME, which will
in turn call gtkimcontextime.

[1]: http://feaneron.com/2016/01/04/quick-guide-to-port-an-app-for-gtk-3-20/
[2]: https://blogs.gnome.org/mclasen/2015/11/20/a-gtk-update/

https://bugzilla.gnome.org/show_bug.cgi?id=760314
2016-01-08 23:37:31 +08:00
Matthias Clasen
4eb333801b Revert "Translate GDK_KEY_KP_Decimal according to locale"
This reverts commit 7c7fde136e.

Too much controversy for this minor improvement.
See https://bugzilla.gnome.org/show_bug.cgi?id=756751
2016-01-08 08:59:02 -05:00
Matthias Clasen
d72e061bb9 Rename the HighContastInverse css files
Renaming the files from -dark to -inverse makes it more obvious
that this is not a dark variant in the sense of the 'prefer-dark'
setting, but rather a separate theme (sharing the same CSS).
2016-01-08 07:39:17 -05:00
Matthias Clasen
0dd013d372 Document caret CSS properties 2016-01-08 07:33:20 -05:00
Matthias Clasen
9f247e112b Deprecate cursor-color style properties
These have been replaced by CSS properties.
2016-01-08 07:33:20 -05:00
Matthias Clasen
9b86d6da2c Use the caret-color properties for drawing carets
Replace the cursor-color and secondary-cursor-color style
properties with the caret-color and -gtk-secondary-caret-color
CSS properties.

For the 'auto' value of these properties, we keep the same
behavior that we used to have when the style properties are
not explicitly set.
2016-01-08 07:33:20 -05:00
Matthias Clasen
fdba244c38 Add the caret-color CSS property
This property is defined in http://www.w3.org/TR/css3-ui/#caret-color.
We also add a -gtk-secondary-caret-color property, since GTK+ has
supported differently colored split cursors in the past. Unlike
CSS, we don't support the weakly defined auto keyword, and just
use currentColor as the initial value.
2016-01-08 07:33:20 -05:00
Timm Bäder
feba047574 gtk3-demo: Remove unused GtkCellView 2016-01-08 13:30:43 +01:00
Alberto Ruiz
496f0892fc introspection: This patch fixes nullable return values fixes for the following symbols in gtk
gtk_accel_group_query
  gtk_accel_group_from_accel_closure
  gtk_accel_label_get_accel_widget
  gtk_accessible_get_widget
  gtk_actionable_get_action_name
  gtk_app_chooser_get_app_info
  gtk_app_chooser_button_get_heading
  gtk_app_chooser_dialog_get_heading
  gtk_application_get_window_by_id
  gtk_assistant_get_nth_page
  gtk_binding_set_find
  gtk_builder_get_object
  gtk_builder_lookup_callback_symbol
  gtk_builder_get_application
  gtk_button_get_image
  gtk_cell_area_get_focus_from_sibling
  gtk_cell_renderer_start_editing
  gtk_cell_view_get_model
  gtk_cell_view_get_displayed_row
  gtk_clipboard_get_owner
  gtk_container_get_focus_child
  gtk_container_get_focus_vadjustment
  gtk_container_get_focus_hadjustment
  gtk_dialog_get_widget_for_response
  gtk_drag_get_source_widget
  gtk_drag_dest_get_target_list
  gtk_drag_source_get_target_list
  gtk_entry_completion_get_model
  gtk_entry_completion_compute_prefix
  gtk_expander_get_label_widget
  gtk_file_chooser_get_filename
  gtk_file_chooser_get_current_folder
  gtk_file_chooser_get_uri
  gtk_file_chooser_get_current_folder_uri
  gtk_file_chooser_get_preview_widget
  gtk_file_chooser_get_preview_file
  gtk_file_chooser_get_preview_filename
  gtk_file_chooser_get_preview_uri
  gtk_file_chooser_get_extra_widget
  gtk_file_chooser_get_filter
  gtk_file_chooser_native_get_accept_label
  gtk_file_chooser_native_get_cancel_label
  gtk_file_filter_get_name
  gtk_font_chooser_get_font_family
  gtk_font_chooser_get_font_face
  gtk_font_chooser_get_font
  gtk_font_chooser_get_font_desc
  gtk_font_chooser_get_font_map
  gtk_frame_get_label
  gtk_gesture_get_device
  gtk_gesture_get_window
  gtk_gl_area_get_error
  gtk_header_bar_get_title
  gtk_header_bar_get_subtitle
  gtk_header_bar_get_custom_title
  gtk_icon_info_get_filename
  gtk_icon_view_get_path_at_pos
  gtk_icon_view_get_model
  gtk_image_get_pixbuf
  gtk_image_get_animation
  gtk_label_get_mnemonic_widget
  gtk_label_get_attributes
  gtk_check_version
  gtk_menu_button_get_popup
  gtk_menu_button_get_menu_model
  gtk_menu_button_get_align_widget
  gtk_menu_button_get_popover
  gtk_menu_item_get_submenu
  gtk_menu_item_get_accel_path
  gtk_native_dialog_get_title
  gtk_native_dialog_get_transient_for
  gtk_notebook_get_nth_page
  gtk_notebook_get_tab_label_text
  gtk_notebook_get_menu_label
  gtk_notebook_get_menu_label_text
  gtk_notebook_get_group_name
  gtk_notebook_get_action_widget
  gtk_offscreen_window_get_surface
  gtk_offscreen_window_get_pixbuf
  gtk_paned_get_child1
  gtk_paned_get_child2
  gtk_places_sidebar_get_location
  gtk_places_sidebar_get_nth_bookmark
  gtk_plug_get_socket_window
  gtk_popover_get_default_widget
  gtk_progress_bar_get_text
  gtk_recent_filter_get_name
  gtk_recent_manager_lookup_item
  gtk_settings_get_default
  gtk_socket_get_plug_window
  gtk_stack_sidebar_get_stack
  gtk_stack_switcher_get_stack
  gtk_style_context_get_section
  gtk_style_context_get_parent
  gtk_style_context_get_frame_clock
  gtk_test_find_widget
  gtk_text_buffer_get_mark
  gtk_text_tag_table_lookup
  gtk_text_view_get_tabs
  gtk_text_view_toggle_cursor_visible
  gtk_text_view_get_window
  gtk_toolbar_get_nth_item
  gtk_tool_button_get_label
  gtk_tool_button_get_icon_name
  gtk_tool_button_get_label_widget
  gtk_tool_button_get_icon_widget
  gtk_tool_palette_get_drop_item
  gtk_tool_palette_get_drop_group
  gtk_tree_model_filter_convert_child_path_to_path
  gtk_tree_model_filter_convert_path_to_child_path
  gtk_tree_model_sort_convert_child_path_to_path
  gtk_tree_model_sort_convert_path_to_child_path
  gtk_tree_view_get_column
  gtk_tree_view_get_bin_window
  gtk_tree_view_column_get_widget
  gtk_tree_view_column_get_tree_view
  gtk_widget_get_frame_clock
  gtk_window_group_get_current_device_grab
  GtkTextBufferSerializeFunc
2016-01-08 12:18:23 +00:00
Olivier Fourdan
120088b15f wayland: Update parent of dialogs without transient
X11 has the notions of "transient for group", and while it's an ICCCM
violation, it's commonly used and documented that a window manager
would treat a window with transient_for set to None to transient for all
windows of its group.

gtk uses this when an application sets a dialog type window but does not
specify an explicit transient.

While this works on X11, there is no such thing as groups in Wayland and
the closest equivalent which is set_parent() in xdg-shell takes only one
parent. This is what is used for modal dialogs.

To get something similar in behavior to what is available on X11, a
solution is to update the parent() of the dialogs without transient when
the active surface changes.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=759161
2016-01-08 11:55:41 +01:00
Olivier Fourdan
28f011eb05 wayland: prefer subsurface when possible
Quite a few applications use GTK_WINDOW_POPUP to create various
temporary windows and place then on screen. That works fine on X11 but
on Wayland there is no global coordinate system for regular surfaces.

If the application is using a gdk temp window and set a parent with
gtk_window_transient_for(), the gdk wayland backend has all it needs to
create a subsurface that can be placed at will by the application.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=759738
2016-01-08 10:33:26 +01:00
Timm Bäder
d85b3fc60d revealer: Propagate draw event 2016-01-08 09:38:32 +01:00
Timm Bäder
711ffd648e GtkPopover: Protect against transparent backgrounds
If the background is transparent, we can't use it for the input shape,
since that will be empty. Draw a box with rounded corners irectly
instead, in fully opaque black.

https://bugzilla.gnome.org/show_bug.cgi?id=759905
2016-01-08 09:14:03 +01:00
Ben Gamari
fa66b271f8 gdkwindow-x11: Ensure that extended update counter is freed
I believe this lead to rampant leakage of SyncCounters by
gnome-terminal.

https://bugzilla.gnome.org/show_bug.cgi?id=760188
2016-01-07 21:13:42 -05:00
Matthias Clasen
a45b1d1e3c inspector: Sort themes in the various theme combos
It is nicer if the themes show up in a predictable order,
so sort them alphabetically.
2016-01-07 19:56:05 -05:00
Matthias Clasen
ec02f055ed inspector: Add HighContrastInverse to list of themes 2016-01-07 19:56:05 -05:00
Matthias Clasen
0e473a5f1c Rename HighContrast-dark to HighContrastInverse
For accessibility purposes, it is better to have this as a
separate theme than as a dark variant of the HighContrast theme.
2016-01-07 19:56:05 -05:00
Lapo Calamandrei
4925493e49 Adwaita: rounded corners on iconview selection 2016-01-08 01:39:16 +01:00
Lapo Calamandrei
c0275b508d Adwaita: fix calendar invisible selection 2016-01-08 01:39:16 +01:00
Matthias Clasen
5b3001b6d5 colorswatch: Fix the overlay
I misunderstood what the overlay is good for: We need to allocate
it the full size of the widget. since we are using it to render
a background gradient *over* the application-rendered color.

At the same time, save some 100 lines of code by using an icon
helper as gadget, instead of handling the icon manually.
2016-01-07 19:20:55 -05:00
Matthias Clasen
1b3bb244b6 color swatch: Fix up rendering
gtk_render_content_path is expecting the full box dimensions,
not just the content area. So, add the border before calling it.

Note it is still possible to have some separation between the
color and the border, by setting padding.
2016-01-07 18:38:31 -05:00
Daiki Ueno
f9e6ccd592 gtkbuilder: Install gettext ITS files
Recent gettext has a feature to allow consumer projects to supply their
own string extraction rules for XML files, in ITS format.

Gettext still ships the rule for *.ui, but it would be better
maintained in the upstream project.

https://bugzilla.gnome.org/show_bug.cgi?id=760202
2016-01-07 18:08:30 -05:00
Daniel Mustieles
b1f6925727 Updated Spanish translation 2016-01-07 23:15:11 +01:00
Daniel Mustieles
c9ee47333f Updated Spanish translation 2016-01-07 23:14:58 +01:00
Matthias Clasen
9e63e61b16 Implement transitions for radial gradients
This was missing in the initial implementation.
2016-01-07 16:30:19 -05:00
Matthias Clasen
a7e2a9d8d3 Don't interpolate between keywords
Transitioning between linear gradients like
linear-gradient(to top, yellow, green) and
linear-gradient(to left, yellow, green) was yielding
nonsensical results, with the gradient line jumping around
wildly. Fix this by falling back to stupid image interpolation
for these cases.
2016-01-07 16:13:26 -05:00
Kjartan Maraas
cd6ca291bd Updated Norwegian bokmål translation. 2016-01-07 21:54:51 +01:00
Timm Bäder
ca6d01a678 GtkCssGadget: Set valid clip values for invisible gadgets 2016-01-07 20:39:37 +01:00
Matthias Clasen
8ecba89991 color swatch: Remove a stray frame
When using a gadget, the border is free, no need to call
gtk_render_frame ourselves.
2016-01-07 14:08:26 -05:00
Timm Bäder
0b96b8a1ee GtkModelButton: Remove some margins
Now that we can use margins from css for this, remove the margins we set
in code and use css instead.
2016-01-07 19:37:18 +01:00
Timm Bäder
2f61bc1866 GtkModelButton: Remove always-zero variable 2016-01-07 19:37:18 +01:00
Eric Williams
bbfec07e06 Clarified the function docs for gtk_css_provider_load_from_data().
https://bugzilla.gnome.org/show_bug.cgi?id=760238
2016-01-06 22:42:37 -05:00
Matthias Clasen
10cc35405e wayland: Only do cursor name fallback for standard names
Always returning a left_ptr if we can't find anything better
broke firefox application-specific fallback for missing cursors.
Keep that working by only doing the fallback for the CSS cursor
names, not for things like hashes.

https://bugzilla.gnome.org/show_bug.cgi?id=760141
2016-01-06 14:57:42 -05:00
Matthias Clasen
d9befb9086 x11: Only do cursor name fallback for standard names
Always returning a left_ptr if we can't find anything better
broke firefox application-specific fallback for missing cursors.
Keep that working by only doing the fallback for the CSS cursor
names, not for things like hashes.

https://bugzilla.gnome.org/show_bug.cgi?id=760141
2016-01-06 14:57:42 -05:00
Matthias Clasen
b6e11d087c Add context-menu to the list of standard cursor names
Adwaita doesn't have this one, but we are falling to the
default cursor anyway.
2016-01-06 14:57:42 -05:00
Matthias Clasen
d76fb63ba8 Add a test for ltr vs rtl boxes.
This tests that horizontal boxes flip their child nodes
according to text direction to maintain the left-to-right
ordering of child nodes for both text directions.
2016-01-06 14:57:42 -05:00
Matthias Clasen
a519a1a928 CSS node tests: Add a way to test rtl vs ltr
CSS nodes have a linear sibling relationship; this is supposed
to correspond to left-to-right placement in horizontal arrangements.
This commit explicitly sets the text direction to rtl if the
filename ends in .rtl.ui, so we can test differences in node
tree layout between text directions.
2016-01-06 14:57:42 -05:00
Timm Bäder
47afccb41b GtkListBox: Optimize _get_row_at_y a bit
Use g_sequence_lookup for a binary search over the rows.
2016-01-06 16:02:59 +01:00
Timm Bäder
a9d5fa4cfe GtkListBox: get_row_at_y can return NULL 2016-01-06 16:02:58 +01:00
Rico Tzschichholz
83fc4d591a HighContrast: Fix make dist 2016-01-06 15:21:22 +01:00
Felipe Borges
98080e0289 printing: always propagate Collate value
https://bugzilla.gnome.org/show_bug.cgi?id=728344
2016-01-06 14:50:49 +01:00
Chun-wei Fan
1fec39ef0b Visual Studio builds: Use _USE_MATH_DEFINES
... to fix the build as some C99 math constant macros are being used, such
as M_SQRT2.
2016-01-06 21:12:19 +08:00