Commit Graph

407 Commits

Author SHA1 Message Date
Matthias Clasen
31b7555b7b Stop using screen resolution
This api is going away.
2017-10-31 18:53:29 -04:00
Matthias Clasen
a27bfaa0a3 Drop the GDK_DPI_SCALE variable
It complicates the dpi handling, and was really just a workaround
for non-dpi aware applications when hidpi support was first introduced.
2017-10-31 18:37:54 -04:00
Benjamin Otte
ccd52a410e settings: Remove gtk_settings_get_for_screen()
All users of it are gone now.
2017-10-31 08:25:37 +01:00
Benjamin Otte
83fb7a649f css: Merge GtkStyleProviderPrivate into GtkStyleProvider
This is just lots of renaming.

The interface remains private, so the public API does not change, apart
from removing the definition of the Interface object to avoid
subclassing.
2017-10-31 04:33:54 +01:00
Benjamin Otte
9151e0b9f5 stylecontext: Port to use display instead of screen 2017-10-31 03:05:54 +01:00
Benjamin Otte
59cfd56365 settings: Don't store the screen in the settings object
Screens are going away.

Code that still needs the screen just gets it from the display.
2017-10-31 00:42:32 +01:00
Matthias Clasen
a1a5f556cb Some documentation updates
Document gtk_settings_get_for_display instead of for_screen.
2017-10-30 18:59:41 -04:00
Matthias Clasen
f9cc7ca140 Add gtk_settings_get_for_display
This will help us avoiding screens in many places.
2017-10-30 16:50:14 -04:00
Matthias Clasen
a518072e87 Remove GdkScreen api usage
Use GdkDisplay equivalents where they exist.
2017-10-30 16:06:42 -04:00
Matthias Clasen
1f22c6532e Store the display inside GtkSettings
This is a step towards dropping GdkScreen.
2017-10-30 15:56:03 -04:00
Matthias Clasen
2926669a9b gtk: Stop handling settings events
We don't need this anymore, now that we use the ::setting-changed
signal.
2017-10-30 09:48:51 -04:00
Matthias Clasen
a8aff6ef8f gtk: Connect to GdkDisplay::setting-changed
We still handle the setting event, for now.
That will be removed in a future commit.
2017-10-30 09:29:54 -04:00
Daniel Boles
9c3479b605 Settings: Mention Shift+primary click on Range too
This already existed, and since this doc blurb is already inflating
dramatically, what’s another half a line?
2017-10-11 22:35:31 +01:00
Daniel Boles
46e46ba099 Settings: Reflect resurrected middleclick in Range
and while here, make the explanation more explicit as to which values do
what, & use general Range terminology instead of focussing on scrollbars

https://bugzilla.gnome.org/show_bug.cgi?id=787669
2017-10-11 21:55:41 +01:00
Timm Bäder
cc5fb1db03 gtksettings: Fix code snippet
gtk_init does not take any arguments anymore and
GTK_TYPE_IMAGE_MENU_ITEM is gone.
2017-10-11 12:21:20 +02:00
Matthias Clasen
b5fe4c0a1d settings: Don't assert in notify
We can legitimately hit the default case in this switch,
so don't assert that we don't.
2017-10-06 19:30:27 -04:00
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Matthias Clasen
c68c754f3e settings: Convert to GdkEvent API 2017-09-19 18:39:02 +02:00
Philip Withnall
80b10aa1bd gtksettings: Add a debug message if there is no default GtkSettings
Make it slightly more obvious when things are about to slide sideways
because a NULL GtkSettings has been returned to a caller. This is a
valid return value, but is rarely handled correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=778382
2017-09-12 16:04:44 +01:00
Timm Bäder
b950b775fa gtksettings: Remove unnecessary deprecation guards
Nothing between them is deprecated.
2017-04-30 19:48:39 +02:00
Piotr Drąg
a2da4ddceb Use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772371
2016-12-19 15:08:10 -05:00
Matthias Clasen
17a061b8da Drop the settings color parser
We have no color-valued settings anymore.
2016-11-01 13:58:10 -04:00
Rico Tzschichholz
8abf05e194 gtk: Update path references from gtk-3.0 to gtk-4.0 2016-10-23 20:22:38 +02:00
Timm Bäder
31cf2e3bf5 gtksettings: Remove Deprecated API 2016-10-18 00:29:17 +02:00
Benjamin Otte
dbeeaf7de6 cssprovider: Remove GError out argument from load functions
People should use the GtkCssProvider::parsing-error signal instead.
2016-10-17 16:52:05 +02:00
Emmanuele Bassi
5880d1b990 gtk: Cast static strings assigned to non-const variables
GtkTargetEntry.target is particularly egregious, and it should really be
constified.
2016-10-17 11:44:10 +01:00
Benjamin Otte
05763e4875 settings: Pull in the RC parsing code 2016-10-16 18:17:21 +02:00
Benjamin Otte
fec8069e7b API: screen: Stop storing font options
font options are only ever set by the GtkSettings object and only ever
used inside GTK, so just store them there.
2016-10-16 18:17:21 +02:00
Matthias Clasen
b938cfe5be settings: Fix font names *again*
This is the last time, I hope.
2016-05-06 07:08:56 -04:00
Matthias Clasen
360a3c1690 Use a cheaper way to store settings per display
This was another very frequent use of qdata. Since we typically
have only one or two display objects, storing the display-settings
association in a simple array is faster than using object data
or a hash table.
2016-05-06 06:44:28 -04:00
Matthias Clasen
6b64c31f6d Generalize the previous commit
Update all xsettings when we get a screen, to prevent similar
problems from occurring in the future.
2016-05-05 14:13:03 -04:00
Matthias Clasen
fe7be14db8 settings: Avoid a crash
Christian Hergert reported seeing webkit crashes with recent
GTK+. The stacktrace points at the CSS machinery calling into
GtkSettings to get the font name, and then getting surprised
by a property notification that triggers style validation.

To avoid this, query the font name xsetting right away when
we get set a screen.
2016-05-05 13:32:58 -04:00
Matthias Clasen
1da048d19a settings: Fix xsettings handling
I was somehow under the misconception that we'd get GdkEventSettings
events for all the xsettings at startup. That is not in general true,
so we need to make sure that we check for the xsettings value before
we use them, or derived fields. Update all the private getters to
do so; and fix settings_update_font_values() to cope with font
descriptions that might miss the family or size.
2016-05-04 11:19:03 -04:00
Matthias Clasen
1d0ba98d5d settings: Ensure derived fields are initialized
I mistakenly assumed that gtk_settings_init was already doing
something to trigger a notify for all properties. It doesn't,
so we have to ensure that settings_update_font_values() is
called at least once.

https://bugzilla.gnome.org/show_bug.cgi?id=765966
2016-05-04 06:28:59 -04:00
Matthias Clasen
71d6816817 settings: Add setters for font family and size 2016-05-01 01:10:33 -04:00
Matthias Clasen
8e62cee075 Add a few settings getters 2016-04-30 22:39:58 -04:00
Matthias Clasen
7afc6b1fd5 settings: Cache xsettings
Instead of calling out to gdk every time an XSetting is requested,
cache the value (we already have the property_values array
anyway).

https://bugzilla.gnome.org/show_bug.cgi?id=765579
2016-04-28 23:29:43 -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
7cb36aba40 Load theme settings from the right location
When loading a per-theme settings.ini file, look for it in
the same directory where we found the gtk.css file for the
theme. Previously, we were always looking in
$prefix/share/themes/THEME/gtk-3.0/, even if the css was
loaded from somewhere else.

https://bugzilla.gnome.org/show_bug.cgi?id=641354
2016-03-21 22:19:19 -04:00
Matthias Clasen
13a94b66b6 Sync default double-click time with GNOME
The default value for the double-click key in the
org.gnome.settings-daemon.peripherals.mouse schema is 400.
Use the same value as the declared default for the
gtk-double-click-time GTK+ setting, to avoid pointless
differences in corner cases.

https://bugzilla.gnome.org/show_bug.cgi?id=720950
2016-03-07 07:50:29 -05:00
Matthias Clasen
c9371f6a18 Add a gtk-keynav-use-caret mode setting
For accessibility reasons, it is useful to have a global setting
that makes carets visible in all text.

https://bugzilla.gnome.org/show_bug.cgi?id=602526
https://bugzilla.gnome.org/show_bug.cgi?id=762799
2016-03-04 22:43:24 -05:00
Matthias Clasen
bbd94b5a9f gtk: Strip newlines from g_warning and g_error
g_logv adds one for us already.
2016-02-28 12:23:12 -05:00
Benjamin Otte
a620a1d688 win32: Remove unused functions / header includes 2016-02-11 03:44:48 +01:00
Alberts Muktupāvels
7ac337a9af gtksettings: fix critical warning
Commit 5186aeb90f introduced critical
warning - g_value_copy: assertion 'g_value_type_compatible (...)' failed.

https://bugzilla.gnome.org/show_bug.cgi?id=761381
2016-02-04 11:45:50 +02:00
Alberts Muktupāvels
5186aeb90f gtksettings: reset property to correct default value
https://bugzilla.gnome.org/show_bug.cgi?id=76138
2016-02-02 18:15:07 +02: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
Alberts Muktupāvels
8ffa8b3a49 gtksettings: notify after property reset 2015-12-23 05:55:47 +02:00
Matthias Clasen
98fd5bda58 Tweak the gtk-font-name setting docs
Clarify that only parts of the font name are used.

https://bugzilla.gnome.org/show_bug.cgi?id=758367
2015-11-23 08:18:37 -05:00
Matthias Clasen
1f585151fd Load settings.ini from all data dirs
An error in the loading function was making us load the file from
the first data dir repeatedly, instead.

https://bugzilla.gnome.org/show_bug.cgi?id=757377
2015-10-31 18:16:10 -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