diff options
author | Sorokin Alexei <[email protected]> | 2016-06-18 23:48:12 +0300 |
---|---|---|
committer | Sorokin Alexei <[email protected]> | 2016-06-18 23:48:12 +0300 |
commit | 051d9df1ca81e586f43d1d95a1ac3159452d4f17 (patch) | |
tree | 025200ea2e9a76d70fc6f862bef99e240510fa92 /src/mate-screensaver-preferences.c | |
parent | 156f1b626cdd4e22beea0fbdba5869e2f693020a (diff) | |
download | mate-screensaver-051d9df1ca81e586f43d1d95a1ac3159452d4f17.tar.bz2 mate-screensaver-051d9df1ca81e586f43d1d95a1ac3159452d4f17.tar.xz |
Gtk3: fix several deprecations
Diffstat (limited to 'src/mate-screensaver-preferences.c')
-rw-r--r-- | src/mate-screensaver-preferences.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mate-screensaver-preferences.c b/src/mate-screensaver-preferences.c index fb0d311..5dd0757 100644 --- a/src/mate-screensaver-preferences.c +++ b/src/mate-screensaver-preferences.c @@ -301,12 +301,15 @@ config_set_lock (gboolean lock) static void preview_clear (GtkWidget *widget) { - GdkColor color = { 0, 0, 0 }; - - gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, &color); #if GTK_CHECK_VERSION (3, 0, 0) + GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 }; + + gdk_window_set_background_rgba (gtk_widget_get_window (widget), &black); gtk_widget_queue_draw (widget); #else + GdkColor black = { 0, 0x0000, 0x0000, 0x0000 }; + + gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, &black); gdk_window_clear (gtk_widget_get_window (widget)); #endif } @@ -1203,7 +1206,7 @@ fullscreen_preview_start_cb (GtkWidget *widget, static void constrain_list_size (GtkWidget *widget, - GtkRequisition *requisition, + GtkAllocation *allocation, GtkWidget *to_size) { GtkRequisition req; @@ -1218,14 +1221,14 @@ constrain_list_size (GtkWidget *widget, gtk_widget_size_request (to_size, &req); #endif - requisition->height = MIN (req.height, max_height); + allocation->height = MIN (req.height, max_height); } static void setup_list_size_constraint (GtkWidget *widget, GtkWidget *to_size) { - g_signal_connect (widget, "size-request", + g_signal_connect (widget, "size-allocate", G_CALLBACK (constrain_list_size), to_size); } |