[gnome-control-center] display: Fix deprecated API usage
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] display: Fix deprecated API usage
- Date: Fri, 5 Dec 2014 15:15:28 +0000 (UTC)
commit dd05918a4038451fa0391fe01983ed07ea824de3
Author: Rui Matos <tiagomatos gmail com>
Date: Tue Nov 25 19:54:21 2014 +0100
display: Fix deprecated API usage
https://bugzilla.gnome.org/show_bug.cgi?id=740986
panels/display/cc-display-panel.c | 6 ++----
panels/display/cc-rr-labeler.c | 13 ++++---------
panels/display/scrollarea.c | 4 +++-
3 files changed, 9 insertions(+), 14 deletions(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index b03fe4f..03dff74 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -1637,15 +1637,13 @@ list_box_item (const gchar *title,
label = gtk_label_new (title);
gtk_container_add (GTK_CONTAINER (item), label);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
- gtk_widget_set_size_request (label, 230, -1);
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
label = gtk_label_new (subtitle);
gtk_container_add (GTK_CONTAINER (item), label);
gtk_style_context_add_class (gtk_widget_get_style_context (label), GTK_STYLE_CLASS_DIM_LABEL);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
- gtk_widget_set_size_request (label, 230, -1);
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_container_add (GTK_CONTAINER (row), item);
diff --git a/panels/display/cc-rr-labeler.c b/panels/display/cc-rr-labeler.c
index f401355..2cd1e5e 100644
--- a/panels/display/cc-rr-labeler.c
+++ b/panels/display/cc-rr-labeler.c
@@ -351,7 +351,6 @@ create_label_window (CcRRLabeler *labeler, GnomeRROutputInfo *output)
GtkWidget *window;
GtkWidget *widget;
char *str;
- GdkRGBA white = { 1, 1, 1, 1 };
int x, y, display_num;
GdkScreen *screen;
GdkVisual *visual;
@@ -381,18 +380,14 @@ create_label_window (CcRRLabeler *labeler, GnomeRROutputInfo *output)
g_signal_connect (window, "composited-changed",
G_CALLBACK (label_window_composited_changed_cb), labeler);
- str = g_strdup_printf ("<span size='xx-large' font-weight='bold'>%d</span>", display_num);
- widget = gtk_label_new (NULL);
- gtk_label_set_markup (GTK_LABEL (widget), str);
- g_free (str);
-
/* Make the label explicitly white. We don't want it to follow the
* theme's colors, since the label is always shown against a black
* background. See bgo#556050
*/
- gtk_widget_override_color (widget,
- gtk_widget_get_state_flags (widget),
- &white);
+ str = g_strdup_printf ("<span size='xx-large' font-weight='bold' color='white'>%d</span>",
display_num);
+ widget = gtk_label_new (NULL);
+ gtk_label_set_markup (GTK_LABEL (widget), str);
+ g_free (str);
gtk_container_add (GTK_CONTAINER (window), widget);
diff --git a/panels/display/scrollarea.c b/panels/display/scrollarea.c
index db986d1..e71d2ec 100644
--- a/panels/display/scrollarea.c
+++ b/panels/display/scrollarea.c
@@ -508,7 +508,9 @@ emit_viewport_changed (FooScrollArea *scroll_area,
if (scroll_area->priv->input_window == NULL)
return;
- gdk_window_get_pointer (scroll_area->priv->input_window, &px, &py, NULL);
+ gdk_window_get_device_position (scroll_area->priv->input_window,
+ gdk_device_manager_get_client_pointer (gdk_display_get_device_manager
(gdk_display_get_default ())),
+ &px, &py, NULL);
#if 0
g_print ("procc\n");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]