Commit Graph

420 Commits

Author SHA1 Message Date
Benjamin Otte
a44ac75e65 gtk: Don't include gtkstylecontext.h from gtkcsstypesprivate.h
And make sure it's included everywhere it's needed.
2019-03-19 08:53:25 +01:00
Matthias Clasen
96fa1fb5c1 Drop key themes
These were an abuse of css, and not very successful
as a concept. We are going to replace bindings with
a new way of doing customizable shortcuts.
2019-02-21 12:22:50 -05:00
Emmanuele Bassi
25fd230327 gtk: Drop the "plus"
Source names should use "[gtk]" without the plus.
2019-02-05 11:26:20 +01:00
Benjamin Otte
5e96129be1 settings: Don't special case IM modules
The previous fixes made it unnecessary to hardcode IM modules for
different display types. The code now automatically skips system IM
modules for other displays.
2019-01-08 00:41:12 +01:00
Dorota Czaplejewicz
024220aee8 imwayland: Add text-input-unstable-v3 support
The wayland input module now represents text-input-unstable-v3 support, while the old module supporting gtk-text-input was renamed to gtkwayland.
2018-12-18 20:27:12 +01:00
Alexander Larsson
391727bd0d GdkWindow -> GdkSurface initial type rename
This renames the GdkWindow class and related classes (impl, backend
subclasses) to surface. Additionally it renames related types:
GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType,
GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge

This is an automatic conversion using the below commands:

git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass

git sed -f g GdkWindow GdkSurface
git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing
git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING
git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2"
git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE
git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo

git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE"
git sed -f g "broadway_window" "broadway_surface"
git sed -f g "BroadwayWindow" "BroadwaySurface"
git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE"
git sed -f g "wayland_window" "wayland_surface"
git sed -f g "WaylandWindow" "WaylandSurface"
git sed -f g "X11_WINDOW" "X11_SURFACE"
git sed -f g "x11_window" "x11_surface"
git sed -f g "X11Window" "X11Surface"
git sed -f g "WIN32_WINDOW" "WIN32_SURFACE"
git sed -f g "win32_window" "win32_surface"
git sed -f g "Win32Window" "Win32Surface"
git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE"
git sed -f g "quartz_window" "quartz_surface"
git sed -f g "QuartzWindow" "QuartzSurface"

git checkout NEWS* po-properties
2018-03-20 11:40:08 +01:00
Matthias Clasen
a732ebf521 Stop using settings for modules
The Wayland backend was already not supporting this setting
since it is an XSetting that is not backed by a GSetting.

Drop this setting altogether, since we will stop supporting
general-purpose modules.
2018-02-18 09:41:29 -05:00
Carlos Garnacho
f64c32113a gtksettings: Remove leftover code
The immodule variable is unused
2018-02-16 19:36:40 +01:00
Carlos Garnacho
21e9fe4f55 modules: Add wayland IM implementation
This IM context implementation goes through the gtk-text-input protocol,
leaving up to the compositor the actual interaction with IM engines.
2018-02-13 15:47:57 +01:00
Matthias Clasen
4c150d8eb5 The big versioning cleanup
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
2018-02-06 01:16:32 -05:00
Rico Tzschichholz
2d797dd816 Fix some parameter name mismatches to make g-ir-scanner happier 2017-11-28 15:24:49 +01:00
Matthias Clasen
dd7163a699 settings: Use gdk_display_set_cursor_theme
This allows us to reduce the amount of ifdef ugliness.
2017-11-17 17:56:03 -05:00
Matthias Clasen
2d591cde78 Include gdk-private.h
This gives us access to private gdk api.
2017-11-17 16:34:04 -05:00
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