forked from AuroraMiddleware/gtk
API: widget: Remove GtkWidget::composited-changed signal
Nobody uses it. If you need the functionality, listen to display changes on your widget and then connect to the display's notify::composited.
This commit is contained in:
parent
b69328eb74
commit
a334316d5e
@ -551,7 +551,6 @@ enum {
|
||||
ACCEL_CLOSURES_CHANGED,
|
||||
SCREEN_CHANGED,
|
||||
CAN_ACTIVATE_ACCEL,
|
||||
COMPOSITED_CHANGED,
|
||||
QUERY_TOOLTIP,
|
||||
DRAG_FAILED,
|
||||
STYLE_UPDATED,
|
||||
@ -2109,23 +2108,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
|
||||
g_signal_set_va_marshaller (widget_signals[MOTION_NOTIFY_EVENT], G_TYPE_FROM_CLASS (klass),
|
||||
_gtk_marshal_BOOLEAN__BOXEDv);
|
||||
|
||||
/**
|
||||
* GtkWidget::composited-changed:
|
||||
* @widget: the object on which the signal is emitted
|
||||
*
|
||||
* The ::composited-changed signal is emitted when the composited
|
||||
* status of @widgets screen changes.
|
||||
* See gdk_screen_is_composited().
|
||||
*/
|
||||
widget_signals[COMPOSITED_CHANGED] =
|
||||
g_signal_new (I_("composited-changed"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
||||
G_STRUCT_OFFSET (GtkWidgetClass, composited_changed),
|
||||
NULL, NULL,
|
||||
NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
* GtkWidget::delete-event:
|
||||
* @widget: the object which received the signal
|
||||
@ -8886,26 +8868,6 @@ gtk_widget_is_composited (GtkWidget *widget)
|
||||
return gdk_screen_is_composited (screen);
|
||||
}
|
||||
|
||||
static void
|
||||
propagate_composited_changed (GtkWidget *widget,
|
||||
gpointer dummy)
|
||||
{
|
||||
if (GTK_IS_CONTAINER (widget))
|
||||
{
|
||||
gtk_container_forall (GTK_CONTAINER (widget),
|
||||
propagate_composited_changed,
|
||||
NULL);
|
||||
}
|
||||
|
||||
g_signal_emit (widget, widget_signals[COMPOSITED_CHANGED], 0);
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_widget_propagate_composited_changed (GtkWidget *widget)
|
||||
{
|
||||
propagate_composited_changed (widget, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* _gtk_widget_propagate_screen_changed:
|
||||
* @widget: a #GtkWidget
|
||||
|
@ -289,8 +289,6 @@ struct _GtkWidget
|
||||
* @can_activate_accel: Signal allows applications and derived widgets
|
||||
* to override the default GtkWidget handling for determining whether
|
||||
* an accelerator can be activated.
|
||||
* @composited_changed: Signal emitted when the composited status of
|
||||
* widgets screen changes. See gdk_screen_is_composited().
|
||||
* @query_tooltip: Signal emitted when “has-tooltip” is %TRUE and the
|
||||
* hover timeout has expired with the cursor hovering “above”
|
||||
* widget; or emitted when widget got focus in keyboard mode.
|
||||
@ -525,8 +523,6 @@ struct _GtkWidgetClass
|
||||
guint signal_id);
|
||||
|
||||
|
||||
void (* composited_changed) (GtkWidget *widget);
|
||||
|
||||
gboolean (* query_tooltip) (GtkWidget *widget,
|
||||
gint x,
|
||||
gint y,
|
||||
|
@ -213,7 +213,6 @@ void _gtk_widget_propagate_hierarchy_changed (GtkWidget *widget,
|
||||
GtkWidget *previous_toplevel);
|
||||
void _gtk_widget_propagate_screen_changed (GtkWidget *widget,
|
||||
GdkScreen *previous_screen);
|
||||
void _gtk_widget_propagate_composited_changed (GtkWidget *widget);
|
||||
|
||||
void _gtk_widget_set_device_window (GtkWidget *widget,
|
||||
GdkDevice *device,
|
||||
|
@ -506,8 +506,6 @@ static void get_shadow_width (GtkWindow *window,
|
||||
|
||||
static GtkKeyHash *gtk_window_get_key_hash (GtkWindow *window);
|
||||
static void gtk_window_free_key_hash (GtkWindow *window);
|
||||
static void gtk_window_on_composited_changed (GdkScreen *screen,
|
||||
GtkWindow *window);
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
static void gtk_window_on_theme_variant_changed (GtkSettings *settings,
|
||||
GParamSpec *pspec,
|
||||
@ -1694,10 +1692,6 @@ gtk_window_init (GtkWindow *window)
|
||||
toplevel_list = g_slist_prepend (toplevel_list, window);
|
||||
gtk_window_update_debugging ();
|
||||
|
||||
if (priv->screen)
|
||||
g_signal_connect_object (priv->screen, "composited-changed",
|
||||
G_CALLBACK (gtk_window_on_composited_changed), window, 0);
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
g_signal_connect_object (gtk_settings_get_for_screen (priv->screen),
|
||||
"notify::gtk-application-prefer-dark-theme",
|
||||
@ -5723,16 +5717,14 @@ gtk_window_finalize (GObject *object)
|
||||
priv->delete_event_handler = 0;
|
||||
}
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
if (priv->screen)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (priv->screen,
|
||||
gtk_window_on_composited_changed, window);
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
g_signal_handlers_disconnect_by_func (gtk_settings_get_for_screen (priv->screen),
|
||||
gtk_window_on_theme_variant_changed,
|
||||
window);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
g_free (priv->startup_id);
|
||||
|
||||
@ -10213,25 +10205,18 @@ gtk_window_set_screen (GtkWindow *window,
|
||||
priv->screen = screen;
|
||||
if (screen != previous_screen)
|
||||
{
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
if (previous_screen)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (previous_screen,
|
||||
gtk_window_on_composited_changed, window);
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
g_signal_handlers_disconnect_by_func (gtk_settings_get_for_screen (previous_screen),
|
||||
gtk_window_on_theme_variant_changed, window);
|
||||
#endif
|
||||
}
|
||||
g_signal_connect (screen, "composited-changed",
|
||||
G_CALLBACK (gtk_window_on_composited_changed), window);
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
g_signal_connect (gtk_settings_get_for_screen (screen),
|
||||
"notify::gtk-application-prefer-dark-theme",
|
||||
G_CALLBACK (gtk_window_on_theme_variant_changed), window);
|
||||
#endif
|
||||
|
||||
_gtk_widget_propagate_screen_changed (widget, previous_screen);
|
||||
_gtk_widget_propagate_composited_changed (widget);
|
||||
}
|
||||
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_SCREEN]);
|
||||
|
||||
@ -10271,16 +10256,6 @@ gtk_window_on_theme_variant_changed (GtkSettings *settings,
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
gtk_window_on_composited_changed (GdkScreen *screen,
|
||||
GtkWindow *window)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (window);
|
||||
|
||||
gtk_widget_queue_draw (widget);
|
||||
_gtk_widget_propagate_composited_changed (widget);
|
||||
}
|
||||
|
||||
static GdkScreen *
|
||||
gtk_window_check_screen (GtkWindow *window)
|
||||
{
|
||||
|
@ -222,10 +222,10 @@ build_alpha_widgets (void)
|
||||
}
|
||||
|
||||
static void
|
||||
on_composited_changed (GtkWidget *window,
|
||||
GtkLabel *label)
|
||||
on_composited_changed (GdkScreen *screen,
|
||||
GtkLabel *label)
|
||||
{
|
||||
gboolean is_composited = gtk_widget_is_composited (window);
|
||||
gboolean is_composited = gdk_screen_is_composited (screen);
|
||||
|
||||
if (is_composited)
|
||||
gtk_label_set_text (label, "Composited");
|
||||
@ -243,6 +243,7 @@ create_alpha_window (GtkWidget *widget)
|
||||
GtkWidget *content_area;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *label;
|
||||
GdkScreen *screen;
|
||||
|
||||
window = gtk_dialog_new_with_buttons ("Alpha Window",
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (widget)), 0,
|
||||
@ -264,8 +265,9 @@ create_alpha_window (GtkWidget *widget)
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE);
|
||||
on_composited_changed (window, GTK_LABEL (label));
|
||||
g_signal_connect (window, "composited_changed", G_CALLBACK (on_composited_changed), label);
|
||||
screen = gtk_widget_get_screen (window);
|
||||
on_composited_changed (screen, GTK_LABEL (label));
|
||||
g_signal_connect (screen, "composited_changed", G_CALLBACK (on_composited_changed), label);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), build_alpha_widgets (), TRUE, TRUE);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user