diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-05-17 22:05:24 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-05-17 22:05:24 -0400 |
commit | d6818475d728acc861c57da4ffb741b4108e0bc6 (patch) | |
tree | 1374521e1b2752b778867e470c04d11cdeb24f97 /gdk/gdkdisplay.c | |
parent | 287c40276a8a3e39a76b12aa56f8520a04ecdf23 (diff) | |
download | gtk+-d6818475d728acc861c57da4ffb741b4108e0bc6.tar.gz |
gdk: Simplify gdk_display_supports_input_shapes
Make this a display property, and do away with
the vfunc in favor of a private setter, to match
how we handle other display characteristics.
Diffstat (limited to 'gdk/gdkdisplay.c')
-rw-r--r-- | gdk/gdkdisplay.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c index de17527e15..e67471e20d 100644 --- a/gdk/gdkdisplay.c +++ b/gdk/gdkdisplay.c @@ -71,6 +71,7 @@ enum PROP_0, PROP_COMPOSITED, PROP_RGBA, + PROP_INPUT_SHAPES, LAST_PROP }; @@ -113,6 +114,10 @@ gdk_display_get_property (GObject *object, g_value_set_boolean (value, gdk_display_is_rgba (display)); break; + case PROP_INPUT_SHAPES: + g_value_set_boolean (value, gdk_display_supports_input_shapes (display)); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -193,6 +198,19 @@ gdk_display_class_init (GdkDisplayClass *class) TRUE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); + /** + * GdkDisplay:input-shapes: + * + * %TRUE if the display supports input shapes. See + * gdk_display_supports_input_shapes() for details. + */ + props[PROP_INPUT_SHAPES] = + g_param_spec_boolean ("input-shapes", + P_("Input shapes"), + P_("Input shapes"), + TRUE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); + g_object_class_install_properties (object_class, LAST_PROP, props); /** @@ -322,6 +340,7 @@ gdk_display_init (GdkDisplay *display) display->composited = TRUE; display->rgba = TRUE; + display->input_shapes = TRUE; } static void @@ -1108,7 +1127,21 @@ gdk_display_supports_input_shapes (GdkDisplay *display) { g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE); - return GDK_DISPLAY_GET_CLASS (display)->supports_input_shapes (display); + return display->input_shapes; +} + +void +gdk_display_set_input_shapes (GdkDisplay *display, + gboolean input_shapes) +{ + g_return_if_fail (GDK_IS_DISPLAY (display)); + + if (display->input_shapes == input_shapes) + return; + + display->input_shapes = input_shapes; + + g_object_notify_by_pspec (G_OBJECT (display), props[PROP_INPUT_SHAPES]); } static GdkAppLaunchContext * |